fix #14242 testament r tests/js/foo now works; testament now honors --targets (#16163)

* fix #14242 `testament r tests/js/foo` now works; testament now honors --targets

* fix shouldfail
This commit is contained in:
Timothee Cour 2020-11-28 10:33:36 -08:00 • committed by GitHub
commit 1d786c0a54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 30 deletions

View file

@ -563,13 +563,13 @@ proc `&.?`(a, b: string): string =
# candidate for the stdlib?
result = if b.startsWith(a): b else: a & b
proc processSingleTest(r: var TResults, cat: Category, options, test: string) =
let test = testsDir &.? cat.string / test
let target = if cat.string.normalize == "js": targetJS else: targetC
if fileExists(test):
testSpec r, makeTest(test, options, cat), {target}
else:
doAssert false, test & " test does not exist"
proc processSingleTest(r: var TResults, cat: Category, options, test: string, targets: set[TTarget], targetsSet: bool) =
var targets = targets
if not targetsSet:
let target = if cat.string.normalize == "js": targetJS else: targetC
targets = {target}
doAssert fileExists(test), test & " test does not exist"
testSpec r, makeTest(test, options, cat), targets
proc isJoinableSpec(spec: TSpec): bool =
result = not spec.sortoutput and