forked from nushell/nu_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_coverage.nu
32 lines (30 loc) · 835 Bytes
/
get_coverage.nu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Test coverage gathering for nushell
# Uses cargo-llvm-cov
# Uses separate execution to track the integration tests
# Hacked together by @sholderbach
# Get test coverage for nushell
def main [
--extra # Get coverage for extra features
] {
cargo llvm-cov show-env --export-prefix |
lines |
str substring 7.. |
split column '=' |
str trim -c '"' |
transpose |
headers |
reject 'column1' |
get 0 |
str trim |
load-env
cargo llvm-cov clean --workspace
if $extra {
cargo build --workspace --features extra
cargo test --workspace --features extra
} else {
cargo build --workspace
cargo test --workspace
}
cargo llvm-cov --no-run --lcov --output-path lcov.info
cargo llvm-cov --no-run --html
}