diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-09-30 21:16:36 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-09-30 21:16:36 +0200 |
commit | 2d2f152e3c66af45d262e9ba72f69e67a829c66a (patch) | |
tree | 2a6a85e4cc48c7809f2fc42ed4fde8a0430fe44a | |
parent | 5a003532d0660a962a978ee6763dd9b3a5425ab8 (diff) | |
parent | 435fbbc943fb0d932e4d2750a3e8e76a102c8d00 (diff) | |
download | Nim-2d2f152e3c66af45d262e9ba72f69e67a829c66a.tar.gz |
Merge pull request #3398 from tmm1/run-single-test
Allow testament/tester to run single file
-rw-r--r-- | tests/testament/categories.nim | 4 | ||||
-rw-r--r-- | tests/testament/tester.nim | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/testament/categories.nim b/tests/testament/categories.nim index 4de1edeee..afc4a616f 100644 --- a/tests/testament/categories.nim +++ b/tests/testament/categories.nim @@ -339,7 +339,7 @@ proc `&?.`(a, b: string): string = # candidate for the stdlib? result = if a.endswith(b): a else: a & b -proc processCategory(r: var TResults, cat: Category, options: string) = +proc processCategory(r: var TResults, cat: Category, options: string, fileGlob: string = "t*.nim") = case cat.string.normalize of "rodfiles": discard # Disabled for now @@ -376,5 +376,5 @@ proc processCategory(r: var TResults, cat: Category, options: string) = of "nimble-all": testNimblePackages(r, cat, pfAll) else: - for name in os.walkFiles("tests" & DirSep &.? cat.string / "t*.nim"): + for name in os.walkFiles("tests" & DirSep &.? cat.string / fileGlob): testSpec r, makeTest(name, options, cat) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index b138c9909..3961f15c4 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -23,6 +23,7 @@ const Command: all run all tests c|category <category> run all the tests of a certain category + r|run <test> run single test file html [commit] generate $1 from the database; uses the latest commit or a specific one (use -1 for the commit before latest etc) @@ -376,6 +377,11 @@ proc main() = var cat = Category(p.key) p.next processCategory(r, cat, p.cmdLineRest.string) + of "r", "run": + let (dir, file) = splitPath(p.key.string) + let (_, subdir) = splitPath(dir) + var cat = Category(subdir) + processCategory(r, cat, p.cmdLineRest.string, file) of "html": var commit = 0 discard parseInt(p.cmdLineRest.string, commit) |