Commit 05fe08a0 authored by Dylan Baker's avatar Dylan Baker

framework: Add generic deqp options to piglit.conf

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: default avatarDylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
parent 1d83558d
...@@ -40,17 +40,6 @@ __all__ = [ ...@@ -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): def get_option(env_varname, config_option, default=None):
"""Query the given environment variable and then piglit.conf for the option. """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): ...@@ -66,6 +55,22 @@ def get_option(env_varname, config_option, default=None):
return opt or default 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): def gen_caselist_txt(bin_, caselist, extra_args):
"""Generate a caselist.txt and return its path. """Generate a caselist.txt and return its path.
...@@ -129,6 +134,7 @@ class DEQPBaseTest(Test): ...@@ -129,6 +134,7 @@ class DEQPBaseTest(Test):
only works to join two lists together. only works to join two lists together.
""" """
return _EXTRA_ARGS
def __init__(self, case_name): def __init__(self, case_name):
command = [self.deqp_bin, '--deqp-case=' + case_name] command = [self.deqp_bin, '--deqp-case=' + case_name]
......
...@@ -33,6 +33,10 @@ bindir=/home/usr/oclconform ...@@ -33,6 +33,10 @@ bindir=/home/usr/oclconform
testA testA
testB testB
[deqp]
; Options that affect all deqp based suites
;extra_args=--deqp-visibility=hidden
[deqp-gles2] [deqp-gles2]
; Path to the deqp-gles2 executable ; Path to the deqp-gles2 executable
; Can be overwritten by PIGLIT_DEQP_GLES2_BIN environment variable ; Can be overwritten by PIGLIT_DEQP_GLES2_BIN environment variable
......
...@@ -59,7 +59,11 @@ _EXTRA_ARGS = deqp.get_option('PIGLIT_CTS_EXTRA_ARGS', ('cts', 'extra_args'), ...@@ -59,7 +59,11 @@ _EXTRA_ARGS = deqp.get_option('PIGLIT_CTS_EXTRA_ARGS', ('cts', 'extra_args'),
class DEQPCTSTest(deqp.DEQPBaseTest): class DEQPCTSTest(deqp.DEQPBaseTest):
deqp_bin = _CTS_BIN 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. # Add all of the suites by default, users can use filters to remove them.
......
...@@ -39,7 +39,12 @@ _EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES2_EXTRA_ARGS', ...@@ -39,7 +39,12 @@ _EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES2_EXTRA_ARGS',
class DEQPGLES2Test(deqp.DEQPBaseTest): class DEQPGLES2Test(deqp.DEQPBaseTest):
deqp_bin = _DEQP_GLES2_BIN 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 profile = deqp.make_profile( # pylint: disable=invalid-name
......
...@@ -81,7 +81,11 @@ def filter_mustpass(caselist_path): ...@@ -81,7 +81,11 @@ def filter_mustpass(caselist_path):
class DEQPGLES3Test(deqp.DEQPBaseTest): class DEQPGLES3Test(deqp.DEQPBaseTest):
deqp_bin = _DEQP_GLES3_EXE 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): def __init__(self, *args, **kwargs):
......
...@@ -39,7 +39,11 @@ _EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES31_EXTRA_ARGS', ...@@ -39,7 +39,11 @@ _EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_GLES31_EXTRA_ARGS',
class DEQPGLES31Test(deqp.DEQPBaseTest): class DEQPGLES31Test(deqp.DEQPBaseTest):
deqp_bin = _DEQP_GLES31_BIN 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 profile = deqp.make_profile( # pylint: disable=invalid-name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment