Files
Nim/compiler/testability.nim
Zahary Karadjov 1e26047c3b 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
2013-12-07 20:30:44 +02:00

6 lines
128 B
Nim

template tests*(body: stmt) {.immediate.} =
when defined(selftest):
when not defined(unittest): import unittest
body