From dd460e1313dcb7b0ff5ab9036c6cb6ab07ae35d3 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 26 Mar 2018 10:42:14 -0700 Subject: framework/test: Use getter for altering PiglitBaseTest Command This removes mutation of the class, and pushes the change out to run time instead of build time. This is better coding style, and is required for XML serialization, since paths need to be relative in the XML, and made absolute at runtime. Tested-by: Rafael Antognolli --- framework/test/piglit_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'framework/test') diff --git a/framework/test/piglit_test.py b/framework/test/piglit_test.py index cc129ed04..3d5b156a5 100644 --- a/framework/test/piglit_test.py +++ b/framework/test/piglit_test.py @@ -70,8 +70,11 @@ class PiglitBaseTest(ValgrindMixin, Test): def __init__(self, command, run_concurrent=True, **kwargs): super(PiglitBaseTest, self).__init__(command, run_concurrent, **kwargs) + @Test.command.getter + def command(self): # Prepend TEST_BIN_DIR to the path. - self._command[0] = os.path.join(TEST_BIN_DIR, self._command[0]) + cmd = os.path.join(TEST_BIN_DIR, super(PiglitBaseTest, self).command[0]) + return [cmd] + self._command[1:] def interpret_result(self): out = [] -- cgit v1.2.3