[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-igt-dev
Subject:    Re: [igt-dev] [PATCH i-g-t 3/3] tests/igt_command_line.sh: Check for duplicate subtest names
From:       Zbigniew =?utf-8?Q?Kempczy=C5=84ski?= <zbigniew.kempczynski () intel ! com>
Date:       2021-10-28 10:27:38
Message-ID: 20211028102738.GC6307 () zkempczy-mobl2
[Download RAW message or body]

On Thu, Oct 28, 2021 at 12:18:19PM +0200, Kamil Konieczny wrote:
> From: Petri Latvala <petri.latvala@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@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@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
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic