tester: add test skipping capability (#11080)
This commit is contained in:
parent
02920c2cd9
commit
3c689c1f2e
2 changed files with 29 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue