diff mbox

[2/2] check: support include/exclude of sub groups

Message ID 1483363379-10210-2-git-send-email-amir73il@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Amir Goldstein Jan. 2, 2017, 1:22 p.m. UTC
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>
---
 check | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Eryu Guan Jan. 3, 2017, 5:06 a.m. UTC | #1
On Mon, Jan 02, 2017 at 03:22:59PM +0200, Amir Goldstein wrote:
> 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>

This looks handy to me! Mention this usage in usage() function too?

Thanks,
Eryu

> ---
>  check | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/check b/check
> index faf6281..8d1ec71 100755
> --- 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
> -- 
> 2.7.4
> 
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Amir Goldstein Jan. 3, 2017, 9:10 a.m. UTC | #2
On Tue, Jan 3, 2017 at 7:06 AM, Eryu Guan <eguan@redhat.com> wrote:
> On Mon, Jan 02, 2017 at 03:22:59PM +0200, Amir Goldstein wrote:
>> 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>
>
> This looks handy to me! Mention this usage in usage() function too?
>

usage() is so far behind and cryptic (what is the difference between -E and -X?)
I will send a separate patch to address these and the new subgroup as well.

> Thanks,
> Eryu
>
>> ---
>>  check | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/check b/check
>> index faf6281..8d1ec71 100755
>> --- 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
>> --
>> 2.7.4
>>
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/check b/check
index faf6281..8d1ec71 100755
--- 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