use targets from test spec when running testament tests (#6687)

This commit is contained in:
Jacek Sieka 2017-11-16 05:37:51 +08:00 • committed by Andreas Rumpf
commit b122836acf
21 changed files with 124 additions and 113 deletions

View file

@ -219,9 +219,9 @@ proc debuggerTests(r: var TResults, cat: Category, options: string) =
proc jsTests(r: var TResults, cat: Category, options: string) =
template test(filename: untyped) =
testSpec r, makeTest(filename, options & " -d:nodejs", cat,
actionRun, targetJS)
actionRun), targetJS
testSpec r, makeTest(filename, options & " -d:nodejs -d:release", cat,
actionRun, targetJS)
actionRun), targetJS
for t in os.walkFiles("tests/js/t*.nim"):
test(t)
@ -245,10 +245,10 @@ proc testNimInAction(r: var TResults, cat: Category, options: string) =
testSpec r, makeTest(filename, options, cat, action)
template testJS(filename: untyped) =
testSpec r, makeTest(filename, options, cat, actionCompile, targetJS)
testSpec r, makeTest(filename, options, cat, actionCompile), targetJS
template testCPP(filename: untyped) =
testSpec r, makeTest(filename, options, cat, actionCompile, targetCPP)
testSpec r, makeTest(filename, options, cat, actionCompile), targetCPP
let tests = [
"niminaction/Chapter3/ChatApp/src/server",
@ -387,7 +387,7 @@ proc testNimblePackages(r: var TResults, cat: Category, filter: PackageFilter) =
installStatus = waitForExitEx(installProcess)
installProcess.close
if installStatus != QuitSuccess:
r.addResult(test, "", "", reInstallFailed)
r.addResult(test, targetC, "", "", reInstallFailed)
continue
let
@ -396,12 +396,12 @@ proc testNimblePackages(r: var TResults, cat: Category, filter: PackageFilter) =
buildStatus = waitForExitEx(buildProcess)
buildProcess.close
if buildStatus != QuitSuccess:
r.addResult(test, "", "", reBuildFailed)
r.addResult(test, "", "", reSuccess)
r.addResult(packageFileTest, "", "", reSuccess)
r.addResult(test, targetC, "", "", reBuildFailed)
r.addResult(test, targetC, "", "", reSuccess)
r.addResult(packageFileTest, targetC, "", "", reSuccess)
except JsonParsingError:
echo("[Warning] - Cannot run nimble tests: Invalid package file.")
r.addResult(packageFileTest, "", "", reBuildFailed)
r.addResult(packageFileTest, targetC, "", "", reBuildFailed)
# ----------------------------------------------------------------------------
@ -420,7 +420,7 @@ proc processSingleTest(r: var TResults, cat: Category, options, test: string) =
let test = "tests" & DirSep &.? cat.string / test
let target = if cat.string.normalize == "js": targetJS else: targetC
if existsFile(test): testSpec r, makeTest(test, options, cat, target = target)
if existsFile(test): testSpec r, makeTest(test, options, cat), target
else: echo "[Warning] - ", test, " test does not exist"
proc processCategory(r: var TResults, cat: Category, options: string) =