mirror of
https://github.com/codex-storage/nim-codex-dht.git
synced 2025-02-12 03:47:07 +00:00
setup to use env variable for parallel tests
This commit is contained in:
parent
387db1e1e5
commit
cdd03ea3e9
@ -4,6 +4,7 @@ when declared(getPathsClause):
|
||||
proc nimc(): string = "nim c " & getPathsClause()
|
||||
else:
|
||||
proc nimc(): string = "nim c"
|
||||
proc getPathsClause(): string = ""
|
||||
|
||||
switch("define", "libp2p_pki_schemes=secp256k1")
|
||||
|
||||
@ -11,6 +12,7 @@ task testAll, "Run DHT tests":
|
||||
exec nimc() & " -r tests/testAll.nim"
|
||||
|
||||
task test, "Run DHT tests":
|
||||
putEnv("NIMBLE_PATHS", getPathsClause().split(" ").join($PathSep & $PathSep))
|
||||
exec nimc() & " -r -d:testsAll --verbosity:0 tests/testAllParallel.nim"
|
||||
|
||||
task testPart1, "Run DHT tests A":
|
||||
|
@ -4,22 +4,23 @@
|
||||
|
||||
import std/[os, osproc, strutils]
|
||||
|
||||
when declared(getPathsClause):
|
||||
## note this doesn't appear to work, what to do?
|
||||
proc nimc(): string = "nim c -r " & getPathsClause()
|
||||
else:
|
||||
proc nimc(): string = "nim c -r "
|
||||
## we wanna get nimble paths if set
|
||||
let nimblePaths = getEnv("NIMBLE_PATHS", "").split($PathSep & $PathSep).join(" ")
|
||||
|
||||
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()
|
||||
cmds.add "nim c " & nimblePaths & " " & file.absolutePath.quoteShell()
|
||||
|
||||
when defined(testsPart1):
|
||||
cmds = cmds[0..cmds.len div 2 - 1]
|
||||
when defined(testsPart2):
|
||||
cmds = cmds[cmds.len div 2 - 1..<cmds.len]
|
||||
|
||||
echo "Running Test Commands: ", cmds
|
||||
# quit execProcesses(cmds)
|
||||
echo "Running Test Commands: "
|
||||
for cmd in cmds:
|
||||
echo "\t", cmd
|
||||
echo ""
|
||||
|
||||
quit execProcesses(cmds)
|
||||
|
Loading…
x
Reference in New Issue
Block a user