Skip to content

Commit 7253f7c

Browse files
dschogitster
authored andcommitted
tests: fix incorrect --write-junit-xml code
In 78d5e4c (tests: refactor --write-junit-xml code, 2022-05-21), this developer refactored the `--write-junit-xml` code a bit, including the part where the current test case's title was used in a `set` invocation, but failed to account for the fact that some test cases' titles start with a long option, which the `set` misinterprets as being intended for parsing. Let's fix this by using the `set -- <...>` form. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cadcafc commit 7253f7c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

t/test-lib-junit.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ finalize_test_case_output () {
4646
shift
4747
case "$test_case_result" in
4848
ok)
49-
set "$*"
49+
set -- "$*"
5050
;;
5151
failure)
5252
junit_insert="<failure message=\"not ok $test_count -"
@@ -65,17 +65,17 @@ finalize_test_case_output () {
6565
junit_insert="$junit_insert<system-err>$(xml_attr_encode \
6666
"$(cat "$GIT_TEST_TEE_OUTPUT_FILE")")</system-err>"
6767
fi
68-
set "$1" " $junit_insert"
68+
set -- "$1" " $junit_insert"
6969
;;
7070
fixed)
71-
set "$* (breakage fixed)"
71+
set -- "$* (breakage fixed)"
7272
;;
7373
broken)
74-
set "$* (known breakage)"
74+
set -- "$* (known breakage)"
7575
;;
7676
skip)
7777
message="$(xml_attr_encode --no-lf "$skipped_reason")"
78-
set "$1" " <skipped message=\"$message\" />"
78+
set -- "$1" " <skipped message=\"$message\" />"
7979
;;
8080
esac
8181

0 commit comments

Comments
 (0)