2019-10-02 01:04:56 +00:00
|
|
|
.PHONY: tests
|
2019-09-07 18:19:54 +00:00
|
|
|
|
2019-10-02 01:04:56 +00:00
|
|
|
EF_TESTS = "tests/ef_tests"
|
2019-09-07 18:19:54 +00:00
|
|
|
|
2019-10-02 01:04:56 +00:00
|
|
|
# Builds the entire workspace in release (optimized).
|
|
|
|
#
|
|
|
|
# Binaries will most likely be found in `./target/release`
|
2019-11-25 04:48:24 +00:00
|
|
|
install:
|
2020-03-05 01:50:24 +00:00
|
|
|
cargo install --path lighthouse --force --locked
|
2019-09-07 18:19:54 +00:00
|
|
|
|
2019-11-25 04:48:24 +00:00
|
|
|
# Runs the full workspace tests in **release**, without downloading any additional
|
|
|
|
# test vectors.
|
|
|
|
test-release:
|
|
|
|
cargo test --all --release --exclude ef_tests
|
|
|
|
|
|
|
|
# Runs the full workspace tests in **debug**, without downloading any additional test
|
2019-10-02 01:04:56 +00:00
|
|
|
# vectors.
|
2019-11-25 04:48:24 +00:00
|
|
|
test-debug:
|
|
|
|
cargo test --all --exclude ef_tests
|
2019-10-29 16:58:39 +00:00
|
|
|
|
2019-11-25 04:48:24 +00:00
|
|
|
# Runs cargo-fmt (linter).
|
|
|
|
cargo-fmt:
|
|
|
|
cargo fmt --all -- --check
|
2019-10-29 16:58:39 +00:00
|
|
|
|
2019-11-25 04:48:24 +00:00
|
|
|
# Runs only the ef-test vectors.
|
|
|
|
run-ef-tests:
|
2019-10-29 16:58:39 +00:00
|
|
|
cargo test --release --manifest-path=$(EF_TESTS)/Cargo.toml --features "ef_tests"
|
2019-11-25 04:48:24 +00:00
|
|
|
cargo test --release --manifest-path=$(EF_TESTS)/Cargo.toml --features "ef_tests,fake_crypto"
|
2019-10-29 16:58:39 +00:00
|
|
|
|
2019-11-25 04:48:24 +00:00
|
|
|
# Downloads and runs the EF test vectors.
|
2019-10-30 09:42:32 +00:00
|
|
|
test-ef: make-ef-tests run-ef-tests
|
2019-09-07 18:19:54 +00:00
|
|
|
|
2019-11-25 04:48:24 +00:00
|
|
|
# Runs the full workspace tests in release, without downloading any additional
|
|
|
|
# test vectors.
|
|
|
|
test: test-release
|
2019-10-29 16:58:39 +00:00
|
|
|
|
2019-11-25 04:48:24 +00:00
|
|
|
# Runs the entire test suite, downloading test vectors if required.
|
|
|
|
test-full: cargo-fmt test-release test-debug test-ef
|
2019-09-07 18:19:54 +00:00
|
|
|
|
2019-10-02 01:04:56 +00:00
|
|
|
# Runs the makefile in the `ef_tests` repo.
|
|
|
|
#
|
|
|
|
# May download and extract an archive of test vectors from the ethereum
|
|
|
|
# repositories. At the time of writing, this was several hundred MB of
|
|
|
|
# downloads which extracts into several GB of test vectors.
|
|
|
|
make-ef-tests:
|
|
|
|
make -C $(EF_TESTS)
|
2019-09-07 18:19:54 +00:00
|
|
|
|
2019-10-02 01:04:56 +00:00
|
|
|
# Performs a `cargo` clean and cleans the `ef_tests` directory.
|
|
|
|
clean:
|
|
|
|
cargo clean
|
|
|
|
make -C $(EF_TESTS) clean
|