From a5afa55a30a07f18c17527ad09420afb9bc5ff69 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Sat, 11 Jul 2015 00:38:07 +0200 Subject: [PATCH] btrfs-progs: tests: support testname glob To run a given test set the variable TEST like $ make test TEST=002-bad-transid $ make test TEST=002-* and only tests matching the value will be run. The pattern is glob and pased to 'find -name'. The convert tests do not follow the fsck and misc layout and are skipped if TEST is set. Signed-off-by: David Sterba --- tests/convert-tests.sh | 5 +++++ tests/fsck-tests.sh | 3 ++- tests/misc-tests.sh | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/convert-tests.sh b/tests/convert-tests.sh index 14dde1fe..b395e25e 100755 --- a/tests/convert-tests.sh +++ b/tests/convert-tests.sh @@ -52,6 +52,11 @@ convert_test() { run_check $TOP/btrfs-show-super $IMAGE } +if ! [ -z "$TEST" ]; then + echo " [TEST] skipped all convert tests, TEST=$TEST" + exit 0 +fi + for feature in '' 'extref' 'skinny-metadata' 'no-holes'; do convert_test "$feature" "ext2 4k nodesize" 4096 mke2fs -b 4096 convert_test "$feature" "ext3 4k nodesize" 4096 mke2fs -j -b 4096 diff --git a/tests/fsck-tests.sh b/tests/fsck-tests.sh index 7e90f25e..73538fec 100755 --- a/tests/fsck-tests.sh +++ b/tests/fsck-tests.sh @@ -64,7 +64,8 @@ run_one_test() { # This is for case btrfs-image can't dump or case needs extra # check/verify -for i in $(find $TOP/tests/fsck-tests -maxdepth 1 -mindepth 1 -type d | sort) +for i in $(find $TOP/tests/fsck-tests -maxdepth 1 -mindepth 1 -type d \ + ${TEST:+-name "$TEST"} | sort) do run_one_test "$i" done diff --git a/tests/misc-tests.sh b/tests/misc-tests.sh index 2ae99db9..1ed8850e 100755 --- a/tests/misc-tests.sh +++ b/tests/misc-tests.sh @@ -34,7 +34,8 @@ check_prereq btrfs # The tests are driven by their custom script called 'test.sh' -for i in $(find $TOP/tests/misc-tests -maxdepth 1 -mindepth 1 -type d | sort) +for i in $(find $TOP/tests/misc-tests -maxdepth 1 -mindepth 1 -type d \ + ${TEST:+-name "$TEST"} | sort) do echo " [TEST] $(basename $i)" cd $i