[igt-dev] [PATCH i-g-t 3/3] tests/igt_command_line.sh: Check for duplicate subtest names

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu Oct 28 10:27:38 UTC 2021


On Thu, Oct 28, 2021 at 12:18:19PM +0200, Kamil Konieczny wrote:
> From: Petri Latvala <petri.latvala at intel.com>
> 
> A test having multiple subtests with the same name is always an error
> and a couple of such cases had already crept in. Keep them out.
> 
> Signed-off-by: Petri Latvala <petri.latvala at intel.com>

I thought we also would have some fuse in ./test --list but this
also makes sure we won't merge duplicated tests:

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>

-- 
Zbigniew

> ---
>  tests/igt_command_line.sh | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
> index 5356877c..fb8f2e2a 100755
> --- a/tests/igt_command_line.sh
> +++ b/tests/igt_command_line.sh
> @@ -92,6 +92,17 @@ check_test ()
>  		echo "    test does seem to be using igt_main() (should have subtests) and yet --list-subtests is empty!"
>  		fail $test
>  	fi
> +
> +	# check for duplicate subtests
> +	echo "  Checking subtest uniqueness..."
> +	if [ $RET -eq 0 ]; then
> +	    DUPLICATES="`./$test --list-subtests | sort | uniq -d`"
> +	    if [ -n "$DUPLICATES" ]; then
> +		echo "    test has duplicate subtest names!"
> +		echo $DUPLICATES
> +		fail $test
> +	    fi
> +	fi
>  }
>  
>  TESTLISTFILE="$tests_dir/test-list.txt"
> -- 
> 2.30.2
> 


More information about the igt-dev mailing list