2011-02-26 02:26:33 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2011-07-27 16:31:07 +00:00
|
|
|
PATH="@ATFBIN@:${PATH}"
|
2011-02-26 02:26:33 +00:00
|
|
|
export PATH
|
2018-01-30 10:33:08 -08:00
|
|
|
ATFRUN=`command -v atf-run 2>/dev/null`
|
|
|
|
KYUA=`command -v kyua 2>/dev/null`
|
2011-02-26 02:26:33 +00:00
|
|
|
|
2011-09-04 12:12:15 +00:00
|
|
|
status=0
|
2018-01-02 10:20:58 +11:00
|
|
|
if [ -n "@UNITTESTS@" -a -x "$ATFRUN" -a -f Atffile ]
|
2011-02-27 14:13:51 +00:00
|
|
|
then
|
2015-09-24 07:43:11 +10:00
|
|
|
echo "S:unit:`date`"
|
2018-01-02 10:20:58 +11:00
|
|
|
echo "T:unit:1:A"
|
2018-03-08 16:53:16 -08:00
|
|
|
echo "I: unit tests (using atf-run)"
|
2011-08-23 01:29:39 +00:00
|
|
|
atf-run > atf.out
|
2011-08-23 22:52:58 +00:00
|
|
|
status=$?
|
|
|
|
|
2018-01-02 10:20:58 +11:00
|
|
|
# | cat is there to force non-fancy output
|
2011-08-23 22:52:58 +00:00
|
|
|
atf-report < atf.out | cat
|
|
|
|
|
2011-09-04 12:12:15 +00:00
|
|
|
if [ $status -eq 0 ]
|
|
|
|
then
|
|
|
|
rm -f atf.out
|
|
|
|
echo R:PASS
|
|
|
|
else
|
|
|
|
echo R:FAIL
|
|
|
|
fi
|
2015-09-24 07:43:11 +10:00
|
|
|
echo "E:unit:`date`"
|
2018-01-02 10:20:58 +11:00
|
|
|
elif [ -n "@UNITTESTS@" -a -x "$KYUA" -a -f Kyuafile ]
|
|
|
|
then
|
|
|
|
echo "S:unit:`date`"
|
|
|
|
echo "T:unit:1:A"
|
2018-03-08 16:53:16 -08:00
|
|
|
echo "I: unit tests (using kyua)"
|
2018-03-09 14:02:19 -08:00
|
|
|
kyua -v parallelism=${TEST_PARALLEL_JOBS:-1} --logfile kyua.log --loglevel debug test --results-file ${KYUA_RESULT:-NEW}
|
2018-01-02 10:20:58 +11:00
|
|
|
status=$?
|
|
|
|
|
2018-03-08 16:53:16 -08:00
|
|
|
kyua report --results-file ${KYUA_RESULT:-LATEST}
|
2018-01-02 10:20:58 +11:00
|
|
|
|
|
|
|
if [ $status -eq 0 ]
|
|
|
|
then
|
|
|
|
rm -f kyua.log
|
|
|
|
echo R:PASS
|
|
|
|
else
|
|
|
|
echo R:FAIL
|
|
|
|
fi
|
|
|
|
echo "E:unit:`date`"
|
2011-02-27 14:13:51 +00:00
|
|
|
fi
|
2011-09-04 12:12:15 +00:00
|
|
|
exit $status
|