tester supports large tests

This commit is contained in:
Araq 2013-03-18 08:22:35 +01:00
commit 09fc94c4c2
7 changed files with 715 additions and 1 deletions

View file

@ -178,7 +178,9 @@ proc runJsTests(r: var TResults, options: string) =
for t in os.walkFiles("tests/js/t*.nim"):
test(t)
for testfile in ["texceptions", "texcpt1", "texcsub", "tfinally", "tfinally2", "tfinally3", "tactiontable", "tmultim1", "tmultim3", "tmultim4"]:
for testfile in ["texceptions", "texcpt1", "texcsub", "tfinally",
"tfinally2", "tfinally3", "tactiontable", "tmultim1",
"tmultim3", "tmultim4"]:
test "tests/run/" & testfile & ".nim"
# ------------------------- register special tests here -----------------------
@ -195,6 +197,26 @@ proc runSpecialTests(r: var TResults, options: string) =
proc rejectSpecialTests(r: var TResults, options: string) =
rejectThreadTests(r, options)
proc findMainFile(dir: string): string =
# finds the file belonging to ".nimrod.cfg"; if there is no such file
# it returns the some ".nim" file if there is only one:
const cfgExt = ".nimrod.cfg"
result = ""
var nimFiles = 0
for kind, file in os.walkDir(dir):
if kind == pcFile:
if file.endsWith(cfgExt): return file[.. -(cfgExt.len+1)] & ".nim"
elif file.endsWith(".nim"):
if result.len == 0: result = file
inc nimFiles
if nimFiles != 1: result.setlen(0)
proc compileManyLoc(r: var TResults, options: string) =
for kind, dir in os.walkDir("tests/manyloc"):
if kind == pcDir:
let mainfile = findMainFile(dir)
compileSingleTest(r, mainfile, options)
proc compileSpecialTests(r: var TResults, options: string) =
compileRodFiles(r, options)
@ -203,6 +225,8 @@ proc compileSpecialTests(r: var TResults, options: string) =
compileDLLTests(r, options)
compileDebuggerTests(r, options)
compileManyLoc(r, options)
#var given = callCompiler("nimrod i", "nimrod i", options)
#r.addResult("nimrod i", given.msg, if given.err: reFailure else: reSuccess)