File: test_script.in

package info (click to toggle)
e2fsprogs 1.12-4
  • links: PTS
  • area: main
  • in suites: slink
  • size: 3,548 kB
  • ctags: 2,475
  • sloc: ansic: 24,432; sh: 2,060; makefile: 1,621; awk: 406; sed: 111
file content (57 lines) | stat: -rwxr-xr-x 1,087 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
#
# Test script for e2fsck
#

if test "$1"x = x ; then
  TESTS=$SRCDIR/[a-zA-Z]_*
else
  TESTS=
  for i 
  do
    case $i in
	[a-zA-Z])	TESTS="$TESTS $SRCDIR/${i}_*" ;;
	*)		TESTS="$TESTS $SRCDIR/$i" ;;
    esac
  done
fi

cmd_dir=$SRCDIR

if test "$TEST_CONFIG"x = x; then
	TEST_CONFIG=$SRCDIR/test_config
fi

. $TEST_CONFIG

for test_dir in $TESTS
do
	test_name=`echo $test_dir | sed -e 's;.*/;;'`
	if [ ! -d $test_dir ] ; then
		echo "The test '$test_name' does not exist."
		continue;
	fi
	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 2>/dev/null | wc -l`
num_failed=`ls *.failed 2>/dev/null | wc -l`

echo "$num_ok tests succeeded	$num_failed tests failed"