diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-02-09 04:44:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-09 13:44:16 +0100 |
commit | debe7fffd8f69c3cd4aec14deedd6f7d534dd3cd (patch) | |
tree | 91ff5d3724381e87a22287a1760af9ced48e1161 | |
parent | 240174dd81781e279d84090f1937ebf4b971e29c (diff) | |
download | Nim-debe7fffd8f69c3cd4aec14deedd6f7d534dd3cd.tar.gz |
testament: this now works: "testament r /abspath/to/test.nim" (#13358)
-rw-r--r-- | testament/testament.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/testament/testament.nim b/testament/testament.nim index b90a72a2d..a437f18dd 100644 --- a/testament/testament.nim +++ b/testament/testament.nim @@ -734,11 +734,13 @@ proc main() = p.next processPattern(r, pattern, p.cmdLineRest.string, simulate) of "r", "run": + var subPath = p.key.string + if subPath.isAbsolute: subPath = subPath.relativePath(getCurrentDir()) # at least one directory is required in the path, to use as a category name - let pathParts = split(p.key.string, {DirSep, AltSep}) + let pathParts = split(subPath, {DirSep, AltSep}) # "stdlib/nre/captures.nim" -> "stdlib" + "nre/captures.nim" let cat = Category(pathParts[0]) - let subPath = joinPath(pathParts[1..^1]) + subPath = joinPath(pathParts[1..^1]) processSingleTest(r, cat, p.cmdLineRest.string, subPath) of "html": generateHtml(resultsFile, optFailing) |