testament: apply skip to hard-coded categories (#11168)
* testament: apply skip to hard-coded categories * allow disabling megatest
This commit is contained in:
parent
1e89e5bf9c
commit
3d9269195f
3 changed files with 56 additions and 29 deletions
|
|
@ -551,7 +551,8 @@ proc testNimblePackages(r: var TResults, cat: Category) =
|
|||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
const AdditionalCategories = ["debugger", "examples", "lib", "megatest"]
|
||||
const AdditionalCategories = ["debugger", "examples", "lib"]
|
||||
const MegaTestCat = "megatest"
|
||||
|
||||
proc `&.?`(a, b: string): string =
|
||||
# candidate for the stdlib?
|
||||
|
|
@ -679,22 +680,9 @@ proc runJoinedTest(r: var TResults, cat: Category, 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,
|
||||
options, testsDir: string,
|
||||
runJoinableTests: bool) =
|
||||
let skips = loadSkipFrom(skipFrom)
|
||||
|
||||
case cat.string.normalize
|
||||
of "rodfiles":
|
||||
when false:
|
||||
|
|
@ -750,9 +738,6 @@ proc processCategory(r: var TResults, cat: Category,
|
|||
|
||||
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