nim-eth/eth.nimble

123 lines
3.2 KiB
Plaintext
Raw Normal View History

2019-02-05 10:10:36 +00:00
version = "1.0.0"
author = "Status Research & Development GmbH"
description = "Ethereum Common library"
license = "MIT"
skipDirs = @["tests"]
requires "nim >= 1.2.0",
2019-02-05 10:10:36 +00:00
"nimcrypto",
"stint",
2019-02-05 14:06:13 +00:00
"secp256k1",
2019-02-06 18:11:29 +00:00
"chronos",
"chronicles",
2019-07-07 09:55:17 +00:00
"stew",
"nat_traversal",
"metrics",
2020-06-02 15:21:50 +00:00
"sqlite3_abi",
"confutils",
"testutils",
"unittest2"
let styleCheckStyle =
if (NimMajor, NimMinor) < (1, 6):
"hint"
else:
"error"
let commonParams =
" --skipUserCfg:on" &
" --verbosity:0 --hints:off" &
" --warning[ObservableStores]:off " &
" --styleCheck:usages --styleCheck:" & styleCheckStyle &
" " & getEnv("NIMFLAGS") &
" -d:chronosStrictException" &
" -d:chronicles_log_level=TRACE"
2019-02-05 10:32:22 +00:00
proc runTest(path: string, release: bool = true) =
echo "\nBuilding and running: ", path
let releaseMode = if release: " -d:release" else: ""
exec "nim c -r" &
releaseMode & commonParams & " " & path
rmFile path
2019-02-05 10:10:36 +00:00
proc buildBinary(path: string) =
echo "\nBuilding: ", path
exec "nim c -d:release" & commonParams &
" --warning[CaseTransition]:off" &
" " & path
task test_keyfile, "Run keyfile tests":
runTest("tests/keyfile/all_tests")
2019-02-15 14:46:44 +00:00
task test_keys, "Run keys tests":
runTest("tests/keys/all_tests")
2019-02-15 14:46:44 +00:00
task test_discv5, "Run discovery v5 tests":
runTest("tests/p2p/all_discv5_tests")
task test_discv4, "Run discovery v4 tests":
runTest("tests/p2p/test_discovery")
task test_p2p, "Run p2p tests":
runTest("tests/p2p/all_tests")
task test_rlp, "Run rlp tests":
2020-12-23 10:29:34 +00:00
# workaround for github action CI
# mysterious crash on windows-2019 64bit mode
# cannot reproduce locally on windows-2019
# running in virtualbox
let releaseMode = if existsEnv"PLATFORM":
getEnv"PLATFORM" != "windows-amd64"
else: true
runTest("tests/rlp/all_tests", releaseMode)
2019-02-15 14:46:44 +00:00
task test_trie, "Run trie tests":
2020-04-18 08:17:59 +00:00
runTest("tests/trie/all_tests")
2019-02-15 14:46:44 +00:00
task test_db, "Run db tests":
runTest("tests/db/all_tests")
task test_utp, "Run utp tests":
runTest("tests/utp/all_utp_tests")
task test_common, "Run common tests":
runTest("tests/common/test_eth_types")
task test, "Run all tests":
for filename in [
"test_bloom",
]:
runTest("tests/" & filename)
test_keyfile_task()
test_keys_task()
test_rlp_task()
test_p2p_task()
test_trie_task()
test_db_task()
test_utp_task()
test_common_task()
task test_discv5_full, "Run discovery v5 and its dependencies tests":
test_keys_task()
test_rlp_task()
test_discv5_task()
task build_dcli, "Build dcli":
buildBinary("tools/dcli")
import os, strutils
task build_fuzzers, "Build fuzzer test cases":
# This file is there to be able to quickly build the fuzzer test cases in
# order to avoid bit rot (e.g. for CI). Not for actual fuzzing.
# TODO: Building fuzzer test case one by one will make it take a bit longer,
# but we cannot import them in one Nim file due to the usage of
# `exportc: "AFLmain"` in the fuzzing test template for Windows:
# https://github.com/status-im/nim-testutils/blob/master/testutils/fuzzing.nim#L100
for file in walkDirRec("tests/fuzzing/"):
if file.endsWith("nim"):
buildBinary(file)