btrfs-progs: tests: print shorter test name in the output
authorDavid Sterba <dsterba@suse.com>
Wed, 22 Jun 2016 09:30:24 +0000 (11:30 +0200)
committerDavid Sterba <dsterba@suse.com>
Wed, 22 Jun 2016 09:30:24 +0000 (11:30 +0200)
The full path is printed, we're interested in the last path component
only.

Signed-off-by: David Sterba <dsterba@suse.com>
tests/convert-tests.sh

index 064540f..0e025f9 100755 (executable)
@@ -22,18 +22,19 @@ export TEST_DEV
 rm -f $RESULTS
 
 run_one_test() {
+       local testdir
        local testname
 
-       testname="$1"
+       testdir="$1"
+       testname=$(basename "$testdir")
        echo "    [TEST/conv]   $testname"
-       cd $testname
+       cd "$testdir"
        echo "=== Entering $testname" >> $RESULTS
        if [ -x test.sh ]; then
-               # Difference convert test case needs different tools to restore
-               # and check image, so only support custom test scripts
+               # Only support custom test scripts
                ./test.sh
                if [ $? -ne 0 ]; then
-                       _fail "test failed for case $(basename $testname)"
+                       _fail "test failed for case $testname"
                fi
        else
                _fail "custom test script not found"