testament: no sqlite or re dependencies anymore
This commit is contained in:
parent
ea535ed1ff
commit
a5f1abc5ca
3 changed files with 116 additions and 268 deletions
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
#
|
||||
# Nim Tester
|
||||
# (c) Copyright 2015 Andreas Rumpf
|
||||
# (c) Copyright 2017 Andreas Rumpf
|
||||
#
|
||||
# See the file "copying.txt", included in this
|
||||
# distribution, for details about the copyright.
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
import
|
||||
parseutils, strutils, pegs, os, osproc, streams, parsecfg, json,
|
||||
marshal, backend, parseopt, specs, htmlgen, browsers, terminal,
|
||||
algorithm, compiler/nodejs, re, times, sets
|
||||
algorithm, compiler/nodejs, times, sets
|
||||
|
||||
const
|
||||
resultsFile = "testresults.html"
|
||||
|
|
@ -24,9 +24,7 @@ Command:
|
|||
all run all tests
|
||||
c|category <category> run all the tests of a certain category
|
||||
r|run <test> run single test file
|
||||
html [commit] generate $1 from the database; uses the latest
|
||||
commit or a specific one (use -1 for the commit
|
||||
before latest etc)
|
||||
html generate $1 from the database
|
||||
Arguments:
|
||||
arguments are passed to the compiler
|
||||
Options:
|
||||
|
|
@ -191,7 +189,12 @@ proc addResult(r: var TResults, test: TTest,
|
|||
("Skipped", "")
|
||||
else:
|
||||
("Failed", "Failure: " & $success & "\nExpected:\n" & expected & "\n\n" & "Gotten:\n" & given)
|
||||
var p = startProcess("appveyor", args=["AddTest", test.name.replace("\\", "/") & test.options, "-Framework", "nim-testament", "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg, "-Duration", $(duration*1000).int], options={poStdErrToStdOut, poUsePath, poParentStreams})
|
||||
var p = startProcess("appveyor", args=["AddTest", test.name.replace("\\", "/") & test.options,
|
||||
"-Framework", "nim-testament", "-FileName",
|
||||
test.cat.string,
|
||||
"-Outcome", outcome, "-ErrorMessage", msg,
|
||||
"-Duration", $(duration*1000).int],
|
||||
options={poStdErrToStdOut, poUsePath, poParentStreams})
|
||||
discard waitForExit(p)
|
||||
close(p)
|
||||
|
||||
|
|
@ -290,7 +293,7 @@ proc analyzeAndConsolidateOutput(s: string): string =
|
|||
result = substr(rows[i], pos) & "\n"
|
||||
for i in i+1 ..< rows.len:
|
||||
result.add rows[i] & "\n"
|
||||
if not (rows[i] =~ re"^[^(]+\(\d+\)\s+"):
|
||||
if not (rows[i] =~ peg"['(']+ '(' \d+ ')' \s+"):
|
||||
return
|
||||
elif (let pos = find(rows[i], "SIGSEGV: Illegal storage access."); pos != -1):
|
||||
result = substr(rows[i], pos)
|
||||
|
|
@ -473,10 +476,7 @@ proc main() =
|
|||
var cat = Category(subdir)
|
||||
processSingleTest(r, cat, p.cmdLineRest.string, file)
|
||||
of "html":
|
||||
var commit = 0
|
||||
discard parseInt(p.cmdLineRest.string, commit)
|
||||
generateHtml(resultsFile, commit, optFailing)
|
||||
generateJson(jsonFile, commit)
|
||||
generateHtml(resultsFile, optFailing)
|
||||
else:
|
||||
quit Usage
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue