Skip to content

Commit

Permalink
excluding some sections
Browse files Browse the repository at this point in the history
  • Loading branch information
nimar committed Jun 25, 2022
1 parent 4e6a2a6 commit ff12334
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .vscode/coverage
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ cargo clean
rm lcov.info
rm -fr coverage
export CARGO_INCREMENTAL=0
# removing "-Zpanic_abort_tests -Cpanic=abort" since they don't quite work
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
cargo +nightly build --verbose $CARGO_OPTIONS
cargo +nightly test --all-features --no-fail-fast --verbose $CARGO_OPTIONS

grcov . --binary-path ./target/debug -s . --ignore="/*" --ignore="ferric/examples/*" -t lcov --branch --ignore-not-existing > lcov.info
export RUSTDOCFLAGS="-Cpanic=abort"
# the following flag makes cargo build work with nightly mode and we don't need the `+nightly` flag any more
export RUSTC_BOOTSTRAP=1
cargo build
cargo test --all-features --no-fail-fast
# excluding coverage of all test files and unit test sections in files, also excluding panic! macros
grcov . --binary-path ./target/debug -s . --ignore="/*" --ignore="ferric/examples/*" --ignore="ferric/tests/*" \
--excl-br-start "#\[test\]" --excl-start "#\[test\]" \
--excl-br-line "panic!" --excl-line "panic!" -t lcov --branch --ignore-not-existing > lcov.info
genhtml -o coverage --branch-coverage --show-details --highlight --ignore-errors source --legend lcov.info
cargo clean
unset RUSTFLAGS
unset RUSTDOCFLAGS
unset RUSTC_BOOTSTRAP
unset CARGO_INCREMENTAL
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"livePreview.defaultPreviewPath": "/coverage/ferric/src/core/index.html"
}

0 comments on commit ff12334

Please sign in to comment.