diff options
author | Andres Gomez <agomez@igalia.com> | 2020-07-29 22:10:17 +0300 |
---|---|---|
committer | Andres Gomez <agomez@igalia.com> | 2020-11-02 22:22:33 +0200 |
commit | f6b5ed8f49025f9168841434ce6ed9ed2d1560ab (patch) | |
tree | c0511c24c86ec9d8f269b467db0ef3b54b4797bd /framework | |
parent | 91f40c4e20a031090ea9dd3d31a47b57ee28d724 (diff) |
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 <agomez@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/353>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/test/piglit_test.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/framework/test/piglit_test.py b/framework/test/piglit_test.py index 4082ba09c..cf3e00d09 100644 --- a/framework/test/piglit_test.py +++ b/framework/test/piglit_test.py @@ -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() |