From: Amir Goldstein Date: Mon, 2 Jan 2017 13:22:58 +0000 (+0200) Subject: check: factor out get_sub_group_list() helper X-Git-Tag: v2022.05.01~2247 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d0ad5cc76a052f3df225a4806c9b48d363d7fe03;p=users%2Fhch%2Fxfstests-dev.git check: factor out get_sub_group_list() helper This helper gets a list of tests that belong to a group under a specific tests subdir. Signed-off-by: Amir Goldstein Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/check b/check index cf6379bb4..faf6281cb 100755 --- a/check +++ b/check @@ -87,19 +87,30 @@ testlist options exit 0 } +get_sub_group_list() +{ + local d=$1 + local grp=$2 + + test -s "$SRC_DIR/$d/group" || return 1 + + local grpl=$(sed -n < $SRC_DIR/$d/group \ + -e 's/#.*//' \ + -e 's/$/ /' \ + -e "s;^\($VALID_TEST_NAME\).* $grp .*;$SRC_DIR/$d/\1;p") + echo $grpl +} + get_group_list() { - grp=$1 + local grp=$1 + local grpl="" for d in $SRC_GROUPS $FSTYP; do if ! test -d "$SRC_DIR/$d" ; then continue fi - l=$(sed -n < $SRC_DIR/$d/group \ - -e 's/#.*//' \ - -e 's/$/ /' \ - -e "s;^\($VALID_TEST_NAME\).* $grp .*;$SRC_DIR/$d/\1;p") - grpl="$grpl $l" + grpl="$grpl $(get_sub_group_list $d $grp)" done echo $grpl }