~daniel-mehrmann/e2fsprogs/master

« back to all changes in this revision

Viewing changes to tests/test_script.in

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2012-06-14 13:01:21 UTC
  • mfrom: (8.4.18 sid)
  • Revision ID: package-import@ubuntu.com-20120614130121-t2gct0d09jepx0y6
Tags: 1.42.4-3ubuntu1
* Merge from Debian unstable (LP: #978012), remainging changes:
  - debian/control.in: 
      Build-depend on gettext:any instead of on gettext for (cross-building)
      Drop build dependency on dc, which hasn't been needed for some time.
      Update maintainer field.
  - debian/rules:
      Block pkg-create-dbgsym from operating on this package.
      Build without dietlibc-dev, which is in universe 
  - debian/control:
      Regenerate with ./debian/rules debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
 
#
3
 
# Test script for e2fsck
4
 
#
5
 
 
6
 
LC_ALL=C
7
 
export LC_ALL
8
 
 
9
 
case "$1" in 
 
2
# Run all or specified test scripts
 
3
#
 
4
 
 
5
case "$1" in
10
6
    --valgrind)
11
7
        export USE_VALGRIND="valgrind -q --sim-hints=lax-ioctls"
12
8
        shift;
18
14
esac
19
15
 
20
16
if test "$1"x = x ; then
21
 
  TESTS=`ls -d $SRCDIR/[a-zA-Z]_* | $EGREP -v "\.failed|\.new"`
 
17
  TESTS=`ls -d $SRCDIR/[a-zA-Z]_*`
22
18
else
23
19
  TESTS=
24
 
  for i 
25
 
  do
 
20
  for i; do
26
21
    case $i in
27
 
        *.failed|*.new) continue ;;
28
22
        [a-zA-Z])       TESTS="$TESTS $SRCDIR/${i}_*" ;;
29
23
        *)              TESTS="$TESTS $SRCDIR/$i" ;;
30
24
    esac
31
25
  done
32
26
fi
33
27
 
34
 
cmd_dir=$SRCDIR
35
 
 
36
 
if test "$TEST_CONFIG"x = x; then
37
 
        TEST_CONFIG=$SRCDIR/test_config
38
 
fi
39
 
 
40
 
. $TEST_CONFIG
41
 
 
42
 
TMPFILE=$(mktemp)
43
 
 
44
 
for test_dir in $TESTS
45
 
do
46
 
        test_name=`echo $test_dir | sed -e 's;.*/;;'`
47
 
        if [ -f $test_dir ] ; then
48
 
            continue;
49
 
        fi
50
 
        if [ ! -d $test_dir ] ; then
51
 
                echo "The test '$test_name' does not exist."
52
 
                continue;
53
 
        fi
54
 
        if [ -z "`ls $test_dir`" ]; then
55
 
                continue
56
 
        fi
57
 
        if [ -f $test_dir/name ]; then
58
 
                test_description=`cat $test_dir/name`
59
 
                printf "%s: %s: " "$test_name" "$test_description"
60
 
        else
61
 
                printf "%s: " "$test_name"
62
 
        fi
63
 
        if [ -f $test_dir/script ]; then
64
 
                . $test_dir/script
65
 
        else
66
 
                test_base=`echo $test_name | sed -e 's/_.*//'`
67
 
                default_script=$SRCDIR/defaults/${test_base}_script
68
 
                if [ -f $default_script ]; then
69
 
                        . $SRCDIR/defaults/${test_base}_script
70
 
                else
71
 
                        echo "Missing test script!"
72
 
                fi
73
 
        fi
74
 
done
75
 
 
76
 
num_ok=`ls *.ok 2>/dev/null | wc -l`
77
 
num_failed=`ls *.failed 2>/dev/null | wc -l`
78
 
 
79
 
echo "$num_ok tests succeeded   $num_failed tests failed"
80
 
 
81
 
test "$num_failed" -eq 0 && exit 0
82
 
 
83
 
echo -n "Tests failed: "
84
 
for fname in $(ls *.failed); do
85
 
        echo -n "${fname%%.failed} "
86
 
done
87
 
echo ""
88
 
 
89
 
exit 1
 
28
for test_dir in $TESTS; do
 
29
        ./test_one $test_dir
 
30
done
 
31
 
 
32
$SRCDIR/test_post