Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Test script for e2fsck |
| 4 | # |
| 5 | |
| 6 | if test "$1"x = x ; then |
| 7 | SRCDIR=. |
| 8 | else |
| 9 | SRCDIR=$1 |
| 10 | fi |
| 11 | |
| 12 | cmd_dir=$SRCDIR |
| 13 | TMPFILE=./test.img |
| 14 | |
| 15 | . $SRCDIR/test_config |
| 16 | |
| 17 | for test_dir in $SRCDIR/[a-zA-Z]_* |
| 18 | do |
| 19 | test_name=`echo $test_dir | sed -e 's;.*/;;'` |
| 20 | if [ -f $test_dir/name ]; then |
| 21 | test_description=`cat $test_dir/name` |
| 22 | echo -n "$test_name: $test_description: " |
| 23 | else |
| 24 | echo -n "$test_name: " |
| 25 | fi |
| 26 | if [ -f $test_dir/script ]; then |
| 27 | . $test_dir/script |
| 28 | else |
| 29 | test_base=`echo $test_name | sed -e 's/_.*//'` |
| 30 | default_script=$SRCDIR/defaults/${test_base}_script |
| 31 | if [ -f $default_script ]; then |
| 32 | . $SRCDIR/defaults/${test_base}_script |
| 33 | else |
| 34 | echo "Missing test script!" |
| 35 | fi |
| 36 | fi |
| 37 | done |
| 38 | |
| 39 | num_ok=`ls *.ok | wc -l` |
| 40 | num_failed=`ls *.failed 2>/dev/null | wc -l` |
| 41 | |
| 42 | echo "$num_ok tests succeeded $num_failed tests failed" |
| 43 | |