tags 933275 +patch
thanks

Hi,

here's a patch I've also sent to the mailing list. Works for me, but
probably needs some testing that it doesn't break anything else.

   Simon
>From 13105537e68f0d3692b19a0f5cf675d79e32d42a Mon Sep 17 00:00:00 2001
From: Simon Richter <simon.rich...@hogyros.de>
Date: Tue, 13 Aug 2019 13:49:06 +0200
Subject: [PATCH] Apply path correction to correct argument

This fixes running OpenCL tests under Valgrind, by applying the path
transformation to the argument that the original command turned into.

It would be nice to have a cleaner solution here that doesn't depend on
text substitution, but as long as there is no OpenCL test named "valgrind",
this should work.
---
 framework/test/piglit_test.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/framework/test/piglit_test.py b/framework/test/piglit_test.py
index 0881f00a6..ab6de0398 100644
--- a/framework/test/piglit_test.py
+++ b/framework/test/piglit_test.py
@@ -75,8 +75,7 @@ class PiglitBaseTest(ValgrindMixin, Test):
     @Test.command.getter
     def command(self):
         # Prepend TEST_BIN_DIR to the path.
-        cmd = os.path.join(TEST_BIN_DIR, super(PiglitBaseTest, self).command[0])
-        return [cmd] + self._command[1:]
+        return [os.path.join(TEST_BIN_DIR, c) if c == self._command[0] else c for c in super(PiglitBaseTest, self).command ]
 
     def interpret_result(self):
         out = []
@@ -231,8 +230,7 @@ class CLProgramTester(PiglitCLTest):
     @PiglitCLTest.command.getter
     def command(self):
         command = super(CLProgramTester, self).command
-        command.insert(1, os.path.join(ROOT_DIR, self.filename))
-        return command
+        return command + [ os.path.join(ROOT_DIR, self.filename) ]
 
 
 class VkRunnerTest(PiglitBaseTest):
-- 
2.20.1

Reply via email to