File: runtests

package info (click to toggle)
debian-installer-utils 1.45etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 516 kB
  • ctags: 18
  • sloc: sh: 581; ansic: 106; makefile: 72
file content (46 lines) | stat: -rwxr-xr-x 761 bytes parent folder | download | duplicates (12)
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
37
38
39
40
41
42
43
44
45
46
#! /bin/sh
set -e

TESTS=0
SUCCESSES=0

[ "$TEST_VERBOSE" ] || export TEST_VERBOSE=1

cd tests

if [ $TEST_VERBOSE -eq 1 ]; then
	echo "Running testsuite:"
fi
for test in *; do
	if [ ! -x $test ]; then
		continue
	fi

	if [ $TEST_VERBOSE -eq 1 ]; then
		echo -n "- $test... "
	elif [ $TEST_VERBOSE -ge 1 ]; then
		echo Running tests for $test...
	fi
	TESTS=$(($TESTS + 1))
	if eval "./$test"; then
		if [ $TEST_VERBOSE -eq 1 ]; then
			echo "OK."
		fi
		SUCCESSES=$(($SUCCESSES + 1))
	else
		if [ $TEST_VERBOSE -eq 1 ];then
			echo "FAILED."
		fi
	fi
	if [ $TEST_VERBOSE -ge 1 ]; then
		echo
	fi
done

if [ $TEST_VERBOSE -ge 1 ];then
	echo "Overall result: $SUCCESSES out of $TESTS tests were successful"
fi
if [ $SUCCESSES -ne $TESTS ]; then
	exit 1
fi
exit 0