mirror of https://github.com/status-im/nim-eth.git
per-module test tasks
This commit is contained in:
parent
cd8364045d
commit
7079efcae3
35
eth.nimble
35
eth.nimble
|
@ -15,15 +15,34 @@ requires "nim >= 0.19.0",
|
||||||
"chronos",
|
"chronos",
|
||||||
"chronicles"
|
"chronicles"
|
||||||
|
|
||||||
proc test(filename: string) =
|
|
||||||
echo "Running: ", filename
|
|
||||||
exec "nim c -r " & filename
|
|
||||||
|
|
||||||
import strutils
|
import strutils
|
||||||
import oswalkdir, ospaths # In newer nim these are merged to os
|
import oswalkdir, ospaths # In newer nim these are merged to os
|
||||||
|
|
||||||
|
proc test(path: string) =
|
||||||
|
echo "Running: ", path
|
||||||
|
exec "nim c -r " & path
|
||||||
|
|
||||||
|
proc run_tests(dir: string) =
|
||||||
|
for path in walkDirRec(dir):
|
||||||
|
let fname = splitPath(path).tail
|
||||||
|
if fname.startsWith("test_") and fname.endsWith(".nim"):
|
||||||
|
test(path)
|
||||||
|
|
||||||
task test, "run tests":
|
task test, "run tests":
|
||||||
for i in walkDirRec("tests"):
|
run_tests("tests")
|
||||||
let fn = splitPath(i).tail
|
|
||||||
if fn.startsWith("test_") and fn.endsWith(".nim"):
|
task test_keyfile, "run keyfile tests":
|
||||||
test(i)
|
run_tests("tests/keyfile")
|
||||||
|
|
||||||
|
task test_keys, "run keys tests":
|
||||||
|
run_tests("tests/keys")
|
||||||
|
|
||||||
|
task test_p2p, "run p2p tests":
|
||||||
|
run_tests("tests/p2p")
|
||||||
|
|
||||||
|
task test_rlp, "run rlp tests":
|
||||||
|
run_tests("tests/rlp")
|
||||||
|
|
||||||
|
task test_trie, "run trie tests":
|
||||||
|
run_tests("tests/trie")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue