Modified tester output. Fixed JS tests.
This commit is contained in:
parent
941cc937d3
commit
c93c014bc6
2 changed files with 24 additions and 16 deletions
|
|
@ -179,10 +179,12 @@ proc jsTests(r: var TResults, cat: Category, options: string) =
|
||||||
|
|
||||||
for t in os.walkFiles("tests/js/t*.nim"):
|
for t in os.walkFiles("tests/js/t*.nim"):
|
||||||
test(t)
|
test(t)
|
||||||
for testfile in ["texceptions", "texcpt1", "texcsub", "tfinally",
|
for testfile in ["exception/texceptions", "exception/texcpt1",
|
||||||
"tfinally2", "tfinally3", "tactiontable", "tmultim1",
|
"exception/texcsub", "exception/tfinally",
|
||||||
"tmultim3", "tmultim4"]:
|
"exception/tfinally2", "exception/tfinally3",
|
||||||
test "tests/run/" & testfile & ".nim"
|
"actiontable/tactiontable", "method/tmultim1",
|
||||||
|
"method/tmultim3", "method/tmultim4"]:
|
||||||
|
test "tests/" & testfile & ".nim"
|
||||||
|
|
||||||
# ------------------------- manyloc -------------------------------------------
|
# ------------------------- manyloc -------------------------------------------
|
||||||
#proc runSpecialTests(r: var TResults, options: string) =
|
#proc runSpecialTests(r: var TResults, options: string) =
|
||||||
|
|
|
||||||
|
|
@ -111,10 +111,10 @@ proc addResult(r: var TResults, test: TTest,
|
||||||
r.data.addf("$#\t$#\t$#\t$#", name, expected, given, $success)
|
r.data.addf("$#\t$#\t$#\t$#", name, expected, given, $success)
|
||||||
if success notin {reSuccess, reIgnored}:
|
if success notin {reSuccess, reIgnored}:
|
||||||
styledEcho styleBright, name, fgRed, " [", $success, "]"
|
styledEcho styleBright, name, fgRed, " [", $success, "]"
|
||||||
styledEcho styleDim, "EXPECTED:"
|
echo"Expected:"
|
||||||
echo expected
|
styledEcho styleBright, expected
|
||||||
styledEcho styleDim, "GIVEN:"
|
echo"Given:"
|
||||||
echo given
|
styledEcho styleBright, given
|
||||||
|
|
||||||
proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest) =
|
proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest) =
|
||||||
if strip(expected.msg) notin strip(given.msg):
|
if strip(expected.msg) notin strip(given.msg):
|
||||||
|
|
@ -152,7 +152,7 @@ proc testSpec(r: var TResults, test: TTest) =
|
||||||
# major entry point for a single test
|
# major entry point for a single test
|
||||||
let tname = test.name.addFileExt(".nim")
|
let tname = test.name.addFileExt(".nim")
|
||||||
inc(r.total)
|
inc(r.total)
|
||||||
echo extractFilename(tname)
|
styledEcho "Processing ", fgCyan, extractFilename(tname)
|
||||||
var expected = parseSpec(tname)
|
var expected = parseSpec(tname)
|
||||||
if expected.err == reIgnored:
|
if expected.err == reIgnored:
|
||||||
r.addResult(test, "", "", reIgnored)
|
r.addResult(test, "", "", reIgnored)
|
||||||
|
|
@ -178,8 +178,11 @@ proc testSpec(r: var TResults, test: TTest) =
|
||||||
exeFile = changeFileExt(tname, ExeExt)
|
exeFile = changeFileExt(tname, ExeExt)
|
||||||
|
|
||||||
if existsFile(exeFile):
|
if existsFile(exeFile):
|
||||||
|
if findExe("nodejs") == "":
|
||||||
|
r.addResult(test, expected.outp, "nodejs binary not in PATH", reExeNotFound)
|
||||||
|
return
|
||||||
var (buf, exitCode) = execCmdEx(
|
var (buf, exitCode) = execCmdEx(
|
||||||
(if test.target==targetJS: "node " else: "") & exeFile)
|
(if test.target == targetJS: "nodejs " else: "") & exeFile)
|
||||||
if exitCode != expected.ExitCode:
|
if exitCode != expected.ExitCode:
|
||||||
r.addResult(test, "exitcode: " & $expected.exitCode,
|
r.addResult(test, "exitcode: " & $expected.exitCode,
|
||||||
"exitcode: " & $exitCode, reExitCodesDiffer)
|
"exitcode: " & $exitCode, reExitCodesDiffer)
|
||||||
|
|
@ -238,9 +241,12 @@ proc main() =
|
||||||
var r = initResults()
|
var r = initResults()
|
||||||
case action
|
case action
|
||||||
of "all":
|
of "all":
|
||||||
for kind, dir in walkDir("tests"):
|
let testsDir = "tests" & dirSep
|
||||||
if kind == pcDir and dir notin ["testament", "testdata", "nimcache"]:
|
for kind, dir in walkDir(testsDir):
|
||||||
processCategory(r, Category(dir), p.cmdLineRest.string)
|
assert testsDir.startsWith(testsDir)
|
||||||
|
let cat = dir[testsDir.len .. -1]
|
||||||
|
if kind == pcDir and cat notin ["testament", "testdata", "nimcache"]:
|
||||||
|
processCategory(r, Category(cat), p.cmdLineRest.string)
|
||||||
for a in AdditionalCategories:
|
for a in AdditionalCategories:
|
||||||
processCategory(r, Category(a), p.cmdLineRest.string)
|
processCategory(r, Category(a), p.cmdLineRest.string)
|
||||||
of "c", "cat", "category":
|
of "c", "cat", "category":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue