2 # run a single regression test
11 export USE_VALGRIND="valgrind -q --sim-hints=lax-ioctls"
15 export USE_VALGRIND="valgrind --sim-hints=lax-ioctls --leak-check=full --show-reachable=yes --log-file=/tmp/valgrind-%p.log"
25 *.failed|*.new|*.ok|*.log|*.tmp|*.slow) exit 0 ;;
32 if test "$TEST_CONFIG"x = x; then
33 TEST_CONFIG=$SRCDIR/test_config
38 test_name=`echo $test_dir | sed -e 's;.*/;;'`
40 if [ -f $test_dir ] ; then
43 if [ ! -d $test_dir ] ; then
44 echo "The test '$test_name' does not exist."
47 if [ -z "`ls $test_dir`" ]; then
50 if [ -f $test_dir/name ]; then
51 test_description=`cat $test_dir/name`
56 $FSCK --help 2>&1 | grep -q -w -- -m && pfsck_enabled=yes
57 if [ "$pfsck_enabled" != "yes" ] ; then
58 echo "$test_dir" | grep -q multithread &&
59 echo "$test_name: $test_description: skipped (pfsck disabled)" &&
63 if [ -n "$SKIP_SLOW_TESTS" -a -f $test_dir/is_slow_test ]; then
64 echo "$test_name: $test_description: skipped (slow test)"
68 rm -f $test_name.ok $test_name.failed $test_name.log $test_name.slow
69 #echo -e -n "$test_name: $test_description:\r"
71 TMPFILE=$(mktemp ${TMPDIR:-/tmp}/e2fsprogs-tmp-$test_name.XXXXXX)
72 [ "$SKIP_UNLINK" != "true" ] && trap 'rm -f $TMPFILE ; exit' 0 1 2 15
75 if [ -f $test_dir/script ]; then
78 test_base=`echo $test_name | sed -e 's/_.*//'`
79 default_script=$SRCDIR/defaults/${test_base}_script
80 if [ -f $default_script ]; then
81 . $SRCDIR/defaults/${test_base}_script
83 echo "$test_name: Missing test script $default_script!"
86 elapsed=$((SECONDS - start))
87 if [ $elapsed -gt 60 -a ! -f $test_dir/is_slow_test ]; then
88 echo "$test_name: *** took $elapsed seconds to finish ***" |
90 echo "$test_name: consider adding $test_dir/is_slow_test"
93 if [ -n "$PRINT_FAILED" -a -f $test_name.failed ] ; then
97 if [ "$SKIP_UNLINK" != "true" ] ; then