[Intel-gfx] [PATCH i-g-t 08/22] tests/igt_command_line.sh: Allow testing individual tests
Daniel Vetter
daniel.vetter at ffwll.ch
Tue Sep 5 12:36:10 UTC 2017
meso will use this to run the tests for all testcases in parallel, for
great speedup!
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
tests/igt_command_line.sh | 39 ++++++++++++++++++++++++++-------------
1 file changed, 26 insertions(+), 13 deletions(-)
diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
index 7f80fc805d37..f98a584a8ea3 100755
--- a/tests/igt_command_line.sh
+++ b/tests/igt_command_line.sh
@@ -37,24 +37,16 @@ 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
fi
@@ -105,4 +97,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
More information about the Intel-gfx
mailing list