summaryrefslogtreecommitdiff
path: root/tests/runtests.sh
blob: aa67ccde213646862cdc5c71667a2dc8a2d46c10 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /bin/sh

LOGFILE=runtests.log
POTENTIAL_TESTS='testboundaries'

for I in $POTENTIAL_TESTS
do
    GOOD=yes
    test -f $I || {
        echo "WARNING: test program $I not found, not running"
        GOOD=no
    }

    if test x$GOOD = xyes; then
        test -x $I || {
            echo "WARNING: test program $I is not executable, not running"
            GOOD=no
        }
    fi
    
    if test x$GOOD = xyes; then
        TESTS="$TESTS$I "
    fi
done

echo "Logging to $LOGFILE"

echo "Log file for Pango test programs." > $LOGFILE
echo "" >> $LOGFILE
echo "Tests are: "$TESTS >> $LOGFILE
echo "" >> $LOGFILE

for I in $TESTS
do
    echo -n "Running test program \"$I\", please wait:"
    echo "" >> $LOGFILE
    echo "Output of $I:" >> $LOGFILE
    if ./$I >>$LOGFILE 2>&1; then
        echo " passed"
    else
        echo
        echo
        echo '***'
        echo " Test failed: $I"
        echo " See $LOGFILE for errors"
        echo 
        exit 1
    fi
done

echo 
echo "All tests passed."