Sometimes there are extra arguments to deqp that a developer wants for all of the test suites, this adds that option by putting a generic [deqp] section and add an extra_args. This new extra args gets joined with any suite specific extra_args
Signed-off-by: Dylan Baker <[email protected]> --- framework/test/deqp.py | 28 +++++++++++++++++----------- piglit.conf.example | 4 ++++ tests/cts.py | 6 +++++- tests/deqp_gles2.py | 7 ++++++- tests/deqp_gles3.py | 6 +++++- tests/deqp_gles31.py | 6 +++++- 6 files changed, 42 insertions(+), 15 deletions(-) diff --git a/framework/test/deqp.py b/framework/test/deqp.py index 0c4b8a0..4fd51ec 100644 --- a/framework/test/deqp.py +++ b/framework/test/deqp.py @@ -40,17 +40,6 @@ __all__ = [ ] -def make_profile(test_list, test_class): - """Create a TestProfile instance.""" - profile = TestProfile() - 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) - - return profile - - def get_option(env_varname, config_option, default=None): """Query the given environment variable and then piglit.conf for the option. @@ -66,6 +55,22 @@ def get_option(env_varname, config_option, default=None): return opt or default +_EXTRA_ARGS = get_option('PIGLIT_DEQP_EXTRA_ARGS', + ('deqp', 'extra_args'), + default='').split() + + +def make_profile(test_list, test_class): + """Create a TestProfile instance.""" + profile = TestProfile() + 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) + + return profile + + def gen_caselist_txt(bin_, caselist, extra_args): """Generate a caselist.txt and return its path. @@ -129,6 +134,7 @@ class DEQPBaseTest(Test): only works to join two lists together. """ + return _EXTRA_ARGS def __init__(self, case_name): command = [self.deqp_bin, '--deqp-case=' + case_name] diff --git a/piglit.conf.example b/piglit.conf.example index 0410a17..06c7105 100644 --- a/piglit.conf.example +++ b/piglit.conf.example @@ -33,6 +33,10 @@ bindir=/home/usr/oclconform testA testB +[deqp] +; Options that affect all deqp based suites +;extra_args=--deqp-visibility=hidden + [deqp-gles2] ; Path to the deqp-gles2 executable ; Can be overwritten by PIGLIT_DEQP_GLES2_BIN environment variable diff --git a/tests/cts.py b/tests/cts.py index 550eb29..0e64e1b 100644 --- a/tests/cts.py +++ b/tests/cts.py @@ -59,7 +59,11 @@ _EXTRA_ARGS = deqp.get_option('PIGLIT_CTS_EXTRA_ARGS', ('cts', 'extra_args'), class DEQPCTSTest(deqp.DEQPBaseTest): deqp_bin = _CTS_BIN - extra_args = [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')] + + @property + def extra_args(self): + return super(DEQPCTSTest, self).extra_args + \ + [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')] # Add all of the suites by default, users can use filters to remove them. diff --git a/tests/deqp_gles2.py b/tests/deqp_gles2.py index c951a19..ab897bd 100644 --- a/tests/deqp_gles2.py +++ b/tests/deqp_gles2.py @@ -39,7 +39,12 @@ _EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES2_EXTRA_ARGS', class DEQPGLES2Test(deqp.DEQPBaseTest): deqp_bin = _DEQP_GLES2_BIN - extra_args = [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')] + + @property + def extra_args(self): + return super(DEQPGLES2Test, self).extra_args + \ + [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')] + profile = deqp.make_profile( # pylint: disable=invalid-name diff --git a/tests/deqp_gles3.py b/tests/deqp_gles3.py index 00b06ad..783407d 100644 --- a/tests/deqp_gles3.py +++ b/tests/deqp_gles3.py @@ -81,7 +81,11 @@ def filter_mustpass(caselist_path): class DEQPGLES3Test(deqp.DEQPBaseTest): deqp_bin = _DEQP_GLES3_EXE - extra_args = [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')] + + @property + def extra_args(self): + return super(DEQPGLES3Test, self).extra_args + \ + [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')] def __init__(self, *args, **kwargs): diff --git a/tests/deqp_gles31.py b/tests/deqp_gles31.py index e5a22e0..f516a84 100644 --- a/tests/deqp_gles31.py +++ b/tests/deqp_gles31.py @@ -39,7 +39,11 @@ _EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES31_EXTRA_ARGS', class DEQPGLES31Test(deqp.DEQPBaseTest): deqp_bin = _DEQP_GLES31_BIN - extra_args = [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')] + + @property + def extra_args(self): + return super(DEQPGLES31Test, self).extra_args + \ + [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')] profile = deqp.make_profile( # pylint: disable=invalid-name -- 2.7.2 _______________________________________________ Piglit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/piglit
