summary refs log tree commit diff stats
path: root/compiler/nimrod.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2013-12-07 20:30:44 +0200
committerZahary Karadjov <zahary@gmail.com>2013-12-07 20:30:44 +0200
commit1e26047c3b38349402858ce0a1a5bf747b9f2914 (patch)
tree99e128eb9606b64f81b01d0049e0e89d2c800224 /compiler/nimrod.nim
parenta068aaed3c5ddaf05a104f3f2d0f512bab2861c6 (diff)
downloadNim-1e26047c3b38349402858ce0a1a5bf747b9f2914.tar.gz
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
Diffstat (limited to 'compiler/nimrod.nim')
-rw-r--r--compiler/nimrod.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/nimrod.nim b/compiler/nimrod.nim
index 3fa80cebb..2f10e32e3 100644
--- a/compiler/nimrod.nim
+++ b/compiler/nimrod.nim
@@ -76,5 +76,7 @@ when compileOption("gc", "v2") or compileOption("gc", "refc"):
   # the new correct mark&sweet collector is too slow :-/
   GC_disableMarkAndSweep()
 condsyms.InitDefines()
-HandleCmdLine()
-quit(int8(msgs.gErrorCounter > 0))
+
+when not defined(selftest):
+  HandleCmdLine()
+  quit(int8(msgs.gErrorCounter > 0))