Fix library sourcing and fix junit formatting for github test reporters
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
libdir=$(readlink -f $(dirname ${BASH_SOURCE[0]}))/../lib
|
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
|
function validate_format
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo '<?xml version="1.0" encoding="'$encoding'"?>'
|
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/>'
|
echo ' <properties/>'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,6 +74,7 @@ EOF
|
|||||||
cat /tmp/$$.junit
|
cat /tmp/$$.junit
|
||||||
rm -f /tmp/$$.junit
|
rm -f /tmp/$$.junit
|
||||||
echo '</testsuite>'
|
echo '</testsuite>'
|
||||||
|
echo '</testsuites>'
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +109,8 @@ EOF
|
|||||||
if [ "$failtype" != "" ]; then
|
if [ "$failtype" != "" ]; then
|
||||||
SHUNIT_ERRORS=$(expr $SHUNIT_ERRORS + 1)
|
SHUNIT_ERRORS=$(expr $SHUNIT_ERRORS + 1)
|
||||||
SHUNIT_FAILURES=$(expr $SHUNIT_FAILURES + 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 ' <failure type="'$failtype'" message="'$failmsg'">' >> /tmp/$$.junit
|
||||||
echo ' <![CDATA[' >> /tmp/$$.junit
|
echo ' <![CDATA[' >> /tmp/$$.junit
|
||||||
echo "${cdata}" >> /tmp/$$.junit
|
echo "${cdata}" >> /tmp/$$.junit
|
||||||
|
|||||||
Reference in New Issue
Block a user