Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix makefile test commands #843

Merged
merged 5 commits into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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