|
1 | 1 | {:tasks
|
2 |
| - {:init (do (def code-cov-env |
3 |
| - {"CARGO_INCREMENTAL" "0" |
4 |
| - "RUSTFLAGS" "-Cinstrument-coverage -Copt-level=0 -Ccodegen-units=1 -Cllvm-args=--inline-threshold=0 -Clink-dead-code -Coverflow-checks=off" |
5 |
| - "LLVM_PROFILE_FILE" "target/coverage/cargo-test-%p-%m.profraw"})) |
6 |
| - :requires ([babashka.fs :as fs]) |
7 |
| - clean {:doc "Removes target folder" |
8 |
| - :task (fs/delete-tree "target")} |
9 |
| - test_lib_features (shell "cargo test --all-features --no-fail-fast") |
10 |
| - test_lib_no_default_features (shell "cargo test --no-default-features --no-fail-fast") |
11 |
| - cargo-test {:doc "Runs all cargo tests" |
12 |
| - :depends [test_lib_features test_lib_no_default_features]} |
13 |
| - cargo-fmt {:doc "Checks cargo fmt" |
14 |
| - :task (shell "cargo fmt --check")} |
15 |
| - cargo-clippy-all-features {:doc "Cargo clippy with all features" |
16 |
| - :task (shell "cargo clippy --all-features -- --deny warnings")} |
17 |
| - cargo-clippy-no-defaults {:doc "Cargo clippy with no default features" |
18 |
| - :task (shell "cargo clippy --no-default-features -- --deny warnings")} |
19 |
| - cargo-clippy-examples {:doc "Cargo clippy on examples" |
20 |
| - :task (shell "cargo clippy --examples -- --deny warnings -A clippy::unwrap-used")} |
21 |
| - clippy {:doc "Runs all variations of cargo clippy" |
22 |
| - :depends [cargo-clippy-all-features cargo-clippy-no-defaults cargo-clippy-examples]} |
23 |
| - cov-all-features {:doc "Coverage, all features" |
24 |
| - :task (shell {:extra-env code-cov-env} "cargo test --all-features")} |
25 |
| - cov-std-only {:doc "Coverage, std only" |
26 |
| - :task (shell {:extra-env code-cov-env} "cargo test --no-default-features")} |
27 |
| - cov-examples {:doc "Coverage, examples" |
28 |
| - :task (shell {:extra-env code-cov-env} "cargo test --examples")} |
29 |
| - clean-cov {:doc "Cleans all .profraw files and generated html" |
30 |
| - :task (fs/delete-tree "target/coverage")} |
31 |
| - grcov {:doc "Runs grcov to generate human readable html" |
32 |
| - :task (shell "grcov target/coverage --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing -o target/coverage/html")} |
33 |
| - coverage {:doc "Generates coverage in human friendly html in target/coverage/" |
34 |
| - :depends [clean-cov cov-all-features cov-std-only cov-examples grcov]} |
35 |
| - test {:doc "Runs all tests and checks" |
36 |
| - :depends [cargo-test cargo-fmt clippy]}}} |
| 2 | + {:requires ([babashka.fs :as fs]) |
| 3 | + clean {:doc "Removes target folder" |
| 4 | + :task (fs/delete-tree "target")} |
| 5 | + test_all_features (shell "cargo test --all-features --no-fail-fast") |
| 6 | + test_no_default_features (shell "cargo test --no-default-features --no-fail-fast") |
| 7 | + cargo-test {:doc "Runs all cargo tests" |
| 8 | + :depends [test_all_features test_no_default_features]} |
| 9 | + cargo-fmt {:doc "Checks cargo fmt" |
| 10 | + :task (shell "cargo fmt --check")} |
| 11 | + cargo-clippy-all-features {:doc "Cargo clippy with all features" |
| 12 | + :task (shell "cargo clippy --all-features -- --deny warnings")} |
| 13 | + cargo-clippy-no-defaults {:doc "Cargo clippy with no default features" |
| 14 | + :task (shell "cargo clippy --no-default-features -- --deny warnings")} |
| 15 | + cargo-clippy-examples {:doc "Cargo clippy on examples" |
| 16 | + :task (shell "cargo clippy --examples -- --deny warnings -A clippy::unwrap-used")} |
| 17 | + clippy {:doc "Runs all variations of cargo clippy" |
| 18 | + :depends [cargo-clippy-all-features cargo-clippy-no-defaults cargo-clippy-examples]} |
| 19 | + cov-all-features {:doc "Coverage, all features" |
| 20 | + :task (shell "cargo llvm-cov --no-report --all-features")} |
| 21 | + cov-std-only {:doc "Coverage, std only" |
| 22 | + :task (shell "cargo llvm-cov --no-report --no-default-features")} |
| 23 | + cov-examples {:doc "Coverage, examples" |
| 24 | + :task (shell "cargo llvm-cov --no-report --examples")} |
| 25 | + cov-clean {:doc "Cleans all .profraw files and generated html" |
| 26 | + :task (shell "cargo llvm-cov clean --workspace")} |
| 27 | + cov-html {:doc "Runs llvm-cov to generate human readable html" |
| 28 | + :depends [cov-clean cov-all-features cov-std-only] |
| 29 | + :task (shell "cargo llvm-cov report --html")} |
| 30 | + cov {:doc "Generates coverage and reports to the terminal" |
| 31 | + :depends [cov-clean cov-all-features cov-std-only cov-examples] |
| 32 | + :task (shell "cargo llvm-cov report")} |
| 33 | + test {:doc "Runs all tests and checks" |
| 34 | + :depends [cargo-test cargo-fmt clippy]}}} |
0 commit comments