btrfs-progs: string table: fix whitespace damage
[btrfs-progs-unstable/devel.git] / tests / mkfs-tests.sh
blob4780b543c93aacffd2da15a4398ea6a043399917
1 #!/bin/bash
3 # mkfs.btrfs tests
5 unset TOP
6 unset LANG
7 LANG=C
8 SCRIPT_DIR=$(dirname $(readlink -f $0))
9 TOP=$(readlink -f $SCRIPT_DIR/../)
10 TEST_DEV=${TEST_DEV:-}
11 RESULTS="$TOP/tests/mkfs-tests-results.txt"
12 IMAGE="$TOP/tests/test.img"
14 source $TOP/tests/common
16 # Allow child test to use $TOP and $RESULTS
17 export TOP
18 export RESULTS
19 # For custom script needs to verfiy recovery
20 export LANG
21 # For tests that only use a loop device
22 export IMAGE
24 rm -f $RESULTS
26 check_prereq mkfs.btrfs
27 check_prereq btrfs
29 # The tests are driven by their custom script called 'test.sh'
31 for i in $(find $TOP/tests/mkfs-tests -maxdepth 1 -mindepth 1 -type d \
32 ${TEST:+-name "$TEST"} | sort)
34 echo " [TEST] $(basename $i)"
35 cd $i
36 echo "=== Entering $i" >> $RESULTS
37 if [ -x test.sh ]; then
38 ./test.sh
39 if [ $? -ne 0 ]; then
40 _fail "test failed for case $(basename $i)"
43 cd $TOP
44 done