summaryrefslogtreecommitdiff
path: root/tests/igt_command_line.sh
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-09-06 10:02:52 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-09-08 17:05:33 +0200
commitf0243a761f1bdea7ea314eff3c73a3a82fbb6e61 (patch)
tree8ad08284a27e91940214e2fc85db9d37580e7bd6 /tests/igt_command_line.sh
parent8c1fcc61033ebedb3bb33a969b124dd8e2eedc22 (diff)
tests/igt_command_line.sh: Allow testing individual tests
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. v3: Try harder at being posix shell compliant. Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/igt_command_line.sh')
-rwxr-xr-xtests/igt_command_line.sh42
1 files changed, 28 insertions, 14 deletions
diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
index 7f80fc80..57d105e9 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
+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