blob: fb6a84861a2bbe7f90fe5b13ee51c6233630d01a [file] [log] [blame]
Theodore Ts'oa418d3a1997-04-26 14:00:26 +00001#!/bin/sh
2#
3# Test script for e2fsck
4#
5
6if test "$1"x = x ; then
Theodore Ts'o1e3472c1997-04-29 14:53:37 +00007 TESTS=$SRCDIR/[a-zA-Z]_*
Theodore Ts'oa418d3a1997-04-26 14:00:26 +00008else
Theodore Ts'o1e3472c1997-04-29 14:53:37 +00009 TESTS=
10 for i
11 do
Theodore Ts'o521e3681997-04-29 17:48:10 +000012 case $i in
13 [a-zA-Z]) TESTS="$TESTS $SRCDIR/${i}_*" ;;
14 *) TESTS="$TESTS $SRCDIR/$i" ;;
15 esac
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000016 done
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000017fi
18
19cmd_dir=$SRCDIR
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000020
Theodore Ts'o5c576471997-04-29 15:29:49 +000021if test "$TEST_CONFIG"x = x; then
22 TEST_CONFIG=$SRCDIR/test_config
23fi
24
25. $TEST_CONFIG
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000026
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000027for test_dir in $TESTS
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000028do
29 test_name=`echo $test_dir | sed -e 's;.*/;;'`
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000030 if [ ! -d $test_dir ] ; then
31 echo "The test '$test_name' does not exist."
32 continue;
33 fi
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000034 if [ -f $test_dir/name ]; then
35 test_description=`cat $test_dir/name`
36 echo -n "$test_name: $test_description: "
37 else
38 echo -n "$test_name: "
39 fi
40 if [ -f $test_dir/script ]; then
41 . $test_dir/script
42 else
43 test_base=`echo $test_name | sed -e 's/_.*//'`
44 default_script=$SRCDIR/defaults/${test_base}_script
45 if [ -f $default_script ]; then
46 . $SRCDIR/defaults/${test_base}_script
47 else
48 echo "Missing test script!"
49 fi
50 fi
51done
52
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000053num_ok=`ls *.ok 2>/dev/null | wc -l`
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000054num_failed=`ls *.failed 2>/dev/null | wc -l`
55
56echo "$num_ok tests succeeded $num_failed tests failed"
57