[Piglit] [RFC 08/10] framework/deqp: allow loading a *-master.txt file as mustpass list

Nicolai Hähnle nhaehnle at gmail.com
Wed Oct 11 10:26:57 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

---
 framework/test/deqp.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/framework/test/deqp.py b/framework/test/deqp.py
index f62d731b1..f54135b0e 100644
--- a/framework/test/deqp.py
+++ b/framework/test/deqp.py
@@ -69,39 +69,49 @@ def get_option(env_varname, config_option, default=None, required=False):
 
 
 _EXTRA_ARGS = get_option('PIGLIT_DEQP_EXTRA_ARGS',
                          ('deqp', 'extra_args'),
                          default='').split()
 
 
 def select_source(bin_, filename, mustpass, extra_args):
     """Return either the mustpass list or the generated list."""
     if options.OPTIONS.deqp_mustpass:
-        return gen_mustpass_tests(mustpass)
+        if mustpass.endswith('.xml'):
+            return gen_mustpass_tests_xml(mustpass)
+
+        # Load a *-master.txt list.
+        tests = []
+        with open(mustpass, 'r') as filp:
+            for line in filp:
+                line = line.strip()
+                if line:
+                    tests.append(line)
+        return tests
     else:
         return iter_deqp_test_cases(
             gen_caselist_txt(bin_, filename, extra_args))
 
 
 def make_profile(test_list, test_class):
     """Create a TestProfile instance."""
     profile = TestProfile()
     runner = DEQPTestRunner()
     for testname in test_list:
         # deqp uses '.' as the testgroup separator.
         piglit_name = testname.replace('.', grouptools.SEPARATOR)
         profile.test_list[piglit_name] = test_class(testname, runner)
 
     return profile
 
 
-def gen_mustpass_tests(mp_list):
+def gen_mustpass_tests_xml(mp_list):
     """Return a testlist from the mustpass list."""
     root = et.parse(mp_list).getroot()
     group = []
 
     def gen(base):
         for elem in base:
             if elem.tag == 'Test':
                 yield '{}.{}'.format('.'.join(group), elem.get('name'))
             else:
                 group.append(elem.get('name'))
-- 
2.11.0



More information about the Piglit mailing list