adding some provisions for writing lower-level unit tests targeting specific sub-systems of the compiler

see sigmatch as an example.
tests are compiled only when the compiler is compiled with -d:selftest
to execute them, just run the resulting binary without arguments
This commit is contained in:
Zahary Karadjov 2013-12-07 20:30:44 +02:00
commit 1e26047c3b
5 changed files with 31 additions and 6 deletions

View file

@ -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.} =