check: check-lint check-format check-test
check-lint:
cargo clippy --all-targets --all-features -- -D warnings
check-format:
rustfmt --check $$(find src -name "*.rs")
check-test:
cargo clean
CARGO_INCREMENTAL=0 RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" RUSTDOCFLAGS="-Cpanic=abort" cargo test
grcov ./target/debug/ -s . -t html --llvm --branch --ignore-not-existing -o ./target/debug/coverage/ --excl-line ".*match [a-z.*]* \\{$$"
cd target/debug/coverage && \
awk -F'[<>]' -vq="'" \
'/<span class="counterNoCov">/\
{\
sub(/\.html$$/, "", FILENAME);\
printf "Missing test coverage: %s:%04d ", FILENAME, $$7;\
sub(/^([^>]*>){8}/, "");\
sub(/(<[^<]*){2}$$/, "");\
gsub(/</, "<");\
gsub(/>/, ">");\
gsub(/&/, "\\&");\
gsub(/'/, q);\
gsub(/"/, "\"");\
print;\
rv=1\
}\
END {exit(rv)}' \
$$(find . -name "*.rs.html")
firefox $$(pwd)/target/debug/coverage/index.html