builds parallel tests before running

This commit is contained in:
Ben 2024-08-15 10:02:01 +02:00
parent 6d924439a1
commit a1f7219758
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
5 changed files with 13 additions and 26 deletions

View File

@ -39,8 +39,3 @@ task testPart2, "Run the test suite part 2":
exec "nimble install -d -y"
withDir "tests":
exec "nimble testPart2"
task coverage, "Run the test coverage":
exec "nimble install -d -y"
withDir "tests":
exec "nimble coverage"

View File

@ -4,18 +4,27 @@ task testAll, "Run DHT tests":
exec "nim c -r test.nim"
rmFile "./test"
task compileParallelTests, "Compile parallel tests":
exec "nim c --hints:off --verbosity:0 dht/test_providers.nim"
exec "nim c --hints:off --verbosity:0 dht/test_providermngr.nim"
exec "nim c --hints:off --verbosity:0 discv5/test_discoveryv5.nim"
exec "nim c --hints:off --verbosity:0 discv5/test_discoveryv5_encoding.nim"
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 test.nim"
rmFile "./test"
compileParallelTestsTask()
exec "nim c -r -d:testsAll --verbosity:0 testAllParallel.nim"
rmFile "./testAllParallel"
task testPart1, "Run DHT tests A":
compileParallelTestsTask()
exec "nim c -r -d:testsPart1 testAllParallel.nim"
rmFile "./testAllParallel"
task testPart2, "Run DHT tests B":
compileParallelTestsTask()
exec "nim c -r -d:testsPart2 testAllParallel.nim"
rmFile "./testAllParallel"

View File

@ -1,2 +0,0 @@
include ./testAll

View File

@ -1,15 +0,0 @@
switch("define", "testsAll")
switch("debugger", "native")
switch("lineDir", "on")
switch("define", "debug")
# switch("opt", "none")
switch("verbosity", "0")
switch("hints", "off")
switch("warnings", "off")
switch("define", "chronicles_log_level=INFO")
switch("nimcache", "nimcache")
switch("passC", "-fprofile-arcs")
switch("passC", "-ftest-coverage")
switch("passL", "-fprofile-arcs")
switch("passL", "-ftest-coverage")

View File

@ -8,13 +8,13 @@ var cmds: seq[string]
when defined(testsPart1) or defined(testsAll):
cmds.add [
"nim c -r --hints:off --verbosity:0 tests/dht/test_providers.nim",
"nim c -r --hints:off --verbosity:0 tests/dht/test_providermngr.nim",
"nim c -r --hints:off --verbosity:0 dht/test_providers.nim",
"nim c -r --hints:off --verbosity:0 dht/test_providermngr.nim",
]
when defined(testsPart2) or defined(testsAll):
cmds.add [
"nim c -r --hints:off --verbosity:0 tests/discv5/test_discoveryv5.nim",
"nim c -r --hints:off --verbosity:0 tests/discv5/test_discoveryv5_encoding.nim",
"nim c -r --hints:off --verbosity:0 discv5/test_discoveryv5.nim",
"nim c -r --hints:off --verbosity:0 discv5/test_discoveryv5_encoding.nim",
]
echo "Running Test Commands: ", cmds