* TTest pass by ref , so can reset startTime before actully run * change TTest to ref type * clone test in matrix process
This commit is contained in:
parent
c62513049c
commit
c2f80de1c7
1 changed files with 6 additions and 4 deletions
|
|
@ -58,7 +58,6 @@ type
|
||||||
TResults = object
|
TResults = object
|
||||||
total, passed, skipped: int
|
total, passed, skipped: int
|
||||||
data: string
|
data: string
|
||||||
|
|
||||||
TTest = object
|
TTest = object
|
||||||
name: string
|
name: string
|
||||||
cat: Category
|
cat: Category
|
||||||
|
|
@ -425,8 +424,9 @@ proc checkDisabled(r: var TResults, test: TTest): bool =
|
||||||
|
|
||||||
var count = 0
|
var count = 0
|
||||||
|
|
||||||
proc testSpecHelper(r: var TResults, test: TTest, expected: TSpec,
|
proc testSpecHelper(r: var TResults, test: var TTest, expected: TSpec,
|
||||||
target: TTarget, nimcache: string, extraOptions = "") =
|
target: TTarget, nimcache: string, extraOptions = "") =
|
||||||
|
test.startTime = epochTime()
|
||||||
case expected.action
|
case expected.action
|
||||||
of actionCompile:
|
of actionCompile:
|
||||||
var given = callCompiler(expected.getCmd, test.name, test.options, nimcache, target,
|
var given = callCompiler(expected.getCmd, test.name, test.options, nimcache, target,
|
||||||
|
|
@ -496,7 +496,8 @@ proc targetHelper(r: var TResults, test: TTest, expected: TSpec, extraOptions =
|
||||||
echo "testSpec count: ", count, " expected: ", expected
|
echo "testSpec count: ", count, " expected: ", expected
|
||||||
else:
|
else:
|
||||||
let nimcache = nimcacheDir(test.name, test.options, target)
|
let nimcache = nimcacheDir(test.name, test.options, target)
|
||||||
testSpecHelper(r, test, expected, target, nimcache, extraOptions)
|
var testClone = test
|
||||||
|
testSpecHelper(r, testClone, expected, target, nimcache, extraOptions)
|
||||||
|
|
||||||
proc testSpec(r: var TResults, test: TTest, targets: set[TTarget] = {}) =
|
proc testSpec(r: var TResults, test: TTest, targets: set[TTarget] = {}) =
|
||||||
var expected = test.spec
|
var expected = test.spec
|
||||||
|
|
@ -521,7 +522,8 @@ proc testSpecWithNimcache(r: var TResults, test: TTest; nimcache: string) =
|
||||||
if not checkDisabled(r, test): return
|
if not checkDisabled(r, test): return
|
||||||
for target in test.spec.targets:
|
for target in test.spec.targets:
|
||||||
inc(r.total)
|
inc(r.total)
|
||||||
testSpecHelper(r, test, test.spec, target, nimcache)
|
var testClone = test
|
||||||
|
testSpecHelper(r, testClone, test.spec, target, nimcache)
|
||||||
|
|
||||||
proc testC(r: var TResults, test: TTest, action: TTestAction) =
|
proc testC(r: var TResults, test: TTest, action: TTestAction) =
|
||||||
# runs C code. Doesn't support any specs, just goes by exit code.
|
# runs C code. Doesn't support any specs, just goes by exit code.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue