blob: 7e15b3d8eee54f1a96581ae9d7e4f205082a7d21 (
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
|
#!/bin/bash
TEST=`echo -n $1 | cut -d'.' -f1`
UPPER=`echo $TEST | tr 'a-z.' 'A-Z_'`
OUTPUT=test_$TEST
DEFINE=TEST_$UPPER
COMPILE="g++ -g -Wall -Werror -D$DEFINE -o $OUTPUT $*"
echo Testing $TEST:
echo Testing $TEST: > $OUTPUT.log
echo -n "* Compiling $TEST test"
echo Compiling $TEST test: > $OUTPUT.log
echo ${COMPILE} >> $OUTPUT.log
if ${COMPILE} >> ${OUTPUT}.log 2>&1; then
echo " [Success]"
echo "[Success]" >> $OUTPUT.log
echo -n "* Running $TEST test"
echo Running $TEST test: >> $OUTPUT.log
if ./$OUTPUT >> $OUTPUT.log 2>&1; then
echo " [Success]"
echo "[Success]" >> $OUTPUT.log
else
echo " [Failure]"
echo "[Failure]" >> $OUTPUT.log
fi
else
echo " [Failure]"
echo "[Failure]" >> $OUTPUT.log
fi
echo
|