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 |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 7 | TESTS=$SRCDIR/[a-zA-Z]_* |
Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 8 | else |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 9 | TESTS= |
| 10 | for i |
| 11 | do |
Theodore Ts'o | 521e368 | 1997-04-29 17:48:10 +0000 | [diff] [blame] | 12 | case $i in |
| 13 | [a-zA-Z]) TESTS="$TESTS $SRCDIR/${i}_*" ;; |
| 14 | *) TESTS="$TESTS $SRCDIR/$i" ;; |
| 15 | esac |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 16 | done |
Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 17 | fi |
| 18 | |
| 19 | cmd_dir=$SRCDIR |
Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 20 | |
Theodore Ts'o | 5c57647 | 1997-04-29 15:29:49 +0000 | [diff] [blame] | 21 | if test "$TEST_CONFIG"x = x; then |
| 22 | TEST_CONFIG=$SRCDIR/test_config |
| 23 | fi |
| 24 | |
| 25 | . $TEST_CONFIG |
Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 26 | |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 27 | for test_dir in $TESTS |
Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 28 | do |
| 29 | test_name=`echo $test_dir | sed -e 's;.*/;;'` |
Theodore Ts'o | 19c78dc | 1997-04-29 16:17:09 +0000 | [diff] [blame] | 30 | if [ ! -d $test_dir ] ; then |
| 31 | echo "The test '$test_name' does not exist." |
| 32 | continue; |
| 33 | fi |
Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 34 | 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 |
| 51 | done |
| 52 | |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 53 | num_ok=`ls *.ok 2>/dev/null | wc -l` |
Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 54 | num_failed=`ls *.failed 2>/dev/null | wc -l` |
| 55 | |
| 56 | echo "$num_ok tests succeeded $num_failed tests failed" |
| 57 | |