diff options
author | Neil Roberts <nroberts@igalia.com> | 2018-04-04 23:06:37 +0200 |
---|---|---|
committer | Neil Roberts <nroberts@igalia.com> | 2018-11-07 23:29:14 +0100 |
commit | 221d924689e3bb2796cea957b8106bd14fd03e2c (patch) | |
tree | c66cbe784d7ac2762e6f3078efa2143a467be144 /framework | |
parent | 8fc34a6e875566c1cd2a0ca71971b595b1da6125 (diff) |
framework: Add a vulkan tests profile
This searches for files named *.vk_shader_test in the tests/vulkan
directory and runs them with VkRunner. VkRunner is executed as an
external dependency. It is found either with the vkrunner:bin config
option, by setting the PIGLIT_VKRUNNER_BINARY environment variable, or
just in the search path.
v2: Move VkShaderTest to piglit_test.py and rename to VkRunnerTest.
Add future imports. Remove unused import.
v3: Support the PIGLIT_VKRUNNER_BINARY variable to specify the
location of VkRunner.
v4: Add documentation to the README. Add an option in piglit.conf to
set the binary location. (Suggested by Samuel Iglesias)
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/test/piglit_test.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/framework/test/piglit_test.py b/framework/test/piglit_test.py index f52915d18..c80e355d1 100644 --- a/framework/test/piglit_test.py +++ b/framework/test/piglit_test.py @@ -44,6 +44,7 @@ __all__ = [ 'PiglitCLTest', 'PiglitGLTest', 'PiglitBaseTest', + 'VkRunnerTest', 'CL_CONCURRENT', 'ROOT_DIR', 'TEST_BIN_DIR', @@ -229,3 +230,25 @@ class CLProgramTester(PiglitCLTest): command = super(CLProgramTester, self).command command.insert(1, os.path.join(ROOT_DIR, self.filename)) return command + + +class VkRunnerTest(PiglitBaseTest): + """ Make a PiglitTest instance for a VkRunner shader test file """ + + def __init__(self, filename): + vkrunner_bin = os.environ.get('PIGLIT_VKRUNNER_BINARY') + + if vkrunner_bin is None: + vkrunner_bin = core.PIGLIT_CONFIG.safe_get( + 'vkrunner', 'bin', fallback='vkrunner') + + super(VkRunnerTest, self).__init__( + [vkrunner_bin, filename], + run_concurrent=True) + + @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 + # the search path. + return self._command |