Skip to content

Commit

Permalink
Makefile targets for ctail and ntu
Browse files Browse the repository at this point in the history
  • Loading branch information
zah committed Jun 22, 2020
1 parent 7d3160b commit 4275abb
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
@@ -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

21 changes: 15 additions & 6 deletions Makefile
Expand Up @@ -15,23 +15,24 @@ BUILD_SYSTEM_DIR := vendor/nimbus-build-system

# unconditionally built by the default Make target
TOOLS := \
validator_client \
beacon_node \
block_sim \
deposit_contract \
inspector \
logtrace \
deposit_contract \
nbench \
nbench_spec_scenarios \
ncli_db \
ncli_hash_tree_root \
ncli_pretty \
ncli_query \
ncli_transition \
ncli_db \
process_dashboard \
stack_sizes \
state_sim \
block_sim \
nbench \
nbench_spec_scenarios
validator_client \
# bench_bls_sig_agggregation TODO reenable after bls v0.10.1 changes

TOOLS_DIRS := \
beacon_chain \
benchmarks \
Expand Down Expand Up @@ -167,6 +168,14 @@ witti: | 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

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
rm -rf build/{$(TOOLS_CSV),all_tests,*_node,*ssz*,beacon_node_*,block_sim,state_sim,transition*}
ifneq ($(USE_LIBBACKTRACE), 0)
Expand Down
3 changes: 3 additions & 0 deletions config.nims
Expand Up @@ -43,6 +43,9 @@ else:

# 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")

const useLibStackTrace = not defined(macosx) and
Expand Down
10 changes: 3 additions & 7 deletions scripts/run_ssz_fuzzing_test.nims
@@ -1,5 +1,6 @@
import os except dirExists
import strformat, confutils
import testutils/fuzzing_engines

const
gitRoot = thisDir() / ".."
Expand All @@ -10,13 +11,8 @@ const

fuzzNims = gitRoot / "vendor" / "nim-testutils" / "testutils" / "fuzzing" / "fuzz.nims"

type
FuzzerKind = enum
libFuzzer
afl

cli do (testname {.argument.}: string,
fuzzer = libFuzzer):
fuzzer = defaultFuzzingEngine):

if not dirExists(fixturesDir):
echo "Please run `make test` first in order to download the official ETH2 test vectors"
Expand All @@ -43,5 +39,5 @@ cli do (testname {.argument.}: string,

let testProgram = fuzzingTestsDir / &"ssz_decode_{testname}.nim"

exec &"""nim "{fuzzNims}" "{fuzzer}" "{testProgram}" "{corpusDir}" """
exec &"""ntu fuzz --fuzzer={fuzzer} --corpus="{corpusDir}" "{testProgram}" """

0 comments on commit 4275abb

Please sign in to comment.