aboutsummaryrefslogtreecommitdiff
path: root/test/run_test.sh
blob: 4d0df3d2f57d8f7110a98f89466eb64229dc9153 (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
#!/bin/sh
# vim: set ft=sh sw=4 sts=4 et :

if test -f "$TEST_SCRIPT_DIR""$1"_"setup.sh" ; then
    echo ">>> setup for test $1"
    if ! "$TEST_SCRIPT_DIR""$1"_"setup.sh" ; then
        echo ">>> exiting with error for test $1"
        exit 255
    fi
fi

echo ">>> test $1"
if ! $1 ; then
    if test -f "$TEST_SCRIPT_DIR""$1"_"cleanup.sh" ; then
        echo ">>> cleanup for test $1"
        "$TEST_SCRIPT_DIR""$1"_"cleanup.sh"
    fi
    echo ">>> exiting with error for test $1"
    exit 255
fi

if test -f "$TEST_SCRIPT_DIR""$1"_"cleanup.sh" ; then
    echo ">>> cleanup for test $1"
    if ! "$TEST_SCRIPT_DIR""$1"_"cleanup.sh" ; then
        echo ">>> exiting with error for test $1"
        exit 255
    fi
fi

echo ">>> exiting with success for test $1"
exit 0