summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Roberts <nroberts@igalia.com>2018-11-08 01:28:00 +0100
committerNeil Roberts <nroberts@igalia.com>2018-11-09 09:18:28 +0100
commit81c1cb497d9489e560b8c607300ab7c26e9332b9 (patch)
treea621e0e1b20a3c1ce563f1d122cdf3c8ce2189a5
parent386bf53a1f6029430143bebe5220e1cf1841f960 (diff)
framework/test: Use relative paths in the filename for VkRunnerTest
Previously the filename was the full path to the test. This would break if the filename was serialized and installed to a different location. The code is based on what is done for ASMParserTest. However I have a suspicion that this won’t work for running generated tests from an out-of-tree build. In that case the path no longer contains the path to the build directory. If this really is a problem it will need to be fixed for ASMParserTest too so it could be done in a separate patch. In the meantime there aren’t any generated VkRunner tests yet so it’s not really a problem. Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
-rw-r--r--framework/test/piglit_test.py8
-rw-r--r--tests/vulkan.py3
2 files changed, 6 insertions, 5 deletions
diff --git a/framework/test/piglit_test.py b/framework/test/piglit_test.py
index b64110bbc..166c2f792 100644
--- a/framework/test/piglit_test.py
+++ b/framework/test/piglit_test.py
@@ -244,14 +244,14 @@ class VkRunnerTest(PiglitBaseTest):
'vkrunner', 'bin', fallback='vkrunner')
super(VkRunnerTest, self).__init__(
- [vkrunner_bin, filename],
+ [vkrunner_bin],
run_concurrent=True)
self.filename = filename
@PiglitBaseTest.command.getter
def command(self):
- # This is overriden because we don't want PiglitBaseTest to
- # prepend TEST_BIN_DIR so that it will look for vkrunner in
+ # self._command is used because we don't want PiglitBaseTest
+ # to prepend TEST_BIN_DIR so that it will look for vkrunner in
# the search path.
- return self._command
+ return self._command + [os.path.join(ROOT_DIR, self.filename)]
diff --git a/tests/vulkan.py b/tests/vulkan.py
index 7058f3108..eed199c55 100644
--- a/tests/vulkan.py
+++ b/tests/vulkan.py
@@ -22,11 +22,12 @@ for basedir in [TESTS_DIR, GENERATED_TESTS_DIR]:
_basedir = os.path.join(basedir, 'vulkan')
for dirpath, _, filenames in os.walk(_basedir):
groupname = grouptools.from_path(os.path.relpath(dirpath, _basedir))
+ dirname = os.path.relpath(dirpath, os.path.join(basedir, '..'))
for filename in filenames:
testname, ext = os.path.splitext(filename)
if ext != '.vk_shader_test':
continue
- test = VkRunnerTest(os.path.join(dirpath, filename))
+ test = VkRunnerTest(os.path.join(dirname, filename))
group = grouptools.join(groupname, testname)
assert group not in profile.test_list, group