Makefile targets for ctail and ntu

This commit is contained in:
Zahary Karadjov 2020-06-11 19:41:43 +03:00 committed by zah
parent 7d3160b0b5
commit 4275abbefe
4 changed files with 35 additions and 13 deletions

14
.editorconfig Normal file
View File

@ -0,0 +1,14 @@
root = true
[*.nim]
indent_style = space
indent_size = 2
[*.sh]
indent_style = space
indent_size = 2
[Makefile]
ident_size = 2
ident_style = tab

View File

@ -15,23 +15,24 @@ BUILD_SYSTEM_DIR := vendor/nimbus-build-system
# unconditionally built by the default Make target # unconditionally built by the default Make target
TOOLS := \ TOOLS := \
validator_client \
beacon_node \ beacon_node \
block_sim \
deposit_contract \
inspector \ inspector \
logtrace \ logtrace \
deposit_contract \ nbench \
nbench_spec_scenarios \
ncli_db \
ncli_hash_tree_root \ ncli_hash_tree_root \
ncli_pretty \ ncli_pretty \
ncli_query \ ncli_query \
ncli_transition \ ncli_transition \
ncli_db \
process_dashboard \ process_dashboard \
stack_sizes \ stack_sizes \
state_sim \ state_sim \
block_sim \ validator_client \
nbench \
nbench_spec_scenarios
# bench_bls_sig_agggregation TODO reenable after bls v0.10.1 changes # bench_bls_sig_agggregation TODO reenable after bls v0.10.1 changes
TOOLS_DIRS := \ TOOLS_DIRS := \
beacon_chain \ beacon_chain \
benchmarks \ benchmarks \
@ -167,6 +168,14 @@ witti: | build deps
witti-dev: | build deps witti-dev: | build deps
NIM_PARAMS="$(subst ",\",$(NIM_PARAMS))" LOG_LEVEL="DEBUG; TRACE:discv5,networking; REQUIRED:none; DISABLED:none" $(ENV_SCRIPT) nim $(NIM_PARAMS) scripts/connect_to_testnet.nims $(SCRIPT_PARAMS) shared/witti NIM_PARAMS="$(subst ",\",$(NIM_PARAMS))" LOG_LEVEL="DEBUG; TRACE:discv5,networking; REQUIRED:none; DISABLED:none" $(ENV_SCRIPT) nim $(NIM_PARAMS) scripts/connect_to_testnet.nims $(SCRIPT_PARAMS) shared/witti
ctail: | build deps
mkdir -p vendor/.nimble/bin/
$(ENV_SCRIPT) nim -d:danger -o:vendor/.nimble/bin/ctail c vendor/nim-chronicles-tail/ctail.nim
ntu: | build deps
mkdir -p vendor/.nimble/bin/
$(ENV_SCRIPT) nim -d:danger -o:vendor/.nimble/bin/ntu c vendor/nim-testutils/ntu.nim
clean: | clean-common clean: | clean-common
rm -rf build/{$(TOOLS_CSV),all_tests,*_node,*ssz*,beacon_node_*,block_sim,state_sim,transition*} rm -rf build/{$(TOOLS_CSV),all_tests,*_node,*ssz*,beacon_node_*,block_sim,state_sim,transition*}
ifneq ($(USE_LIBBACKTRACE), 0) ifneq ($(USE_LIBBACKTRACE), 0)

View File

@ -43,6 +43,9 @@ else:
# switch("define", "snappy_implementation=libp2p") # switch("define", "snappy_implementation=libp2p")
const currentDir = currentSourcePath()[0 .. ^(len("config.nims") + 1)]
switch("define", "nim_compiler_path=" & currentDir & "env.sh nim")
switch("import", "testutils/moduletests") switch("import", "testutils/moduletests")
const useLibStackTrace = not defined(macosx) and const useLibStackTrace = not defined(macosx) and

View File

@ -1,5 +1,6 @@
import os except dirExists import os except dirExists
import strformat, confutils import strformat, confutils
import testutils/fuzzing_engines
const const
gitRoot = thisDir() / ".." gitRoot = thisDir() / ".."
@ -10,13 +11,8 @@ const
fuzzNims = gitRoot / "vendor" / "nim-testutils" / "testutils" / "fuzzing" / "fuzz.nims" fuzzNims = gitRoot / "vendor" / "nim-testutils" / "testutils" / "fuzzing" / "fuzz.nims"
type
FuzzerKind = enum
libFuzzer
afl
cli do (testname {.argument.}: string, cli do (testname {.argument.}: string,
fuzzer = libFuzzer): fuzzer = defaultFuzzingEngine):
if not dirExists(fixturesDir): if not dirExists(fixturesDir):
echo "Please run `make test` first in order to download the official ETH2 test vectors" echo "Please run `make test` first in order to download the official ETH2 test vectors"
@ -43,5 +39,5 @@ cli do (testname {.argument.}: string,
let testProgram = fuzzingTestsDir / &"ssz_decode_{testname}.nim" let testProgram = fuzzingTestsDir / &"ssz_decode_{testname}.nim"
exec &"""nim "{fuzzNims}" "{fuzzer}" "{testProgram}" "{corpusDir}" """ exec &"""ntu fuzz --fuzzer={fuzzer} --corpus="{corpusDir}" "{testProgram}" """