aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/external/c-testsuite/single-exec
blob: e6952d9d870dada006d9039cba5781e581e718a2 (plain) (blame)
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
56
57
58
59
60
61
62
63
64
65
66
#! /bin/sh

set -e
set -u

if ! test -f README.md
then
    echo "run from the base directory." >&2
    exit 1
fi

compiler="$1"

scratchdir=$(mktemp -d)
cleanup () {
  rm -rf $scratchdir
}
trap cleanup EXIT

testdir="./tests/single-exec"
runner="./runners/single-exec/$compiler"

skipcmd="./runners/single-exec/$compiler.skip"
skipset="$scratchdir/skip_lut"

echo "TAP version 13"
echo "1..$(find ./tests/single-exec/ -name "*.c" | wc -l)"

if ! test -f "$runner"
then
    echo "$runner does not exist!" 1>&2
    exit 1
fi

if test -f "$skipcmd"
then
    if ! $skipcmd > "$scratchdir/skip.txt"
    then
        echo "skip list command failed" 1>&2
        exit 1
    fi

    ./scripts/lib-exec/mkset "$skipset" "$scratchdir/skip.txt"
else
    echo -n "" | ./scripts/lib-exec/mkset "$skipset"
fi

for t in $testdir/*.c
do
    result="ok"

    
    if ./scripts/lib-exec/setlookup "$skipset" "$t"
    then
        echo "ok $t # SKIP"
        continue
    fi

    if ! timeout 5m $runner $t > $scratchdir/t.out 2>&1
    then
        result="not ok"
    fi

    echo "$result" "$t"
    sed -e 's/^/\#/' $scratchdir/t.out
done