diff options
author | Araq <rumpf_a@web.de> | 2013-12-13 15:58:03 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-12-13 15:58:03 +0100 |
commit | 8c553fa8a2e9476c67c6348bf64c02ea0f19a679 (patch) | |
tree | ce32cf3cd815f4dbb7e5f0f00942f43e1a7871c0 /lib/pure/unittest.nim | |
parent | 328f1932925889d5bb7f91c68fb1504b9b26ba8c (diff) | |
parent | 01661daf76daa713d25d06d202f83c842a6f1fe3 (diff) | |
download | Nim-8c553fa8a2e9476c67c6348bf64c02ea0f19a679.tar.gz |
Merge branch 'master' into vm2
Diffstat (limited to 'lib/pure/unittest.nim')
-rw-r--r-- | lib/pure/unittest.nim | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim index 71f4d498b..f847d24f4 100644 --- a/lib/pure/unittest.nim +++ b/lib/pure/unittest.nim @@ -98,8 +98,12 @@ template fail* = when not defined(ECMAScript): if AbortOnError: quit(1) - - TestStatusIMPL = FAILED + + when defined(TestStatusIMPL): + TestStatusIMPL = FAILED + else: + program_result += 1 + checkpoints = @[] macro check*(conditions: stmt): stmt {.immediate.} = @@ -111,7 +115,8 @@ macro check*(conditions: stmt): stmt {.immediate.} = counter = 0 template asgn(a, value: expr): stmt = - let a = value + var a = value # XXX: we need "var: var" here in order to + # preserve the semantics of var params template print(name, value: expr): stmt = when compiles(string($value)): @@ -146,7 +151,8 @@ macro check*(conditions: stmt): stmt {.immediate.} = of nnkStmtList: result = newNimNode(nnkStmtList) for i in countup(0, checked.len - 1): - result.add(newCall(!"check", checked[i])) + if checked[i].kind != nnkCommentStmt: + result.add(newCall(!"check", checked[i])) else: template rewrite(Exp, lineInfoLit: expr, expLit: string): stmt = |