pathing in tests

This commit is contained in:
Ben 2024-08-14 10:34:45 +02:00
parent a865b3242e
commit 2fd6c7dd03
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
2 changed files with 11 additions and 11 deletions

View File

@ -1,23 +1,23 @@
import std / [os, strutils, sequtils]
task testAll, "Run DHT tests":
exec "nim c -r tests/testAll.nim"
rmFile "./tests/testAll"
exec "nim c -r testAll.nim"
rmFile "./testAll"
task test, "Run DHT tests":
# compile with trace logging to make sure it doesn't crash
exec "nim c -d:testsAll -d:chronicles_enabled=on -d:chronicles_log_level=TRACE tests/testAll.nim"
rmFile "./tests/testAll"
exec "nim c -r -d:testsAll --verbosity:0 tests/testAllParallel.nim"
rmFile "./tests/testAllParallel"
exec "nim c -d:testsAll -d:chronicles_enabled=on -d:chronicles_log_level=TRACE testAll.nim"
rmFile "./testAll"
exec "nim c -r -d:testsAll --verbosity:0 testAllParallel.nim"
rmFile "./testAllParallel"
task testPart1, "Run DHT tests A":
exec "nim c -r -d:testsPart1 tests/testAllParallel.nim"
rmFile "./tests/testAllParallel"
exec "nim c -r -d:testsPart1 testAllParallel.nim"
rmFile "./testAllParallel"
task testPart2, "Run DHT tests B":
exec "nim c -r -d:testsPart2 tests/testAllParallel.nim"
rmFile "./tests/testAllParallel"
exec "nim c -r -d:testsPart2 testAllParallel.nim"
rmFile "./testAllParallel"
task coverage, "generates code coverage report":
var (output, exitCode) = gorgeEx("which lcov")
@ -50,7 +50,7 @@ task coverage, "generates code coverage report":
if f.endswith(".nim"): nimSrcs.add " " & f.absolutePath.quoteShell()
echo "======== Running Tests ======== "
exec("nim c -r tests/coverage.nim")
exec("nim c -r coverage.nim")
exec("rm nimcache/*.c")
rmDir("coverage"); mkDir("coverage")
echo " ======== Running LCOV ======== "