Commit f6b5ed8f authored by Andres Gomez's avatar Andres Gomez
Browse files

framework/tests: add new piglit based test for replayer



v2:
  - Added a specific interpret_result implementation so we can
    identify when the Python replayer executable exists with a CRASH
    condition.

Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
Reviewed-by: Dylan Baker's avatarDylan Baker <dylan@pnwbakers.com>
Part-of: <!353>
parent 91f40c4e
......@@ -40,6 +40,7 @@ __all__ = [
'PiglitCLTest',
'PiglitGLTest',
'PiglitBaseTest',
'PiglitReplayerTest',
'VkRunnerTest',
'CL_CONCURRENT',
'ROOT_DIR',
......@@ -257,3 +258,38 @@ class VkRunnerTest(PiglitBaseTest):
# to prepend TEST_BIN_DIR so that it will look for vkrunner in
# the search path.
return self._command + [os.path.join(ROOT_DIR, self.filename)]
class PiglitReplayerTest(PiglitBaseTest):
""" Make a PiglitTest instance for a Replayer test
Runs a single replayer test.
Arguments:
extra_args -- to pass to replayer
"""
RESULTS_PATH = None
def __init__(self, extra_args, **kwargs):
super(PiglitReplayerTest, self).__init__(
['replayer.py', 'compare', 'trace'], **kwargs)
self.extra_args = extra_args
@PiglitBaseTest.command.getter
def command(self):
command = super(PiglitReplayerTest, self).command
if self.RESULTS_PATH is not None:
command += ['--output', self.RESULTS_PATH]
return command + self.extra_args
def interpret_result(self):
# Python's unhandled exceptions use "1" as exit code value. We want to
# interpret this as a CRASH. Therefore, we change the exit code value
# to a negative one, which is the one the Test base class interprets as
# a CRASH.
if self.result.returncode == 1:
self.result.returncode = -1
super(PiglitReplayerTest, self).interpret_result()
Supports Markdown
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