diff options
Diffstat (limited to 'testament/categories.nim')
-rw-r--r-- | testament/categories.nim | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/testament/categories.nim b/testament/categories.nim index add080020..a2ce8a094 100644 --- a/testament/categories.nim +++ b/testament/categories.nim @@ -11,6 +11,7 @@ ## of the compiler. import important_packages +import sequtils const specialCategories = [ @@ -688,8 +689,22 @@ proc runJoinedTest(r: var TResults, cat: Category, testsDir: string) = # --------------------------------------------------------------------------- -proc processCategory(r: var TResults, cat: Category, options, testsDir: string, +proc loadSkipFrom(name: string): seq[string] = + # One skip per line, comments start with # + # used by `nlvm` (at least) + try: + for line in lines(name): + let sline = line.strip() + if sline.len > 0 and not sline.startsWith("#"): + result.add sline + except: + echo "Could not load " & name & ", ignoring" + +proc processCategory(r: var TResults, cat: Category, + options, testsDir, skipFrom: string, runJoinableTests: bool) = + let skips = loadSkipFrom(skipFrom) + case cat.string.normalize of "rodfiles": when false: @@ -745,6 +760,9 @@ proc processCategory(r: var TResults, cat: Category, options, testsDir: string, for i, name in files: var test = makeTest(name, options, cat) + if skips.anyIt(it in name): + test.spec.err = reDisabled + if runJoinableTests or not isJoinableSpec(test.spec) or cat.string in specialCategories: discard "run the test" else: |