[PATCH i-g-t] tests/igt_command_line.sh: Allow testing individual tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



meso will use this to run the tests for all testcases in parallel, for
great speedup!

v2: Fix bugs in the conversion. Oops, I broke the automake build.

Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
---
 tests/igt_command_line.sh | 42 ++++++++++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
index 7f80fc805d37..536cf16be692 100755
--- a/tests/igt_command_line.sh
+++ b/tests/igt_command_line.sh
@@ -37,26 +37,19 @@ fi
 # Manually running this script is possible in the source root or the
 # tests directory.
 
-TESTLISTFILE="$tests_dir/test-list.txt"
-if [ ! -r "$TESTLISTFILE" ]; then
-	tests_dir="tests"
-	TESTLISTFILE="$tests_dir/test-list.txt"
-fi
-
-TESTLIST=`cat $TESTLISTFILE`
-if [ $? -ne 0 ]; then
-	echo "Error: Could not read test lists"
-	exit 99
-fi
-
 fail () {
 	echo "FAIL: $1"
 	exit 1
 }
 
-for test in $TESTLIST; do
+function check_test ()
+{
+	local test
+
+	test=$1
+
 	if [ "$test" = "TESTLIST" -o "$test" = "END" ]; then
-		continue
+		return
 	fi
 
 	testname="$test"
@@ -105,4 +98,25 @@ for test in $TESTLIST; do
 	# check invalid subtest handling
 	echo "  Checking invalid subtest handling..."
 	./$test --run-subtest invalid-subtest > /dev/null 2>&1 && fail $test
+}
+
+TESTLISTFILE="$tests_dir/test-list.txt"
+if [ ! -r "$TESTLISTFILE" ]; then
+	tests_dir="tests"
+	TESTLISTFILE="$tests_dir/test-list.txt"
+fi
+
+TESTLIST=`cat $TESTLISTFILE`
+if [ $? -ne 0 ]; then
+	echo "Error: Could not read test lists"
+	exit 99
+fi
+
+if [[ "$1" != "" ]] ; then
+	check_test $1
+	exit 0
+fi
+
+for test in $TESTLIST; do
+	check_test $test
 done
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux