File: run-test-suites.bash

package info (click to toggle)
ruby1.9.1 1.9.3.194-8.1%2Bdeb7u5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 67,684 kB
  • sloc: ruby: 528,270; ansic: 518,972; xml: 25,427; yacc: 17,944; sh: 3,208; lisp: 1,998; tcl: 949; pascal: 723; makefile: 635; perl: 62; python: 47; awk: 36; asm: 35; sed: 27
file content (34 lines) | stat: -rwxr-xr-x 884 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
set -e

MAXFAIL=30
MAXERR=3

echo "*******************************************************************"
echo "Running 'make test'"
echo
make OPTS=-v test
echo
echo "*******************************************************************"
echo "Running 'make test-all'"
echo
make TESTS=-v test-all 2>&1 |tee make-test-all.log || true
echo
echo "'make test-all' finished. checking number of failures and errors."
echo "max number allowed: failures:$MAXFAIL errors:$MAXERR"
if ! grep -q tests, make-test-all.log; then
	echo "Could not find number of failures. Interpreter crash? Failing build."
	exit 1
fi
f=$(grep tests, make-test-all.log)
fail=$(echo $f | cut -d ' ' -f 5)
err=$(echo $f | cut -d ' ' -f 7)
if [ $err -gt $MAXERR ];then
	echo "Too many errors. Failing build."
	exit 1
fi
if [ $fail -gt $MAXFAIL ];then
	echo "Too many failures. Failing build."
	exit 1
fi
exit 0