aboutsummaryrefslogtreecommitdiff
path: root/functional/unittests.sh
blob: 3ec2ad32ba8fd9ae8120552219a57a9b02e46add (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

./ci-run $@ 2>&1 | ../functional/unittests.py --lava | tee ci.log
RET=`echo $?`
if [ "$RET" != "0" ]; then
	lava-test-case logfile --result fail
fi
results=`grep -E "Ran [0-9]{3} tests in " ci.log | sed -E 's/^Ran ([0-9]{3}) tests in ([0-9\.]+)s$/\1 \2/'`
count=`echo $results|cut -d' ' -f 1`
time=`echo $results|cut -d' ' -f 2`

if [ $count > 0 ]; then
	lava-test-case total-count --result pass --measurement ${count} --units tests
else
	lava-test-case total-count --result fail
fi
if [ $time > 0 ]; then
	lava-test-case overall-speed --result pass --measurement ${time} --units seconds
else
	lava-test-case overall-speed --result fail
fi
lava-test-case logfile --result pass