From ea648e70a989cca190cd7403fe892fd2dcc290b4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 20:37:14 +0200 Subject: Adding upstream version 1:9.11.5.P4+dfsg. Signed-off-by: Daniel Baumann --- unit/unittest.sh.in | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 unit/unittest.sh.in (limited to 'unit/unittest.sh.in') diff --git a/unit/unittest.sh.in b/unit/unittest.sh.in new file mode 100755 index 0000000..70335aa --- /dev/null +++ b/unit/unittest.sh.in @@ -0,0 +1,47 @@ +#!/bin/sh + +PATH="@ATFBIN@:${PATH}" +export PATH +ATFRUN=`command -v atf-run 2>/dev/null` +KYUA=`command -v kyua 2>/dev/null` + +status=0 +if [ -n "@UNITTESTS@" -a -x "$ATFRUN" -a -f Atffile ] +then + echo "S:unit:`date`" + echo "T:unit:1:A" + echo "I: unit tests (using atf-run)" + atf-run > atf.out + status=$? + + # | cat is there to force non-fancy output + atf-report < atf.out | cat + + if [ $status -eq 0 ] + then + rm -f atf.out + echo R:PASS + else + echo R:FAIL + fi + echo "E:unit:`date`" +elif [ -n "@UNITTESTS@" -a -x "$KYUA" -a -f Kyuafile ] +then + echo "S:unit:`date`" + echo "T:unit:1:A" + echo "I: unit tests (using kyua)" + kyua -v parallelism=${TEST_PARALLEL_JOBS:-1} --logfile kyua.log --loglevel debug test --results-file ${KYUA_RESULT:-NEW} + status=$? + + kyua report --results-file ${KYUA_RESULT:-LATEST} + + if [ $status -eq 0 ] + then + rm -f kyua.log + echo R:PASS + else + echo R:FAIL + fi + echo "E:unit:`date`" +fi +exit $status -- cgit v1.2.3