diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2017-05-11 11:58:32 -0700 |
---|---|---|
committer | Timothy Arceri <tarceri@itsqueeze.com> | 2017-05-18 10:08:39 +1000 |
commit | 70ce2ccd2314120129428a029a8ee184ef92a9d5 (patch) | |
tree | 515fb21409a437969c06668b5afeb1be10f4f522 /framework | |
parent | a70adde158ad976dcde6acc3eaa2cd9cd2e05867 (diff) |
framework: Add command.setter method to Test
This allows the command to be overwritten or modified after
instantiation, which is useful for adding additional arguments in a
profile.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/test/base.py | 5 | ||||
-rw-r--r-- | framework/test/gleantest.py | 4 | ||||
-rw-r--r-- | framework/test/piglit_test.py | 4 | ||||
-rw-r--r-- | framework/test/shader_test.py | 4 |
4 files changed, 17 insertions, 0 deletions
diff --git a/framework/test/base.py b/framework/test/base.py index 4e7c8b25e..d73dee9f7 100644 --- a/framework/test/base.py +++ b/framework/test/base.py @@ -225,6 +225,11 @@ class Test(object): assert self._command return self._command + @command.setter + def command(self, new): + assert isinstance(new, list), 'Test.command must be a list' + self._command = new + @abc.abstractmethod def interpret_result(self): """Convert the raw output of the test into a form piglit understands. diff --git a/framework/test/gleantest.py b/framework/test/gleantest.py index 3d0c2efbd..b2d56f394 100644 --- a/framework/test/gleantest.py +++ b/framework/test/gleantest.py @@ -56,6 +56,10 @@ class GleanTest(Test): def command(self): return super(GleanTest, self).command + self.GLOBAL_PARAMS + @Test.command.setter + def command(self, new): + self._command = [n for n in new if not n in self.GLOBAL_PARAMS] + def interpret_result(self): if self.result.returncode != 0 or 'FAIL' in self.result.out: self.result.result = 'fail' diff --git a/framework/test/piglit_test.py b/framework/test/piglit_test.py index 571464bee..491f3d3d4 100644 --- a/framework/test/piglit_test.py +++ b/framework/test/piglit_test.py @@ -154,6 +154,10 @@ class PiglitGLTest(WindowResizeMixin, PiglitBaseTest): else: return super(PiglitGLTest, self).command + ['-auto', '-fbo'] + @command.setter + def command(self, new): + self._command = [n for n in new if n not in ['-auto', '-fbo']] + class PiglitCLTest(PiglitBaseTest): # pylint: disable=too-few-public-methods """ OpenCL specific Test class. diff --git a/framework/test/shader_test.py b/framework/test/shader_test.py index d98ec98e2..3e67cbd4d 100644 --- a/framework/test/shader_test.py +++ b/framework/test/shader_test.py @@ -172,6 +172,10 @@ class ShaderTest(FastSkipMixin, PiglitBaseTest): """ Add -auto and -fbo to the test command """ return self._command + ['-auto', '-fbo'] + @command.setter + def command(self, new): + self._command = [n for n in new if n not in ['-auto', '-fbo']] + class MultiShaderTest(ReducedProcessMixin, PiglitBaseTest): """A Shader class that can run more than one test at a time. |