bugfixes for the testsuite
This commit is contained in:
parent
25e813b5d0
commit
8c03d96c6a
2 changed files with 18 additions and 15 deletions
|
|
@ -642,7 +642,7 @@ proc execCmdEx*(command: string, options: set[TProcessOption] = {
|
||||||
var outp = outputStream(p)
|
var outp = outputStream(p)
|
||||||
result = (TaintedString"", -1)
|
result = (TaintedString"", -1)
|
||||||
while true:
|
while true:
|
||||||
result[1] = peekExitCode(p)
|
if result[1] == -1: result[1] = peekExitCode(p)
|
||||||
if result[1] != -1 and outp.atEnd(outp): break
|
if result[1] != -1 and outp.atEnd(outp): break
|
||||||
result[0].string.add(outp.readLine().string)
|
result[0].string.add(outp.readLine().string)
|
||||||
result[0].string.add("\n")
|
result[0].string.add("\n")
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,7 @@ proc cmpMsgs(r: var TResults, expected, given: TSpec, test: string) =
|
||||||
inc(r.passed)
|
inc(r.passed)
|
||||||
|
|
||||||
proc rejectSingleTest(r: var TResults, test, options: string) =
|
proc rejectSingleTest(r: var TResults, test, options: string) =
|
||||||
|
var test = test.addFileExt(".nim")
|
||||||
var t = extractFilename(test)
|
var t = extractFilename(test)
|
||||||
inc(r.total)
|
inc(r.total)
|
||||||
echo t
|
echo t
|
||||||
|
|
@ -232,6 +233,7 @@ proc compile(r: var TResults, pattern, options: string) =
|
||||||
if not given.err: inc(r.passed)
|
if not given.err: inc(r.passed)
|
||||||
|
|
||||||
proc compileSingleTest(r: var TResults, test, options: string) =
|
proc compileSingleTest(r: var TResults, test, options: string) =
|
||||||
|
var test = test.addFileExt(".nim")
|
||||||
var t = extractFilename(test)
|
var t = extractFilename(test)
|
||||||
inc(r.total)
|
inc(r.total)
|
||||||
echo t
|
echo t
|
||||||
|
|
@ -240,6 +242,7 @@ proc compileSingleTest(r: var TResults, test, options: string) =
|
||||||
if not given.err: inc(r.passed)
|
if not given.err: inc(r.passed)
|
||||||
|
|
||||||
proc runSingleTest(r: var TResults, test, options: string) =
|
proc runSingleTest(r: var TResults, test, options: string) =
|
||||||
|
var test = test.addFileExt(".nim")
|
||||||
var t = extractFilename(test)
|
var t = extractFilename(test)
|
||||||
echo t
|
echo t
|
||||||
inc(r.total)
|
inc(r.total)
|
||||||
|
|
@ -287,30 +290,30 @@ proc runRodFiles(r: var TResults, options: string) =
|
||||||
delNimCache()
|
delNimCache()
|
||||||
|
|
||||||
# test basic recompilation scheme:
|
# test basic recompilation scheme:
|
||||||
test "hallo.nim"
|
test "hallo"
|
||||||
test "hallo.nim"
|
test "hallo"
|
||||||
# test incremental type information:
|
# test incremental type information:
|
||||||
test "hallo2.nim"
|
test "hallo2"
|
||||||
delNimCache()
|
delNimCache()
|
||||||
|
|
||||||
# test type converters:
|
# test type converters:
|
||||||
test "aconv.nim"
|
test "aconv"
|
||||||
test "bconv.nim"
|
test "bconv"
|
||||||
delNimCache()
|
delNimCache()
|
||||||
|
|
||||||
# test G, A, B example from the documentation; test init sections:
|
# test G, A, B example from the documentation; test init sections:
|
||||||
test "deada.nim"
|
test "deada"
|
||||||
test "deada2.nim"
|
test "deada2"
|
||||||
delNimCache()
|
delNimCache()
|
||||||
|
|
||||||
# test method generation:
|
# test method generation:
|
||||||
test "bmethods.nim"
|
test "bmethods"
|
||||||
test "bmethods2.nim"
|
test "bmethods2"
|
||||||
delNimCache()
|
delNimCache()
|
||||||
|
|
||||||
# test generics:
|
# test generics:
|
||||||
test "tgeneric1.nim"
|
test "tgeneric1"
|
||||||
test "tgeneric2.nim"
|
test "tgeneric2"
|
||||||
delNimCache()
|
delNimCache()
|
||||||
|
|
||||||
proc compileRodFiles(r: var TResults, options: string) =
|
proc compileRodFiles(r: var TResults, options: string) =
|
||||||
|
|
@ -420,12 +423,12 @@ proc main() =
|
||||||
var testFile = p.key.string
|
var testFile = p.key.string
|
||||||
p.next()
|
p.next()
|
||||||
if peg"'/reject/'" in testFile:
|
if peg"'/reject/'" in testFile:
|
||||||
reject(r, testFile, p.cmdLineRest.string)
|
rejectSingleTest(r, testFile, p.cmdLineRest.string)
|
||||||
elif peg"'/compile/'" in testFile:
|
elif peg"'/compile/'" in testFile:
|
||||||
compileSingleTest(r, testFile, p.cmdLineRest.string)
|
compileSingleTest(r, testFile, p.cmdLineRest.string)
|
||||||
else:
|
else:
|
||||||
runSingleTest(r, testFile, p.cmdLineRest.string)
|
runSingleTest(r, testFile, p.cmdLineRest.string)
|
||||||
echo r
|
echo r.data, r
|
||||||
else:
|
else:
|
||||||
quit usage
|
quit usage
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue