File: remaketests.sh

package info (click to toggle)
ifupdown 0.8.44
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 952 kB
  • sloc: ansic: 2,781; sh: 899; perl: 513; makefile: 90
file content (53 lines) | stat: -rw-r--r-- 1,126 bytes parent folder | download | duplicates (8)
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
#!/bin/sh -e

debian/testbuild >/dev/null 2>&1 || true

cat <<EOF
#!/bin/sh -e

rm -rf tests/
mkdir tests
EOF



for x in tests/testcase.*; do
    n=${x#*.}
    echo "cat >tests/testcase.$n <<EOF"
    cat tests/testcase.$n
    echo "EOF"
    echo "cat >tests/up.$n <<EOF"
    cat tests/up-res.$n
    echo "EOF"
    echo
done   

cat <<EOF
result=true
for test in 1 2 3 4 5 6; do
        args="\$(cat tests/testcase.\$test | sed -n 's/^# RUN: //p')"
        ./ifup -nv --force -i tests/testcase.\$test \$args \\
                >tests/up-res-out.\$test 2>tests/up-res-err.\$test || 
                true
        (echo "====stdout===="; cat tests/up-res-out.\$test
         echo "====stderr===="; cat tests/up-res-err.\$test) > tests/up-res.\$test

        echo "Testcase \$test: \$args"
        
        if diff -ub tests/up.\$test tests/up-res.\$test; then
                echo "(okay)"
        else
                echo "(failed)"
                result=false
        fi
        echo "=========="
done

if \$result; then
        echo "(okay overall)"
        exit 0
else
        echo "(failed overall)"
        exit 1
fi
EOF