2
2
3
3
for path in /usr/lib/llvm-3.8/lib/clang/3.8.[0-9]/lib/linux/; do LLVM_PATH=$path ; done
4
4
export COVERAGE_OPTIONS=" -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Cpasses=insert-gcov-profiling -Zno-landing-pads -L$LLVM_PATH -lclang_rt.profile-x86_64"
5
- export RUSTC_WRAPPER=" ./ci/cov-rustc"
6
5
export CARGO_INCREMENTAL=0
7
6
8
7
LCOVOPT=" --gcov-tool ./ci/llvm-gcov --rc lcov_branch_coverage=1 --rc lcov_excl_line=assert"
@@ -12,25 +11,27 @@ LCOV="/usr/local/bin/lcov"
12
11
rm -rf * .info * .gcda * .gcno
13
12
cargo clean
14
13
15
- # unit tests
16
- cargo rustc --all-features --profile test --lib
17
- rm ./target/debug/mesabox-* .d
18
- ./target/debug/mesabox-*
19
- ${LCOV} ${LCOVOPT} --capture --directory . --base-directory . -o mesabox.info
14
+ # unit tests of libmesabox
15
+ export RUSTC_WRAPPER=" ./ci/libmesabox-cov-rustc"
16
+ cargo rustc --package libmesabox --all-features --profile test --lib
17
+ rm ./target/debug/libmesabox-* .d
18
+ ./target/debug/libmesabox-*
19
+ ${LCOV} ${LCOVOPT} --capture --directory . --base-directory . -o libmesabox.info
20
20
21
21
# cleanup target
22
22
rm -rf * .gcda * .gcno
23
23
cargo clean
24
24
25
25
# integration tests
26
+ export RUSTC_WRAPPER=" ./ci/mesabox-cov-rustc"
26
27
cargo rustc --all-features --test tests
27
28
rm ./target/debug/tests-* .d
28
29
./target/debug/tests-*
29
30
${LCOV} ${LCOVOPT} --capture --directory . --base-directory . -o tests.info
30
31
31
32
# combining and filtering
32
- ${LCOV} ${LCOVOPT} --add mesabox .info --add tests.info -o coverage.info
33
- ${LCOV} ${LCOVOPT} --extract coverage.info ` find " $( cd src; pwd) " -name " *.rs" ` -o final.info
33
+ ${LCOV} ${LCOVOPT} --add libmesabox .info --add tests.info -o coverage.info
34
+ ${LCOV} ${LCOVOPT} --extract coverage.info ` find " $( cd src; pwd) " -name " *.rs" ` ` find " $( cd libmesabox ; pwd ) " -name " *.rs " ` -o final.info
34
35
35
36
# generate report if not in CI
36
37
if [[ " $CI " != true ]]; then
0 commit comments