add script to create coverage report manually
This commit is contained in:
parent
03bcf9976d
commit
6ab4bb9d54
|
@ -26,9 +26,10 @@
|
||||||
devShell = forAllSystems (system: pkgs: toolchain: pkgs.mkShell {
|
devShell = forAllSystems (system: pkgs: toolchain: pkgs.mkShell {
|
||||||
packages = [
|
packages = [
|
||||||
(toolchain.withComponents [
|
(toolchain.withComponents [
|
||||||
"cargo" "rustc" "rustfmt" "clippy"
|
"cargo" "rustc" "rustfmt" "clippy" "llvm-tools"
|
||||||
])
|
])
|
||||||
pkgs.mpv
|
pkgs.mpv
|
||||||
|
pkgs.grcov
|
||||||
];
|
];
|
||||||
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/";
|
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/";
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/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/
|
Loading…
Reference in New Issue