2020-02-26 21:45:07 +00:00
|
|
|
{.used.}
|
|
|
|
|
|
|
|
template tests*(body: untyped) =
|
|
|
|
template payload =
|
2021-03-18 16:17:38 +00:00
|
|
|
when not declared(unittest2):
|
|
|
|
import unittest2
|
2020-02-26 22:06:22 +00:00
|
|
|
|
2020-02-26 21:45:07 +00:00
|
|
|
body
|
|
|
|
|
|
|
|
when defined(testutils_test_build):
|
|
|
|
payload()
|
|
|
|
else:
|
|
|
|
when not compiles(payload()):
|
|
|
|
payload()
|
|
|
|
|
|
|
|
template programMain*(body: untyped) =
|
|
|
|
proc main =
|
|
|
|
body
|
|
|
|
|
|
|
|
when not defined(testutils_test_build):
|
|
|
|
main()
|
|
|
|
|