setup getPathsClause and parallels
This commit is contained in:
parent
fc7d7ef80c
commit
62005c1a3c
15
build.nims
15
build.nims
|
@ -1,18 +1,23 @@
|
|||
import std / [os, strutils, sequtils]
|
||||
import std / [os, strutils, sequtils, osproc]
|
||||
|
||||
when declared(getPathsClause):
|
||||
proc nimc(): string = "nim c " & getPathsClause()
|
||||
else:
|
||||
proc nimc(): string = "nim c"
|
||||
|
||||
switch("define", "libp2p_pki_schemes=secp256k1")
|
||||
|
||||
task testAll, "Run DHT tests":
|
||||
exec "nim c -r tests/testAll.nim"
|
||||
exec nimc() & " -r tests/testAll.nim"
|
||||
|
||||
task test, "Run DHT tests":
|
||||
exec "nim c -r -d:testsAll --verbosity:0 tests/testAllParallel.nim"
|
||||
exec nimc() & " -r -d:testsAll --verbosity:0 tests/testAllParallel.nim"
|
||||
|
||||
task testPart1, "Run DHT tests A":
|
||||
exec "nim c -r -d:testsPart1 tests/testAllParallel.nim"
|
||||
exec nimc() & " -r -d:testsPart1 tests/testAllParallel.nim"
|
||||
|
||||
task testPart2, "Run DHT tests B":
|
||||
exec "nim c -r -d:testsPart2 tests/testAllParallel.nim"
|
||||
exec nimc() & " -r -d:testsPart2 tests/testAllParallel.nim"
|
||||
|
||||
task coverage, "generates code coverage report":
|
||||
var (output, exitCode) = gorgeEx("which lcov")
|
||||
|
|
|
@ -2,21 +2,24 @@
|
|||
# ./dht/[test_providers, test_providermngr],
|
||||
# ./discv5/[test_discoveryv5, test_discoveryv5_encoding]
|
||||
|
||||
import osproc
|
||||
import std/[os, osproc, strutils]
|
||||
|
||||
when declared(getPathsClause):
|
||||
proc nimc(): string = "nim c -r " & getPathsClause()
|
||||
else:
|
||||
proc nimc(): string = "nim c -r "
|
||||
|
||||
var cmds: seq[string]
|
||||
for d in walkDirRec("tests", {pcDir}):
|
||||
for (kind, file) in walkDir(d):
|
||||
if kind == pcFile and file.endswith(".nim") and file.startsWith("t"):
|
||||
cmds.add nimc() & file.absolutePath.quoteShell()
|
||||
|
||||
when defined(testsPart1) or defined(testsAll):
|
||||
cmds.add [
|
||||
"nim c -r tests/dht/test_providers.nim",
|
||||
"nim c -r tests/dht/test_providermngr.nim",
|
||||
]
|
||||
cmds = cmds[0..cmds.len div 2]
|
||||
when defined(testsPart2) or defined(testsAll):
|
||||
cmds.add [
|
||||
"nim c -r tests/discv5/test_discoveryv5.nim",
|
||||
"nim c -r tests/discv5/test_discoveryv5_encoding.nim",
|
||||
]
|
||||
cmds = cmds[cmds.len div 2..<cmds.len]
|
||||
|
||||
echo "Running Test Commands: ", cmds
|
||||
|
||||
quit execProcesses(cmds)
|
||||
# quit execProcesses(cmds)
|
||||
|
|
Loading…
Reference in New Issue