summary refs log tree commit diff stats
path: root/compiler/testability.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/testability.nim')
-rw-r--r--compiler/testability.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/testability.nim b/compiler/testability.nim
new file mode 100644
index 000000000..ceefd0a5e
--- /dev/null
+++ b/compiler/testability.nim
@@ -0,0 +1,5 @@
+template tests*(body: stmt) {.immediate.} =
+  when defined(selftest):
+    when not defined(unittest): import unittest
+    body
+