summaryrefslogtreecommitdiff
path: root/tests/lib/framework-runtime
blob: 09d35edd9c8d21acbb2cda65d74b522b2f9e34ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
lib="/usr/share/aif/tests/lib"
STATUS=0

# $1 name of test
# $2... other args
function aiftest () {
	name=$1
	shift
	if [ ! -f $lib/test-$name ]
	then
		echo "NO SUCH TEST: $lib/test-$1" >&2
		return 2
	else
		$lib/test-$name "$@"
		local ret=$?
	fi
	if [ $ret -eq 0 ]
	then
		echo "$name $@ : OK"
	else
		echo "$name $@ : NOT OK ($ret)"
	fi
	[ $ret -gt $STATUS ] && STATUS=$ret
}

aiftest-done () {
	if [ $STATUS -eq 0 ]
	then
		echo 'ALL TESTS ENDED SUCCESSFULLY'
		exit 0
	else
		echo 'ONE OR MORE TESTS FAILED!' >&2
		exit $STATUS
	fi
}