added missing library files

This commit is contained in:
rumpf_a@web.de 2010-03-07 23:17:37 +01:00
commit 1536415146
30 changed files with 44495 additions and 36 deletions

View file

@ -3,6 +3,7 @@ tadrdisc.nim;15;for a 'var' type a variable needs to be passed
tambsym.nim;6;ambiguous identifier
tambsym2.nim;4;undeclared identifier: 'CreateRGBSurface'
tambsym3.nim;6;ambiguous identifier
tatomic.nim;2;identifier expected, but found 'atomic'
tbind2.nim;7;ambiguous call
tbind4.nim;4;instantiation from here
tblock1.nim;9;undeclared identifier: 'ha'
@ -10,16 +11,16 @@ tconstr1.nim;20;type mismatch
tillrec.nim;8;illegal recursion in type 'TIllegal'
tinc.nim;3;to var type a variable needs to be passed
tinout.nim;7;for a 'var' type a variable needs to be passed
tinvalidnewseq.nim;10;
tinvalidnewseq.nim;10;type mismatch: got (array[0..6, string], int)
tinvwhen.nim;6;invalid indentation
titer4.nim;2;iterator within for loop context expected
tnamspc.nim;5;
tnamspc.nim;5;Error: undeclared identifier: 'global'
tnoop.nim;6;expression 'a()' cannot be called
tnot.nim;9;type mismatch
topaque.nim;11;undeclared field: 'buffer'
topena1.nim;4;invalid type
toverl.nim;6;attempt to redefine 'TNone'
trawstr.nim;5;
trawstr.nim;5;closing " expected
trecinca.nim;3;recursive dependency: 'tests/trecincb.nim'
trecincb.nim;4;recursive dependency: 'tests/trecincb.nim'
treciter.nim;4;recursive dependency: 'myrec'
@ -27,7 +28,7 @@ trectype.nim;20;internal error: cannot generate C type for: PA
trefs.nim;15;type mismatch
tsidee1.nim;7;'SideEffectLyer' can have side effects
tsidee4.nim;10;type mismatch
tsimtych.nim;5;
tsimtych.nim;5;type mismatch: got (bool) but expected 'string'
tstatret.nim;4;statement not allowed after
tstmtexp.nim;3;value returned by statement has to be discarded
ttempl2.nim;13;undeclared identifier: 'b'

Can't render this file because it contains an unexpected character in line 23 and column 23.

View file

@ -14,6 +14,7 @@ import
const
cmdTemplate = r"nimrod cc --hints:on $# $#"
resultsFile = "testresults.html"
type
TMsg = tuple[
@ -25,7 +26,7 @@ type
TResult = tuple[test, expected, given: string, success: bool]
TResults = object
total, passed: int
data: seq[TResult]
data: string
proc myExec(cmd: string): string =
#echo("Executing: " & cmd)
@ -64,7 +65,7 @@ proc callCompiler(filename, options: string): TMsg =
elif s =~ pegSuccess:
result.err = false
proc setupCvsParser(cvsFile: string): TCsvParser =
proc setupCvsParser(csvFile: string): TCsvParser =
var s = newFileStream(csvFile, fmRead)
if s == nil: quit("cannot open the file" & csvFile)
result.open(s, csvFile, separator=';', skipInitialSpace=true)
@ -84,27 +85,34 @@ proc parseRunData(dir: string): seq[TOutp] =
close(p)
proc findSpec[T](specs: seq[T], filename: string): int =
for s in items(specs):
if s.file == filename: return
while result < specs.len:
if specs[result].file == filename: return
inc(result)
quit("cannot find spec for file: " & filename)
proc initResults: TResults =
result.total = 0
result.passed = 0
result.data = @[]
result.data = ""
proc colorBool(b: bool): string =
if b: result = "<span color:\"green\">yes</span>"
else: result = "<span color:\"red\">no</span>"
if b: result = "<span style=\"color:green\">yes</span>"
else: result = "<span style=\"color:red\">no</span>"
const
TableHeader = "<table border=\"1\"><tr><td>Test</td><td>Expected</td>" &
"<td>Given</td><td>Success</td></tr>\n"
TableFooter = "</table>\n"
proc `$`(r: TResults): string =
result = "<table border=\"1\"><tr><td>Test</td><td>Expected</td>" &
"<td>Given</td><td>Success</td></tr>\n"
for test, expected, given, success in items(r.data):
result.add("<tr><td>$#</td><td>$#</td><td>$#</td><td>$#</td></tr>\n" % [
test, expected, given, success.colorBool])
result.add("</table>\n")
result = TableHeader
result.add(r.data)
result.add(TableFooter)
proc addResult(r: var TResults, test, expected, given: string,
success: bool) =
r.data.addf("<tr><td>$#</td><td>$#</td><td>$#</td><td>$#</td></tr>\n", [
test, expected, given, success.colorBool])
proc listResults(reject, compile, run: TResults) =
var s = "<html>"
@ -116,20 +124,20 @@ proc listResults(reject, compile, run: TResults) =
s.add($run)
s.add("</html>")
var outp: TFile
if open(outp, "testresults.html", fmWrite):
write(outp, )
if open(outp, resultsFile, fmWrite):
write(outp, s)
close(outp)
proc cmpMsgs(r: var TResults, expected, given: TMsg, test: string) =
inc(r.total)
if strip(expected.msg) notin strip(given.msg):
r.data.add((test, expected.msg, given.msg, false))
if strip(expected.msg) notin strip(given.msg):
r.addResult(test, expected.msg, given.msg, false)
elif expected.file != given.file:
r.data.add((test, expected.file, given.file, false))
r.addResult(test, expected.file, given.file, false)
elif expected.line != given.line:
r.data.add((test, $expected.line, $given.line, false))
r.addResult(test, $expected.line, $given.line, false)
else:
r.data.add((test, expected.msg, given.msg, true))
r.addResult(test, expected.msg, given.msg, true)
inc(r.passed)
proc reject(r: var TResults, dir, options: string) =
@ -147,7 +155,8 @@ proc compile(r: var TResults, pattern, options: string) =
var t = extractFilename(test)
inc(r.total)
var given = callCompiler(test, options)
r.data.add((t, "", given.msg, not given.err))
echo given.msg, "##", given.err
r.addResult(t, "", given.msg, not given.err)
if not given.err: inc(r.passed)
proc run(r: var TResults, dir, options: string) =
@ -157,17 +166,17 @@ proc run(r: var TResults, dir, options: string) =
inc(r.total)
var given = callCompiler(test, options)
if given.err:
r.data.add((t, "", given.msg, not given.err))
r.addResult(t, "", given.msg, not given.err)
else:
var exeFile = changeFileExt(test, ExeExt)
var expected = specs[findSpec(specs, t)]
if existsFile(exeFile):
var buf = myExec(exeFile)
var success = strip(buf) == strip(spec.outp)
var success = strip(buf) == strip(expected.outp)
if success: inc(r.passed)
r.data.add((t, spec.outp, buf, success))
r.addResult(t, expected.outp, buf, success)
else:
r.data.add((t, spec.outp, "executable not found", false))
r.addResult(t, expected.outp, "executable not found", false)
var options = ""
var rejectRes = initResults()
@ -178,9 +187,10 @@ for i in 1.. paramCount():
add(options, " ")
add(options, paramStr(i))
reject(rejectRes, "tests/reject", options)
compile(compileRes, "tests/accept/compile/t*.nim", options)
#reject(rejectRes, "tests/reject", options)
#compile(compileRes, "tests/accept/compile/t*.nim", options)
compile(compileRes, "examples/*.nim", options)
compile(compileRes, "examples/gtk/*.nim", options)
run(runRes, "tests/accept/run", options)
#compile(compileRes, "examples/gtk/*.nim", options)
#run(runRes, "tests/accept/run", options)
listResults(rejectRes, compileRes, runRes)
openDefaultBrowser(resultsFile)