diff options
Diffstat (limited to 'tests/test_script')
-rw-r--r-- | tests/test_script | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/test_script b/tests/test_script new file mode 100644 index 00000000..dc104f43 --- /dev/null +++ b/tests/test_script @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Test script for e2fsck +# + +if test "$1"x = x ; then +SRCDIR=. +else +SRCDIR=$1 +fi + +cmd_dir=$SRCDIR +TMPFILE=./test.img + +. $SRCDIR/test_config + +for test_dir in $SRCDIR/[a-zA-Z]_* +do + test_name=`echo $test_dir | sed -e 's;.*/;;'` + if [ -f $test_dir/name ]; then + test_description=`cat $test_dir/name` + echo -n "$test_name: $test_description: " + else + echo -n "$test_name: " + 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 + +num_ok=`ls *.ok | wc -l` +num_failed=`ls *.failed 2>/dev/null | wc -l` + +echo "$num_ok tests succeeded $num_failed tests failed" + |