22 lines
607 B
Bash
22 lines
607 B
Bash
|
#!/usr/bin/env bash
|
||
|
mkdir -p target/coverage
|
||
|
|
||
|
echo "Running tests"
|
||
|
RUSTFLAGS="-Cinstrument-coverage" LLVM_PROFILE_FILE="target/coverage/%p-%m.profraw" cargo test --all-features --release --no-fail-fast --lib --bins
|
||
|
|
||
|
echo "Generating coverage report"
|
||
|
grcov \
|
||
|
--source-dir . \
|
||
|
--binary-path ./target/release/deps/ \
|
||
|
--excl-start 'mod test* \{' \
|
||
|
--ignore 'tests/*' \
|
||
|
--ignore "*test.rs" \
|
||
|
--ignore "*tests.rs" \
|
||
|
--ignore "*github.com*" \
|
||
|
--ignore "*libcore*" \
|
||
|
--ignore "*rustc*" \
|
||
|
--ignore "*liballoc*" \
|
||
|
--ignore "*cargo*" \
|
||
|
-t html \
|
||
|
-o ./target/coverage/html \
|
||
|
target/coverage/
|