Skip to content

Commit

Permalink
fix undefined variable in junit_xml.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
terhorstd committed Jan 22, 2025
1 parent 24d4a39 commit 26456a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions testsuite/junit_xml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ junit_write ()
bail_out 'junit_write: report file not open, call junit_open first!'
fi

if test -z "$1" -o -z "$2"; then
if test -z "$1" -o -z "$2"; then # Note: this aborts due to "undefined variable", not because of `-z`
bail_out 'junit_write: classname and testname arguments are mandatory!'
fi

Expand All @@ -126,8 +126,9 @@ junit_write ()
fi

if test "$3" = "failure" ; then
echo " <failure message=\"$4\" type=\"\"><![CDATA["
echo "${5/]]>/]]>]]\&gt;<\![CDATA[}"
msgdata="${5:-}"
echo " <failure message=\"${4:-}\" type=\"\"><![CDATA["
echo "${msgdata/]]>/]]>]]\&gt;<\![CDATA[}"
echo "]]></failure>"
fi
echo " </testcase>"
Expand Down

0 comments on commit 26456a7

Please sign in to comment.