[Piglit] [PATCH] tests/igt.py: check all tests for subtests

Thomas Wood thomas.wood at intel.com
Thu Jul 31 08:32:45 PDT 2014


All the tests should now be able to respond to --list-subtests, so there
is no need to distinguish between single and multi-tests.

Signed-off-by: Thomas Wood <thomas.wood at intel.com>
---
 tests/igt.py | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/tests/igt.py b/tests/igt.py
index fd46648..58226a4 100644
--- a/tests/igt.py
+++ b/tests/igt.py
@@ -219,10 +219,8 @@ def listTests(listname):
 
     return progs
 
-singleTests = listTests("single-tests")
-
-for test in singleTests:
-    profile.test_list[path.join('igt', test)] = IGTTest(test)
+tests = listTests("single-tests")
+tests.extend(listTests("multi-tests"))
 
 def addSubTestCases(test):
     proc = subprocess.Popen(
@@ -234,6 +232,15 @@ def addSubTestCases(test):
             )
     out, err = proc.communicate()
 
+    # a return code of 79 indicates there are no subtests
+    if proc.returncode == 79:
+         profile.test_list[path.join('igt', test)] = IGTTest(test)
+         return
+
+    if proc.returncode != 0:
+         print "Error: Could not list subtests for " + test
+         return
+
     subtests = out.split("\n")
 
     for subtest in subtests:
@@ -242,9 +249,7 @@ def addSubTestCases(test):
         profile.test_list[path.join('igt', test, subtest)] = \
             IGTTest(test, ['--run-subtest', subtest])
 
-multiTests = listTests("multi-tests")
-
-for test in multiTests:
+for test in tests:
     addSubTestCases(test)
 
 profile.dmesg = True
-- 
1.9.3



More information about the Piglit mailing list