Commit a97a4d6c authored by Jason Ekstrand's avatar Jason Ekstrand Committed by Dylan Baker

framework: Add a test runner for the Vulkan CTS

This is mostly a copy-and-paste of the original GLES3 dEQP runner with a
few added tidbits that makes running the Vulkan CTS easier.  The two
force-skip cases were very useful in the early days when lots of tests were
still in development and may no longer be needed.  However, I have a
feeling that we will yet want them.

v2 (Dylan):
 - Fix PEP8 issues
 - add and update docstrings
 - update extra_args for global deqp changes
 - update piglit.conf.example
 - remove unused functions
 - use __future__
 - use "bin" instead of "exe" (gles31 is weird that it uses "exe" not
   "bin", all other deqp modules use "bin")
Reviewed-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
parent 8e7cde37
......@@ -75,6 +75,16 @@ testB
; overrides the value set here.
;extra_args=--deqp-visibility hidden
[deqp-vk]
; Path to the deqp-ck executable
; Can be overwritten by PIGLIT_DEQP_VK_BIN environment variable
;bin=/home/knuth/Vulkan-CTS/external/vulkancts/modules/vulkan/deqp-vk
; Space-separated list of extra command line arguments for deqp-gles31. The
; option is not required. The environment variable PIGLIT_DEQP_VK_EXTRA_ARGS
; overrides the value set here.
;extra_args=--deqp-visibility hidden
[cts]
; path to the cts executable
; can be overwritten by PIGLIT_CTS_BIN environment variable
......
# Copyright 2014-2016 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Piglit integrations for the official Khronos Vulkan CTS.
upstream: https://github.com/KhronosGroup/Vulkan-CTS
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import re
from framework.test import deqp
__all__ = ['profile']
# Path to the deqp-gles3 executable.
_DEQP_VK_BIN = deqp.get_option('PIGLIT_DEQP_VK_BIN',
('deqp-vk', 'bin'))
_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_VK_EXTRA_ARGS',
('deqp-vk', 'extra_args'),
default='').split()
_DEQP_ASSERT = re.compile(
r'deqp-vk: external/vulkancts/.*: Assertion `.*\' failed.')
class DEQPVKTest(deqp.DEQPBaseTest):
"""Test representation for Khronos Vulkan CTS."""
timeout = 60
deqp_bin = _DEQP_VK_BIN
@property
def extra_args(self):
return super(DEQPVKTest, self).extra_args + \
[x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]
def __init__(self, *args, **kwargs):
super(DEQPVKTest, self).__init__(*args, **kwargs)
def interpret_result(self):
if 'Failed to compile shader at vkGlslToSpirV' in self.result.out:
self.result.result = 'skip'
self.result.out += \
'\n\nMarked as skip because GLSLang failed to compile shaders'
elif _DEQP_ASSERT.search(self.result.err):
self.result.result = 'skip'
self.result.out += \
'\n\nMarked as skip because of a internal dEQP assertion'
else:
super(DEQPVKTest, self).interpret_result()
profile = deqp.make_profile( # pylint: disable=invalid-name
deqp.iter_deqp_test_cases(
deqp.gen_caselist_txt(_DEQP_VK_BIN, 'dEQP-VK-cases.txt',
_EXTRA_ARGS)),
DEQPVKTest)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment