Skip to content

Commit

Permalink
Fix makefile test commands (#843)
Browse files Browse the repository at this point in the history
* Fix makefile test commands

* Update readme

* add test-all to phony

* uh and test-release

* Put debug assertion tests behind config
  • Loading branch information
austinabell authored Nov 11, 2020
1 parent 293ef19 commit 1832a05
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
16 changes: 4 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 test-all test-release license test-vectors run-vectors pull-serialization-tests install docs run-serialization-vectors run-conformance-vectors
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
Expand Down
1 change: 1 addition & 0 deletions utils/bitfield/src/rleplus/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 3 additions & 0 deletions utils/bitfield/src/rleplus/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,23 @@ mod tests {
);
}

#[cfg(debug_assertions)]
#[test]
#[should_panic(expected = "assertion failed")]
fn zero_len() {
let mut writer = BitWriter::new();
writer.write_len(0);
}

#[cfg(debug_assertions)]
#[test]
#[should_panic(expected = "assertion failed")]
fn more_bits_than_indicated() {
let mut writer = BitWriter::new();
writer.write(100, 0);
}

#[cfg(debug_assertions)]
#[test]
#[should_panic(expected = "assertion failed")]
fn too_many_bits_at_once() {
Expand Down

0 comments on commit 1832a05

Please sign in to comment.