2023-07-13 20:42:43 -07:00
|
|
|
# import
|
|
|
|
|
# ./dht/[test_providers, test_providermngr],
|
|
|
|
|
# ./discv5/[test_discoveryv5, test_discoveryv5_encoding]
|
|
|
|
|
|
2023-07-17 16:22:21 -07:00
|
|
|
import std/[os, osproc, strutils]
|
|
|
|
|
|
2023-07-18 15:46:33 -07:00
|
|
|
## we wanna get nimble paths if set
|
|
|
|
|
let nimblePaths = getEnv("NIMBLE_PATHS", "").split($PathSep & $PathSep).join(" ")
|
2023-07-13 20:42:43 -07:00
|
|
|
|
|
|
|
|
var cmds: seq[string]
|
2023-07-17 16:22:21 -07:00
|
|
|
for d in walkDirRec("tests", {pcDir}):
|
|
|
|
|
for (kind, file) in walkDir(d):
|
|
|
|
|
if kind == pcFile and file.endswith(".nim") and file.startsWith("t"):
|
2023-07-18 15:46:33 -07:00
|
|
|
cmds.add "nim c " & nimblePaths & " " & file.absolutePath.quoteShell()
|
2023-07-13 20:42:43 -07:00
|
|
|
|
2023-07-17 16:27:07 -07:00
|
|
|
when defined(testsPart1):
|
|
|
|
|
cmds = cmds[0..cmds.len div 2 - 1]
|
|
|
|
|
when defined(testsPart2):
|
|
|
|
|
cmds = cmds[cmds.len div 2 - 1..<cmds.len]
|
2023-07-13 20:42:43 -07:00
|
|
|
|
2023-07-18 15:46:33 -07:00
|
|
|
echo "Running Test Commands: "
|
|
|
|
|
for cmd in cmds:
|
|
|
|
|
echo "\t", cmd
|
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
|
|
quit execProcesses(cmds)
|