check: support include/exclude of sub groups
authorAmir Goldstein <amir73il@gmail.com>
Mon, 2 Jan 2017 13:22:59 +0000 (15:22 +0200)
committerEryu Guan <eguan@redhat.com>
Wed, 4 Jan 2017 07:42:15 +0000 (15:42 +0800)
Allow including and/or excluding tests by test dir and group.
-g and -x command line arguments can take the form of
<subdir>/<group>.

For example:

./check -n -g xfs/quick
./check -n -g stress -x xfs/stress
./check -n -g xfs/punch -x dangerous_fuzzers

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
check

diff --git a/check b/check
index faf6281cbd496e4d29e6b2f59adeacc9ce3bb2a4..8d1ec71484b04d53c26549e2e11164b6901263b9 100755 (executable)
--- a/check
+++ b/check
@@ -105,6 +105,14 @@ get_group_list()
 {
        local grp=$1
        local grpl=""
+       local sub=$(dirname $grp)
+
+       if [ -n "$sub" -a "$sub" != "." -a -d "$SRC_DIR/$sub" ]; then
+               # group is given as <subdir>/<group> (e.g. xfs/quick)
+               grp=$(basename $grp)
+               get_sub_group_list $sub $grp
+               return
+       fi
 
        for d in $SRC_GROUPS $FSTYP; do
                if ! test -d "$SRC_DIR/$d" ; then