From cb4e3bd6860b4fee6ac8514eaa035ae819eb6eae Mon Sep 17 00:00:00 2001 From: austinabell Date: Wed, 11 Nov 2020 09:19:27 -0500 Subject: [PATCH 1/5] Fix makefile test commands --- Makefile | 16 ++++------------ README.md | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 29aa7c772280..153018e1f806 100644 --- a/Makefile +++ b/Makefile @@ -72,18 +72,10 @@ test-vectors: pull-serialization-tests run-vectors test: cargo test --all --all-features --exclude serialization_tests --exclude conformance_tests -# This will run all tests will all features enabled, which will exclude some tests with -# specific features disabled -test-all: pull-serialization-tests - cargo test --all-features +test-release: + cargo test --release --all --all-features --exclude serialization_tests --exclude conformance_tests -# This will run all tests will all features enabled, which will exclude some tests with -# specific features disabled with verbose compiler output -test-all-verbose: pull-serialization-tests - cargo test --verbose --all-features - -test-all-no-run: pull-serialization-tests - cargo test --all-features --no-run +test-all: test-release run-vectors # Checks if all headers are present and adds if not license: @@ -92,4 +84,4 @@ license: docs: cargo doc --no-deps --all-features -.PHONY: clean clean-all lint build release test license test-all test-vectors run-vectors pull-serialization-tests install docs +.PHONY: clean clean-all lint build release test license test-vectors run-vectors pull-serialization-tests install docs run-serialization-vectors run-conformance-vectors diff --git a/README.md b/README.md index e00b021879a2..c525591a4e46 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Will show all debug logs by default, but the `forest_libp2p::service` logs will ### Testing ```bash # To run base tests -cargo test # add --release flag for longer compilation but faster execution +make test # use test-release for longer compilation but faster execution # To pull serialization vectors submodule and run serialization and conformance tests make test-vectors From f0ca8a99f25a04ae6bf109aa916e5c0fd0c01785 Mon Sep 17 00:00:00 2001 From: austinabell Date: Wed, 11 Nov 2020 09:22:58 -0500 Subject: [PATCH 2/5] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c525591a4e46..01bab4924b16 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Will show all debug logs by default, but the `forest_libp2p::service` logs will ### Testing ```bash # To run base tests -make test # use test-release for longer compilation but faster execution +cargo test # use `make test-release` for longer compilation but faster execution # To pull serialization vectors submodule and run serialization and conformance tests make test-vectors From 3a355ff660ec0b78948de40b804271f46451e618 Mon Sep 17 00:00:00 2001 From: austinabell Date: Wed, 11 Nov 2020 09:25:25 -0500 Subject: [PATCH 3/5] add test-all to phony --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 153018e1f806..df453670410d 100644 --- a/Makefile +++ b/Makefile @@ -84,4 +84,4 @@ license: docs: cargo doc --no-deps --all-features -.PHONY: clean clean-all lint build release test license test-vectors run-vectors pull-serialization-tests install docs run-serialization-vectors run-conformance-vectors +.PHONY: clean clean-all lint build release test test-all license test-vectors run-vectors pull-serialization-tests install docs run-serialization-vectors run-conformance-vectors From a65aaa9ab4f9e473ddb5c9f4c9de841bccac585f Mon Sep 17 00:00:00 2001 From: austinabell Date: Wed, 11 Nov 2020 09:26:16 -0500 Subject: [PATCH 4/5] uh and test-release --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index df453670410d..b07925ae2061 100644 --- a/Makefile +++ b/Makefile @@ -84,4 +84,4 @@ license: docs: cargo doc --no-deps --all-features -.PHONY: clean clean-all lint build release test test-all license test-vectors run-vectors pull-serialization-tests install docs run-serialization-vectors run-conformance-vectors +.PHONY: clean clean-all lint build release test test-all test-release license test-vectors run-vectors pull-serialization-tests install docs run-serialization-vectors run-conformance-vectors From fd8cb6acf20e76c3d02cdf257837f6eb3d5228e5 Mon Sep 17 00:00:00 2001 From: austinabell Date: Wed, 11 Nov 2020 11:06:47 -0500 Subject: [PATCH 5/5] Put debug assertion tests behind config --- utils/bitfield/src/rleplus/reader.rs | 1 + utils/bitfield/src/rleplus/writer.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/utils/bitfield/src/rleplus/reader.rs b/utils/bitfield/src/rleplus/reader.rs index 7817cf042d10..65a321c58dfe 100644 --- a/utils/bitfield/src/rleplus/reader.rs +++ b/utils/bitfield/src/rleplus/reader.rs @@ -157,6 +157,7 @@ mod tests { assert_eq!(reader.read_len().unwrap(), None); } + #[cfg(debug_assertions)] #[test] #[should_panic(expected = "assertion failed")] fn too_many_bits_at_once() { diff --git a/utils/bitfield/src/rleplus/writer.rs b/utils/bitfield/src/rleplus/writer.rs index 39c465bfc4ac..fa8193262eb2 100644 --- a/utils/bitfield/src/rleplus/writer.rs +++ b/utils/bitfield/src/rleplus/writer.rs @@ -143,6 +143,7 @@ mod tests { ); } + #[cfg(debug_assertions)] #[test] #[should_panic(expected = "assertion failed")] fn zero_len() { @@ -150,6 +151,7 @@ mod tests { writer.write_len(0); } + #[cfg(debug_assertions)] #[test] #[should_panic(expected = "assertion failed")] fn more_bits_than_indicated() { @@ -157,6 +159,7 @@ mod tests { writer.write(100, 0); } + #[cfg(debug_assertions)] #[test] #[should_panic(expected = "assertion failed")] fn too_many_bits_at_once() {