fix #14475; unittest.require now works with nim c; require and check now works with -d:nodejs (#14676)
* fix #14475; make unittest work with -d:nodejs * fixup * fixup * disable inim, delaunay which failed after unittest.require got fixed * re-enable tests that have been fixed
This commit is contained in:
parent
ffaf4797be
commit
e07d661d16
6 changed files with 55 additions and 13 deletions
|
|
@ -94,6 +94,7 @@
|
|||
## echo "suite teardown: run once after the tests"
|
||||
|
||||
import std/private/since
|
||||
import std/exitprocs
|
||||
|
||||
import
|
||||
macros, strutils, streams, times, sets, sequtils
|
||||
|
|
@ -498,7 +499,7 @@ template test*(name, body) {.dirty.} =
|
|||
## .. code-block::
|
||||
##
|
||||
## [OK] roses are red
|
||||
bind shouldRun, checkpoints, formatters, ensureInitialized, testEnded, exceptionTypeName
|
||||
bind shouldRun, checkpoints, formatters, ensureInitialized, testEnded, exceptionTypeName, setProgramResult
|
||||
|
||||
ensureInitialized()
|
||||
|
||||
|
|
@ -524,7 +525,7 @@ template test*(name, body) {.dirty.} =
|
|||
|
||||
finally:
|
||||
if testStatusIMPL == TestStatus.FAILED:
|
||||
programResult = 1
|
||||
setProgramResult 1
|
||||
let testResult = TestResult(
|
||||
suiteName: when declared(testSuiteName): testSuiteName else: "",
|
||||
testName: name,
|
||||
|
|
@ -560,12 +561,11 @@ template fail* =
|
|||
## fail()
|
||||
##
|
||||
## outputs "Checkpoint A" before quitting.
|
||||
bind ensureInitialized
|
||||
|
||||
bind ensureInitialized, setProgramResult
|
||||
when declared(testStatusIMPL):
|
||||
testStatusIMPL = TestStatus.FAILED
|
||||
else:
|
||||
programResult = 1
|
||||
setProgramResult 1
|
||||
|
||||
ensureInitialized()
|
||||
|
||||
|
|
@ -576,8 +576,7 @@ template fail* =
|
|||
else:
|
||||
formatter.failureOccurred(checkpoints, "")
|
||||
|
||||
when declared(programResult):
|
||||
if abortOnError: quit(programResult)
|
||||
if abortOnError: quit(1)
|
||||
|
||||
checkpoints = @[]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue