File: alltests.sh

package info (click to toggle)
cpputest 4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,688 kB
  • sloc: cpp: 31,212; sh: 4,978; ansic: 1,360; makefile: 775; ruby: 676; xml: 8; sed: 1
file content (30 lines) | stat: -rwxr-xr-x 1,205 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
#!/bin/bash

checkForCppUTestToolsEnvVariable() {
	if [ -z "$CPPUTEST_HOME" ] ; then
	   echo "CPPUTEST_HOME not set. You must set CPPUTEST_HOME to the top level CppUTest directory"
	   exit 1
	fi
	if [ ! -d "$CPPUTEST_HOME" ] ; then
	   echo "CPPUTEST_HOME not set to a directory.  You must set CPPUTEST_HOME to the top level CppUTest directory"
	   exit 2
	fi
}

checkForCppUTestToolsEnvVariable

printf "" > exit  # so dosbox will run 'external' command 'exit' correctly
printf "" >ALLTESTS.LOG
for test in `ls *.EXE`; do
    kb=`ls -lsk ${test} | awk '{print $1}'`
    printf "Running ${test} (${kb}k) inside DOSBox...\n"
    dosbox -conf $CPPUTEST_HOME/platforms/Dos/dosbox-0.74.conf exit \
    -c "echo *** ${test} (${kb}k) *****************************>>ALLTESTS.LOG" \
    -c "${test}>>ALLTESTS.LOG" \
    -noconsole -exit 1>console_output 2>dosbox_error.log || { printf "error running command!\n"; cat dosbox_error.log;  exit 1; }
done
printf "\n"
[ "`cat ALLTESTS.LOG`" ] || { printf "No tests to run!\n"; exit 1; }
[ "`cat ALLTESTS.LOG|grep checks`" ] || { printf "No test output!\n"; exit 1; }
cat ALLTESTS.LOG
[ -z "`cat ALLTESTS.LOG|grep Failure`" ] || { printf "Failed tests!\n"; exit 1; }