File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33# script to run project tests and report code coverage
44# uses llvm-cov (https://github.com/taiki-e/cargo-llvm-cov)
55
6+ # note: this is in addition to common ignore patterns llvm-cov appends on its own
7+ IGNORE_PATTERN=' /rgb\-lib/(migration/src/main\.rs|src/database/entities|src/wallet/test|target/llvm\-cov\-target)($|/)'
8+
69LLVM_COV_OPTS=()
710CARGO_TEST_OPTS=(" --" )
8- COV=" cargo llvm-cov --workspace --all-features"
11+ COV=" cargo llvm-cov --verbose -- workspace --all-features --ignore-filename-regex $IGNORE_PATTERN "
912
1013_die () {
1114 echo " err $* "
@@ -33,11 +36,11 @@ help() {
3336# cmdline arguments
3437while [ -n " $1 " ]; do
3538 case $1 in
36- -h| --help)
39+ -h | --help)
3740 help
3841 exit 0
3942 ;;
40- -t| --test)
43+ -t | --test)
4144 CARGO_TEST_OPTS+=(" $2 " )
4245 shift
4346 ;;
@@ -66,10 +69,7 @@ rustup component add llvm-tools-preview
6669cargo install cargo-llvm-cov
6770
6871_tit " generating coverage report"
69- IGNORE_PATTERN=" /rgb\-lib(/.*)?/(tests|examples|benches|migration/src/main.rs|src/database/entities|src/wallet/test)($|/)|/rgb\-lib/target/llvm\-cov\-target($|/)|^$HOME /\.cargo/(registry|git)/|^$HOME /\.rustup/toolchains($|/)"
70- $COV --html \
71- --ignore-filename-regex " $IGNORE_PATTERN " \
72- " ${LLVM_COV_OPTS[@]} " " ${CARGO_TEST_OPTS[@]} " --include-ignored
72+ $COV --html " ${LLVM_COV_OPTS[@]} " " ${CARGO_TEST_OPTS[@]} " --include-ignored
7373
7474# # show html report location
7575echo " generated html report: target/llvm-cov/html/index.html"
You can’t perform that action at this time.
0 commit comments