Skip to content

Commit 0349f73

Browse files
committed
fixup! tests: optionally write results as JUnit-style .xml
The t9902 test puts funny characters into its output, like \x1c. Let's translate them into XML attributes, too. At some stage, we will just want to add a function to the `test-tool` to perform this for us, instead of that ugly shell script construct that is incomplete to begin with. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 0aca55d commit 0349f73

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

t/test-lib.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,10 @@ xml_attr_encode () {
894894
printf '%s\n' "$@" |
895895
sed -e 's/&/\&amp;/g' -e "s/'/\&apos;/g" -e 's/"/\&quot;/g' \
896896
-e 's/</\&lt;/g' -e 's/>/\&gt;/g' \
897+
-e "s/$(printf \\x1c)/\\&#1c;/g" \
898+
-e "s/$(printf \\x1d)/\\&#1d;/g" \
899+
-e "s/$(printf \\x1e)/\\&#1d;/g" \
900+
-e "s/$(printf \\x1f)/\\&#1f;/g" \
897901
-e 's/ /\&#x09;/g' -e 's/$/\&#x0a;/' -e '$s/&#x0a;$//' |
898902
tr -d '\012\015'
899903
}

0 commit comments

Comments
 (0)