This repository was archived by the owner on Feb 17, 2024. It is now read-only.
File tree 3 files changed +16
-7
lines changed
3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 44
44
- ` dependencies_debian`: Debian packages to install before running the tests.
45
45
- `output_type` : output type, one of `html`, `text`, `json` or `lcov`.
46
46
- `output_path` : output path.
47
+ - `test_args` : arguments to pass to the test - `--nocapture` for example.
47
48
48
49
49
50
If neither `output_type` and `output_path` are defined, the action by
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ inputs:
14
14
output_path :
15
15
description : Output path to pass to grcov and set as report variable
16
16
default : ' '
17
+ test_args :
18
+ description : Arguments to pass to the test
17
19
outputs :
18
20
report :
19
21
description : Name of report file, for compatibility with rust-grcov
Original file line number Diff line number Diff line change 13
13
}
14
14
fi
15
15
16
- ARGS=()
16
+ TEST_ARGS=()
17
+ if [ -n " $INPUT_TEST_ARGS " ]; then
18
+ IFS=' ' read -r -a testargs <<< " $INPUT_TEST_ARGS"
19
+ TEST_ARGS+=( " ${testargs[@]} " )
20
+ fi
21
+
22
+ OUTPUT_ARGS=()
17
23
18
24
if [ -n " $INPUT_OUTPUT_TYPE " ]; then
19
- ARGS +=( " --$INPUT_OUTPUT_TYPE " )
25
+ OUTPUT_ARGS +=( " --$INPUT_OUTPUT_TYPE " )
20
26
fi
21
27
22
28
if [ -n " $INPUT_OUTPUT_PATH " ]; then
23
29
OUTPUT_PATH=" $INPUT_OUTPUT_PATH "
24
- ARGS +=( --output-path " $OUTPUT_PATH " )
30
+ OUTPUT_ARGS +=( --output-path " $OUTPUT_PATH " )
25
31
elif [ -z " $INPUT_OUTPUT_TYPE " ]; then
26
32
# Default if no output_type was specified either
27
33
OUTPUT_PATH=" lcov.info"
28
- ARGS +=( --lcov --output-path " $OUTPUT_PATH " )
34
+ OUTPUT_ARGS +=( --lcov --output-path " $OUTPUT_PATH " )
29
35
fi
30
36
31
37
export RUSTC_BOOTSTRAP
@@ -45,9 +51,9 @@ RUSTDOCFLAGS="$RUSTFLAGS"
45
51
RUST_BACKTRACE=1
46
52
47
53
cargo llvm-cov --workspace clean
48
- cargo llvm-cov --workspace --all-features --no-fail-fast --no-report
49
- cargo llvm-cov --workspace --all-features --no-fail-fast --no-report --doc
50
- cargo llvm-cov --no-run --doctests " ${ARGS [@]} "
54
+ cargo llvm-cov --workspace --all-features --no-fail-fast --no-report -- " ${TEST_ARGS[@]} "
55
+ cargo llvm-cov --workspace --all-features --no-fail-fast --no-report --doc -- " ${TEST_ARGS[@]} "
56
+ cargo llvm-cov --no-run --doctests " ${OUTPUT_ARGS [@]} "
51
57
cargo llvm-cov --no-run --doctests
52
58
53
59
if [ -n " $OUTPUT_PATH " ]; then
You can’t perform that action at this time.
0 commit comments