• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Default script for testing the relocation library routines
3# (irel -- inode relocation and brel -- block relocation)
4#
5
6if [ -f $test_dir/setup ]; then
7	. $test_dir/setup
8fi
9
10if [ "$class"x = x ]; then
11	class=`echo $test_name | sed -e 's/e_\([^_]*\)_\(.*\)/\1/'`
12	instance=`echo $test_name | sed -e 's/e_\([^_]*\)_\(.*\)/\2/'`
13fi
14if [ "$OUT"x = x ]; then
15	OUT=$test_name.log
16fi
17if [ "$EXPECT"x = x ]; then
18	EXPECT=$SRCDIR/progs/test_data/expect.$class
19fi
20
21if [ "$class" = irel ]; then
22	TEST_PROG=$TEST_REL
23elif [ "$class" = brel ]; then
24	TEST_PROG=$TEST_REL
25elif [ "$class" = icount ]; then
26	TEST_PROG=$TEST_ICOUNT
27else
28	TEST_PROG=/bin/cat
29fi
30
31cat $SRCDIR/progs/test_data/$instance.setup $SRCDIR/progs/test_data/test.$class \
32    | $TEST_PROG -f - 2>&1 | tr -d \\015 > $OUT
33
34cmp -s $EXPECT $OUT
35status=$?
36
37rm -f $test_name.failed $test_name.ok
38
39if [ "$status" = 0 ] ; then
40    echo "$test_name: $test_description: ok"
41    touch $test_name.ok
42else
43    echo "$test_name: $test_description: failed"
44    diff $DIFF_OPTS $EXPECT $OUT > $test_name.failed
45fi
46
47unset EXPECT OUT class instance
48