File: runregression.sh

package info (click to toggle)
kst 2.0.8-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,844 kB
  • sloc: cpp: 97,086; ansic: 13,364; python: 2,970; sh: 761; yacc: 184; lex: 143; makefile: 141; javascript: 122; xml: 30; perl: 30
file content (78 lines) | stat: -rwxr-xr-x 1,718 bytes parent folder | download | duplicates (10)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
#

VALGRIND=
GCOV=

if [ "x$1" == "x-g" ]; then
	GCOV=1
fi

if [ "x$1" == "x-v" ]; then
	VALGRIND="valgrind -v --num-callers=25";
fi

if [ "x$1" == "x-t" ]; then
	VALGRIND="valgrind -v --skin=helgrind --num-callers=25";
fi


######### All settings are above this line

CONSOLELOG=`mktemp /tmp/Kst_regressionlog.XXXXXX` || exit 4
echo Logging to $CONSOLELOG

make check
if [ $? -ne 0 ]; then
	echo "ERROR BUILDING TESTCASES"
	exit -1;
fi

TESTS="testeqparser testhistogram testscalars testlabelparser testrvector testvector healpix/testhealpix"
testeqparser_FILES="eparse.y escan.l eparse.c escan.c enodes.cpp enodefactory.cpp"
testhistogram_FILES="ksthistogram.cpp"
testscalars_FILES="kstscalar.cpp"
testlabelparser_FILES="labelparser.cpp"
testrvector_FILES="kstrvector.cpp"
testvector_FILES="kstvector.cpp"

for i in $TESTS; do
	if [ ! -e $i ]; then
		echo "ERROR: Couldn't find test $i.  Not running."
		continue;
	fi
	echo "-----------------------------------------------------------" >> $CONSOLELOG
	echo "Running test: $i" >> $CONSOLELOG
	output=`$VALGRIND ./$i $* 2>&1`
	FAILED=$?
	echo "$output" | grep -v QPixmap >>$CONSOLELOG
	if [ $FAILED -gt 0 ]; then
		echo "$FAILED testcases failed in $i" | tee -a $CONSOLELOG
	fi
	echo >>$CONSOLELOG
	echo Code coverage: >>$CONSOLELOG
	pushd ../kst >/dev/null 2>&1
	filenames='$'"$i"_FILES;
	list=`eval echo $filenames`
	for j in $list; do
		gcov -o .libs -n $j 2>&1 |
		while true; do
			read k
			if test $? -ne 0; then
				break;
			fi
			echo "$k" | grep "File \`$j'" >/dev/null 2>&1
			if test $? -eq 0; then
				read l
				echo $j: $l >>$CONSOLELOG
				break
			fi
		done
	done
	popd >/dev/null 2>&1
	echo >>$CONSOLELOG
	echo >>$CONSOLELOG
done

exit 0