programMain is now active only in the main module

This commit is contained in:
Zahary Karadjov 2021-12-15 19:27:52 +02:00
parent aa6e5216f4
commit 1f66448152
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 2 additions and 3 deletions

View File

@ -13,10 +13,9 @@ template tests*(body: untyped) =
when not compiles(payload()):
payload()
template programMain*(body: untyped) =
template programMain*(body: untyped) {.dirty.} =
proc main =
body
when not defined(testutils_test_build):
when isMainModule and not defined(testutils_test_build):
main()