e2fsprogs/tests/test_script.in

63 lines
1.2 KiB
Plaintext
Raw Normal View History

1997-04-26 18:00:26 +04:00
#!/bin/sh
#
# Test script for e2fsck
#
if test "$1"x = x ; then
TESTS=`ls -d $SRCDIR/[a-zA-Z]_* | $EGREP -v "\.failed|\.new"`
1997-04-26 18:00:26 +04:00
else
1997-04-29 18:53:37 +04:00
TESTS=
for i
do
1997-04-29 21:48:10 +04:00
case $i in
*.failed|*.new) continue ;;
1997-04-29 21:48:10 +04:00
[a-zA-Z]) TESTS="$TESTS $SRCDIR/${i}_*" ;;
*) TESTS="$TESTS $SRCDIR/$i" ;;
esac
1997-04-29 18:53:37 +04:00
done
1997-04-26 18:00:26 +04:00
fi
cmd_dir=$SRCDIR
1997-04-29 19:29:49 +04:00
if test "$TEST_CONFIG"x = x; then
TEST_CONFIG=$SRCDIR/test_config
fi
. $TEST_CONFIG
1997-04-26 18:00:26 +04:00
1997-04-29 18:53:37 +04:00
for test_dir in $TESTS
1997-04-26 18:00:26 +04:00
do
test_name=`echo $test_dir | sed -e 's;.*/;;'`
if [ -f $test_dir ] ; then
continue;
fi
1997-04-29 20:17:09 +04:00
if [ ! -d $test_dir ] ; then
echo "The test '$test_name' does not exist."
continue;
fi
1997-04-26 18:00:26 +04:00
if [ -f $test_dir/name ]; then
test_description=`cat $test_dir/name`
printf "%s: %s: " "$test_name" "$test_description"
1997-04-26 18:00:26 +04:00
else
printf "%s: " "$test_name"
1997-04-26 18:00:26 +04:00
fi
if [ -f $test_dir/script ]; then
. $test_dir/script
else
test_base=`echo $test_name | sed -e 's/_.*//'`
default_script=$SRCDIR/defaults/${test_base}_script
if [ -f $default_script ]; then
. $SRCDIR/defaults/${test_base}_script
else
echo "Missing test script!"
fi
fi
done
1997-04-29 18:53:37 +04:00
num_ok=`ls *.ok 2>/dev/null | wc -l`
1997-04-26 18:00:26 +04:00
num_failed=`ls *.failed 2>/dev/null | wc -l`
echo "$num_ok tests succeeded $num_failed tests failed"
test "$num_failed" -eq 0 || exit 1