fixed the rodfiles tests
This commit is contained in:
parent
4841b6390c
commit
371619c43a
5 changed files with 39 additions and 36 deletions
|
|
@ -942,9 +942,9 @@ proc genInitCode(m: BModule) =
|
|||
app(prc, genSectionStart(cpsStmts))
|
||||
app(prc, m.preInitProc.s(cpsStmts))
|
||||
app(prc, m.initProc.s(cpsStmts))
|
||||
app(prc, genSectionEnd(cpsStmts))
|
||||
if optStackTrace in m.initProc.options and not m.PreventStackTrace:
|
||||
app(prc, deinitFrame(m.initProc))
|
||||
app(prc, genSectionEnd(cpsStmts))
|
||||
app(prc, deinitGCFrame(m.initProc))
|
||||
appf(prc, "}$N$N")
|
||||
|
||||
|
|
|
|||
|
|
@ -407,7 +407,7 @@ proc decodeSym(r: PRodReader, info: TLineInfo): PSym =
|
|||
if r.s[r.pos] == '%':
|
||||
inc(r.pos)
|
||||
result.position = decodeVInt(r.s, r.pos)
|
||||
elif result.kind notin routineKinds:
|
||||
elif result.kind notin routineKinds + {skModule}:
|
||||
result.position = 0
|
||||
# this may have been misused as reader index! But we still
|
||||
# need it for routines as the body is loaded lazily.
|
||||
|
|
|
|||
2
tests/rodfiles/nimrod.cfg
Normal file
2
tests/rodfiles/nimrod.cfg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
--nimcache:"$projectPath/nimcache"
|
||||
--symbolFiles:on
|
||||
|
|
@ -23,14 +23,10 @@ proc delNimCache() =
|
|||
except EOS:
|
||||
echo "[Warning] could not delete: ", nimcacheDir
|
||||
|
||||
proc plusCache(options: string): string = return options &
|
||||
" --symbolFiles:on --nimcache:" & nimcacheDir
|
||||
|
||||
proc runRodFiles(r: var TResults, options: string) =
|
||||
template test(filename: expr): stmt =
|
||||
runSingleTest(r, rodfilesDir / filename, options)
|
||||
|
||||
var options = options.plusCache
|
||||
delNimCache()
|
||||
|
||||
# test basic recompilation scheme:
|
||||
|
|
@ -64,7 +60,6 @@ proc compileRodFiles(r: var TResults, options: string) =
|
|||
template test(filename: expr): stmt =
|
||||
compileSingleTest(r, rodfilesDir / filename, options)
|
||||
|
||||
var options = options.plusCache
|
||||
delNimCache()
|
||||
# test DLL interfacing:
|
||||
test "gtkex1"
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ const
|
|||
cmdTemplate = r"nimrod cc --hints:on $# $#"
|
||||
resultsFile = "testresults.html"
|
||||
jsonFile = "testresults.json"
|
||||
Usage = "usage: tester reject|compile|examples|run|merge [nimrod options]\n" &
|
||||
Usage = "usage: tester [--print] " &
|
||||
"reject|compile|examples|run|" &
|
||||
"merge|special|rodfiles| [nimrod options]\n" &
|
||||
" or: tester test|comp|rej singleTest"
|
||||
|
||||
type
|
||||
|
|
@ -335,40 +337,48 @@ proc main() =
|
|||
runJson = "run.json"
|
||||
rejectJson = "reject.json"
|
||||
|
||||
var optPrintResults = false
|
||||
var p = initOptParser()
|
||||
p.next()
|
||||
if p.kind == cmdLongoption:
|
||||
case p.key
|
||||
of "print": optPrintResults = true
|
||||
else: quit usage
|
||||
p.next()
|
||||
if p.kind != cmdArgument: quit usage
|
||||
var action = p.key.string.normalize
|
||||
p.next()
|
||||
var r = initResults()
|
||||
case action
|
||||
of "reject":
|
||||
var rejectRes = initResults()
|
||||
reject(rejectRes, "tests/reject", p.cmdLineRest.string)
|
||||
rejectSpecialTests(rejectRes, p.cmdLineRest.string)
|
||||
writeResults(rejectJson, rejectRes)
|
||||
reject(r, "tests/reject", p.cmdLineRest.string)
|
||||
rejectSpecialTests(r, p.cmdLineRest.string)
|
||||
writeResults(rejectJson, r)
|
||||
of "compile":
|
||||
var compileRes = initResults()
|
||||
compile(compileRes, "tests/compile/t*.nim", p.cmdLineRest.string)
|
||||
compile(compileRes, "tests/ecmas.nim", p.cmdLineRest.string)
|
||||
compileSpecialTests(compileRes, p.cmdLineRest.string)
|
||||
writeResults(compileJson, compileRes)
|
||||
compile(r, "tests/compile/t*.nim", p.cmdLineRest.string)
|
||||
compile(r, "tests/ecmas.nim", p.cmdLineRest.string)
|
||||
compileSpecialTests(r, p.cmdLineRest.string)
|
||||
writeResults(compileJson, r)
|
||||
of "examples":
|
||||
var compileRes = readResults(compileJson)
|
||||
compileExample(compileRes, "lib/pure/*.nim", p.cmdLineRest.string)
|
||||
compileExample(compileRes, "examples/*.nim", p.cmdLineRest.string)
|
||||
compileExample(compileRes, "examples/gtk/*.nim", p.cmdLineRest.string)
|
||||
writeResults(compileJson, compileRes)
|
||||
compileExample(r, "lib/pure/*.nim", p.cmdLineRest.string)
|
||||
compileExample(r, "examples/*.nim", p.cmdLineRest.string)
|
||||
compileExample(r, "examples/gtk/*.nim", p.cmdLineRest.string)
|
||||
writeResults(compileJson, r)
|
||||
of "run":
|
||||
var runRes = initResults()
|
||||
run(runRes, "tests/run", p.cmdLineRest.string)
|
||||
runSpecialTests(runRes, p.cmdLineRest.string)
|
||||
writeResults(runJson, runRes)
|
||||
run(r, "tests/run", p.cmdLineRest.string)
|
||||
runSpecialTests(r, p.cmdLineRest.string)
|
||||
writeResults(runJson, r)
|
||||
of "special":
|
||||
runSpecialTests(r, p.cmdLineRest.string)
|
||||
writeResults(runJson, r)
|
||||
of "rodfiles":
|
||||
runRodFiles(r, p.cmdLineRest.string)
|
||||
writeResults(runJson, r)
|
||||
of "js":
|
||||
var runRes = initResults()
|
||||
if existsFile(runJSon):
|
||||
runRes = readResults(runJson)
|
||||
runJsTests(runRes, p.cmdLineRest.string)
|
||||
writeResults(runJson, runRes)
|
||||
r = readResults(runJson)
|
||||
runJsTests(r, p.cmdLineRest.string)
|
||||
writeResults(runJson, r)
|
||||
of "merge":
|
||||
var rejectRes = readResults(rejectJson)
|
||||
var compileRes = readResults(compileJson)
|
||||
|
|
@ -376,15 +386,10 @@ proc main() =
|
|||
listResults(rejectRes, compileRes, runRes)
|
||||
outputJSON(rejectRes, compileRes, runRes)
|
||||
of "dll":
|
||||
var r = initResults()
|
||||
runDLLTests r, p.cmdLineRest.string
|
||||
echo r.data, r
|
||||
of "gc":
|
||||
var r = initResults()
|
||||
runGCTests(r, p.cmdLineRest.string)
|
||||
echo r.data, r
|
||||
of "test", "comp", "rej":
|
||||
var r = initResults()
|
||||
if p.kind != cmdArgument: quit usage
|
||||
var testFile = p.key.string
|
||||
p.next()
|
||||
|
|
@ -394,10 +399,11 @@ proc main() =
|
|||
compileSingleTest(r, testFile, p.cmdLineRest.string)
|
||||
else:
|
||||
runSingleTest(r, testFile, p.cmdLineRest.string)
|
||||
echo r.data, r
|
||||
else:
|
||||
quit usage
|
||||
|
||||
if optPrintResults: echo r, r.data
|
||||
|
||||
if paramCount() == 0:
|
||||
quit usage
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue