summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-27 20:30:04 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-28 09:51:52 +0100
commitec330f7e1f024abe244f939feaf6aeb52967a537 (patch)
tree8e4011884424c7e0cae06f7d2cc1a26a50c27f45
parentc23625dbddedc7fdf1b8f6ec34da5d042b91998d (diff)
igt: auto-enumerate subtestsigt
This works together with the new subtest infrastructure in intel-gpu-tools. v2: An empty string crept into the subtest list, resulting in a testcase failure. Filter it out. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--tests/igt.tests26
1 files changed, 22 insertions, 4 deletions
diff --git a/tests/igt.tests b/tests/igt.tests
index d576cd19..5a2fdd2f 100644
--- a/tests/igt.tests
+++ b/tests/igt.tests
@@ -48,8 +48,8 @@ igtTestRoot = path.join(path.realpath(path.join(testBinDir, 'igt')), 'tests')
profile = TestProfile()
class IGTTest(ExecTest):
- def __init__(self, binary):
- ExecTest.__init__(self, [path.join(igtTestRoot, binary)])
+ def __init__(self, binary, arguments=[]):
+ ExecTest.__init__(self, [path.join(igtTestRoot, binary)] + arguments)
def interpretResult(self, out, returncode, results):
if returncode == 0:
@@ -95,7 +95,25 @@ singleTests = listTests("list-single-tests")
for test in singleTests:
profile.test_list['igt/' + test] = IGTTest(test)
+def addSubTestCases(test):
+ proc = subprocess.Popen(
+ [path.join(igtTestRoot, test), '--list-subtests' ],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ env=os.environ.copy(),
+ universal_newlines=True
+ )
+ out, err = proc.communicate()
+ returncode = proc.returncode
+
+ subtests = out.split("\n")
+
+ for subtest in subtests:
+ if subtest == "":
+ continue
+ profile.test_list['igt/' + test + '/' + subtest] = IGTTest(test, ['--run-subtest', subtest])
+
multiTests = listTests("list-multi-tests")
-for test in singleTests:
- profile.test_list['igt/' + test] = IGTTest(test)
+for test in multiTests:
+ addSubTestCases(test)