mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 13:30:33 +00:00
allow category nimble-packages to test a single package (#13576)
This commit is contained in:
@@ -478,7 +478,7 @@ proc makeSupTest(test, options: string, cat: Category): TTest =
|
||||
result.options = options
|
||||
result.startTime = epochTime()
|
||||
|
||||
proc testNimblePackages(r: var TResults, cat: Category) =
|
||||
proc testNimblePackages(r: var TResults; cat: Category; packageFilter: string) =
|
||||
if nimbleExe == "":
|
||||
echo "[Warning] - Cannot run nimble tests: Nimble binary not found."
|
||||
return
|
||||
@@ -491,6 +491,8 @@ proc testNimblePackages(r: var TResults, cat: Category) =
|
||||
var errors = 0
|
||||
try:
|
||||
for name, url, cmd, hasDep in listPackages():
|
||||
if packageFilter notin name:
|
||||
continue
|
||||
inc r.total
|
||||
var test = makeSupTest(url, "", cat)
|
||||
let buildPath = packagesDir / name
|
||||
@@ -706,7 +708,7 @@ proc processCategory(r: var TResults, cat: Category,
|
||||
compileExample(r, "examples/gtk/*.nim", options, cat)
|
||||
compileExample(r, "examples/talk/*.nim", options, cat)
|
||||
of "nimble-packages":
|
||||
testNimblePackages(r, cat)
|
||||
testNimblePackages(r, cat, options)
|
||||
of "niminaction":
|
||||
testNimInAction(r, cat, options)
|
||||
of "untestable":
|
||||
|
||||
@@ -717,7 +717,6 @@ proc main() =
|
||||
of "c", "cat", "category":
|
||||
skips = loadSkipFrom(skipFrom)
|
||||
var cat = Category(p.key)
|
||||
p.next
|
||||
processCategory(r, cat, p.cmdLineRest.string, testsDir, runJoinableTests = true)
|
||||
of "pcat":
|
||||
skips = loadSkipFrom(skipFrom)
|
||||
|
||||
Reference in New Issue
Block a user