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

Petri Latvala petri.latvala at intel.com
Wed Oct 27 08:45:40 UTC 2021


A test having multiple subtests with the same name is always and error
and a couple of such cases had already crept in. Keep them out.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
---
 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.29.2



More information about the Intel-gfx-trybot mailing list