@@ -258,20 +258,23 @@ Tests failed and allowed to fail: $3 / $1 <br />
258
258
Tests skipped: $4 / $1 <br />
259
259
""" % [$ x.total, $ x.passed, $ x.failedButAllowed, $ x.skipped]
260
260
261
- proc addResult (r: var TResults , test: TTest , target: TTarget ,
262
- extraOptions, expected, given: string , successOrig: TResultEnum ,
263
- allowFailure = false , givenSpec: ptr TSpec = nil ) =
264
- # instead of `ptr TSpec` we could also use `Option[TSpec]`; passing `givenSpec` makes it easier to get what we need
265
- # instead of having to pass individual fields, or abusing existing ones like expected vs given.
266
- # test.name is easier to find than test.name.extractFilename
267
- # A bit hacky but simple and works with tests/testament/tshould_not_work.nim
261
+ proc testName (test: TTest , target: TTarget , extraOptions: string , allowFailure: bool ): string =
268
262
var name = test.name.replace (DirSep , '/' )
269
263
name.add ' ' & $ target
270
264
if allowFailure:
271
265
name.add " (allowed to fail) "
272
266
if test.options.len > 0 : name.add ' ' & test.options
273
267
if extraOptions.len > 0 : name.add ' ' & extraOptions
268
+ name.strip ()
274
269
270
+ proc addResult (r: var TResults , test: TTest , target: TTarget ,
271
+ extraOptions, expected, given: string , successOrig: TResultEnum ,
272
+ allowFailure = false , givenSpec: ptr TSpec = nil ) =
273
+ # instead of `ptr TSpec` we could also use `Option[TSpec]`; passing `givenSpec` makes it easier to get what we need
274
+ # instead of having to pass individual fields, or abusing existing ones like expected vs given.
275
+ # test.name is easier to find than test.name.extractFilename
276
+ # A bit hacky but simple and works with tests/testament/tshould_not_work.nim
277
+ let name = testName (test, target, extraOptions, allowFailure)
275
278
let duration = epochTime () - test.startTime
276
279
let success = if test.spec.timeout > 0.0 and duration > test.spec.timeout: reTimeout
277
280
else : successOrig
@@ -470,6 +473,9 @@ proc equalModuloLastNewline(a, b: string): bool =
470
473
proc testSpecHelper (r: var TResults , test: var TTest , expected: TSpec ,
471
474
target: TTarget , extraOptions: string , nimcache: string ) =
472
475
test.startTime = epochTime ()
476
+ if testName (test, target, extraOptions, false ) in skips:
477
+ test.spec.err = reDisabled
478
+
473
479
if test.spec.err in {reDisabled, reJoined}:
474
480
r.addResult (test, target, extraOptions, " " , " " , test.spec.err)
475
481
inc (r.skipped)
0 commit comments