Skip to content

Commit

Permalink
allow category nimble-packages to test a single package (nim-lang#13576)
Browse files Browse the repository at this point in the history
  • Loading branch information
krux02 authored Mar 18, 2020
1 parent fb64148 commit 88566cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions testament/categories.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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":
Expand Down
1 change: 0 additions & 1 deletion testament/testament.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 88566cc

Please sign in to comment.