diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/unittest.nim | 18 | ||||
-rwxr-xr-x | lib/system/threads.nim | 6 |
2 files changed, 11 insertions, 13 deletions
diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim index 7bfde7904..be5e19c23 100644 --- a/lib/pure/unittest.nim +++ b/lib/pure/unittest.nim @@ -31,19 +31,19 @@ var checkpoints: seq[string] = @[] -template TestSetupIMPL*: stmt {.dirty.} = nil -template TestTeardownIMPL*: stmt {.dirty.} = nil +template TestSetupIMPL*: stmt {.immediate, dirty.} = nil +template TestTeardownIMPL*: stmt {.immediate, dirty.} = nil proc shouldRun(testName: string): bool = result = true -template suite*(name: expr, body: stmt): stmt {.dirty.} = +template suite*(name: expr, body: stmt): stmt {.immediate, dirty.} = block: - template setup*(setupBody: stmt): stmt {.dirty.} = - template TestSetupIMPL: stmt {.dirty.} = setupBody + template setup*(setupBody: stmt): stmt {.immediate, dirty.} = + template TestSetupIMPL: stmt {.immediate, dirty.} = setupBody - template teardown*(teardownBody: stmt): stmt {.dirty.} = - template TestTeardownIMPL: stmt {.dirty.} = teardownBody + template teardown*(teardownBody: stmt): stmt {.immediate, dirty.} = + template TestTeardownIMPL: stmt {.immediate, dirty.} = teardownBody body @@ -59,7 +59,7 @@ proc testDone(name: string, s: TTestStatus) = else: echo "[", $s, "] ", name, "\n" -template test*(name: expr, body: stmt): stmt {.dirty.} = +template test*(name: expr, body: stmt): stmt {.immediate, dirty.} = bind shouldRun, checkpoints, testDone if shouldRun(name): @@ -148,7 +148,7 @@ macro check*(conditions: stmt): stmt {.immediate.} = var ast = conditions.treeRepr error conditions.lineinfo & ": Malformed check statement:\n" & ast -template require*(conditions: stmt): stmt {.dirty.} = +template require*(conditions: stmt): stmt {.immediate, dirty.} = block: const AbortOnError {.inject.} = true check conditions diff --git a/lib/system/threads.nim b/lib/system/threads.nim index 81e0cb00a..935f0433b 100755 --- a/lib/system/threads.nim +++ b/lib/system/threads.nim @@ -245,9 +245,7 @@ when not defined(useNimRtl): # We jump through some hops here to ensure that Nimrod thread procs can have # the Nimrod calling convention. This is needed because thread procs are # ``stdcall`` on Windows and ``noconv`` on UNIX. Alternative would be to just -# use ``stdcall`` since it is mapped to ``noconv`` on UNIX anyway. However, -# the current approach will likely result in less problems later when we have -# GC'ed closures in Nimrod. +# use ``stdcall`` since it is mapped to ``noconv`` on UNIX anyway. type TThread* {.pure, final.}[TArg] = @@ -265,7 +263,7 @@ type when not defined(boehmgc) and not hasSharedHeap: proc deallocOsPages() -template ThreadProcWrapperBody(closure: expr) = +template ThreadProcWrapperBody(closure: expr) {.immediate.} = when defined(globalsSlot): ThreadVarSetValue(globalsSlot, closure) var t = cast[ptr TThread[TArg]](closure) when useStackMaskHack: |