2021-03-19 17:58:22 +00:00
|
|
|
task test, "Run tests":
|
2021-04-29 12:20:03 +00:00
|
|
|
let
|
|
|
|
xmlFile = "test_results.xml"
|
|
|
|
commandStart = "nim c -r -f --threads:on --hints:off --verbosity:0 --skipParentCfg:on --skipUserCfg:on "
|
|
|
|
|
2021-03-19 17:58:22 +00:00
|
|
|
for f in listFiles("tests"):
|
|
|
|
if f.len > 4 and f[^4..^1] == ".nim":
|
2021-04-29 12:20:03 +00:00
|
|
|
# This should generate an XML results file.
|
|
|
|
var cmd = commandStart & f & " --xml:" & xmlFile & " --console"
|
2021-03-19 17:58:22 +00:00
|
|
|
echo cmd
|
|
|
|
exec cmd
|
2021-04-29 12:20:03 +00:00
|
|
|
doAssert fileExists xmlFile
|
|
|
|
rmFile xmlFile
|
|
|
|
|
|
|
|
# This should not, since we disable param processing.
|
|
|
|
cmd = commandStart & "-d:unittest2DisableParamFiltering " & f & " --xml:" & xmlFile
|
|
|
|
echo cmd
|
|
|
|
exec cmd
|
|
|
|
doAssert not fileExists xmlFile
|
|
|
|
rmFile f[0..^5].toExe
|
|
|
|
|
|
|
|
task buildDocs, "Build docs":
|
|
|
|
exec "nim doc --skipParentCfg:on --skipUserCfg:on --git.url:https://github.com/status-im/nim-unittest2 --git.commit:master --git.devel:master unittest2.nim"
|
2021-03-19 17:58:22 +00:00
|
|
|
|