Fix library sourcing and fix junit formatting for github test reporters

This commit is contained in:
2026-01-18 11:19:52 -05:00
parent ad36a931b5
commit 44f865dc4f
2 changed files with 8 additions and 3 deletions

View File

@@ -1,7 +1,8 @@
#!/bin/bash
libdir=$(readlink -f $(dirname ${BASH_SOURCE[0]}))/../lib
source ${libdir}/cmdarg.sh
cmdarg_libdir=${AK_PREFIX/lib:-${libdir}}
source ${cmdarg_libdir}/cmdarg.sh
function validate_format
{

View File

@@ -54,7 +54,8 @@ EOF
fi
echo '<?xml version="1.0" encoding="'$encoding'"?>'
echo '<testsuite failures="'$failures'" time="'$elapsed'" timestamp="'$(date)'" errors="'$failures'" tests="'$tests'">'
echo '<testsuites>'
echo '<testsuite failures="'$failures'" time="'$elapsed'" timestamp="'$(date +"%Y-%m-%dT%H:%M:%S%:z")'" errors="'$failures'" tests="'$tests'">'
echo ' <properties/>'
}
@@ -73,6 +74,7 @@ EOF
cat /tmp/$$.junit
rm -f /tmp/$$.junit
echo '</testsuite>'
echo '</testsuites>'
return 0
}
@@ -107,6 +109,8 @@ EOF
if [ "$failtype" != "" ]; then
SHUNIT_ERRORS=$(expr $SHUNIT_ERRORS + 1)
SHUNIT_FAILURES=$(expr $SHUNIT_FAILURES + 1)
echo ' <system-out/>' >> /tmp/$$.junit
echo ' <system-err/>' >> /tmp/$$.junit
echo ' <failure type="'$failtype'" message="'$failmsg'">' >> /tmp/$$.junit
echo ' <![CDATA[' >> /tmp/$$.junit
echo "${cdata}" >> /tmp/$$.junit