forked from RaoFoundation/subtensor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode-coverage.sh
More file actions
executable file
·43 lines (34 loc) · 1.01 KB
/
Copy pathcode-coverage.sh
File metadata and controls
executable file
·43 lines (34 loc) · 1.01 KB
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
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
set -TeE
## Find true directory this script resides in
__SOURCE__="${BASH_SOURCE[0]}"
while [[ -h "${__SOURCE__}" ]]; do
__SOURCE__="$(find "${__SOURCE__}" -type l -ls | sed -n 's@^.* -> \(.*\)@\1@p')"
done
__DIR__="$(cd -P "$(dirname "${__SOURCE__}")" && pwd)"
__G_DIR__="$(dirname "${__DIR__}")"
## Sub-directory name under: ../target/
_target_dir_name='tarpaulin'
_tarpaulin_options=(
--skip-clean
--no-fail-fast
--ignore-tests
--exclude-files "${__G_DIR__}/target/*"
)
if (( VERBOSE )); then
_tarpaulin_options+=( --verbose )
fi
##
# Do not fool around with contents of: ../target/debug
# - https://lib.rs/crates/cargo-tarpaulin#readme-recompilation
_tarpaulin_options+=(
--target-dir "${__G_DIR__}/target/${_target_dir_name}"
)
##
# Allow additional CLI parameters too
_extra_arguments=("${@}")
if ((${#_extra_arguments[@]})); then
_tarpaulin_options+=( "${_extra_arguments[@]}" )
fi
SKIP_WASM_BUILD=1 cargo +nightly tarpaulin "${_tarpaulin_options[@]}" |
grep -vE '^\|\|\s+(target/debug)'