docs: Fix README link
[piglit.git] / tests / deqp_vk.py
blob410fbb7effc07d922c2f3663c9b31975949a636e
1 # coding=utf-8
2 # Copyright 2014-2016, 2019 Intel Corporation
4 # Permission is hereby granted, free of charge, to any person obtaining a copy
5 # of this software and associated documentation files (the "Software"), to deal
6 # in the Software without restriction, including without limitation the rights
7 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 # copies of the Software, and to permit persons to whom the Software is
9 # furnished to do so, subject to the following conditions:
11 # The above copyright notice and this permission notice shall be included in
12 # all copies or substantial portions of the Software.
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 # SOFTWARE.
22 """Piglit integrations for the official Khronos Vulkan CTS.
24 upstream: https://github.com/KhronosGroup/Vulkan-CTS
26 """
28 import re
30 from framework import core
31 from framework.test import deqp
33 __all__ = ['profile']
35 # Path to the deqp-gles3 executable.
36 _DEQP_VK_BIN = core.get_option('PIGLIT_DEQP_VK_BIN',
37 ('deqp-vk', 'bin'),
38 required=True)
40 _EXTRA_ARGS = core.get_option('PIGLIT_DEQP_VK_EXTRA_ARGS',
41 ('deqp-vk', 'extra_args'),
42 default='').split()
44 _DEQP_ASSERT = re.compile(
45 r'deqp-vk: external/vulkancts/.*: Assertion `.*\' failed.')
48 class DEQPVKTest(deqp.DEQPBaseTest):
49 """Test representation for Khronos Vulkan CTS."""
50 timeout = 60
51 deqp_bin = _DEQP_VK_BIN
52 @property
53 def extra_args(self):
54 return super(DEQPVKTest, self).extra_args + \
55 [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]
57 def interpret_result(self):
58 if 'Failed to compile shader at vkGlslToSpirV' in self.result.out:
59 self.result.result = 'skip'
60 self.result.out += \
61 '\n\nMarked as skip because GLSLang failed to compile shaders'
62 elif _DEQP_ASSERT.search(self.result.err):
63 self.result.result = 'skip'
64 self.result.out += \
65 '\n\nMarked as skip because of an internal dEQP assertion'
66 else:
67 super(DEQPVKTest, self).interpret_result()
70 profile = deqp.make_profile( # pylint: disable=invalid-name
71 deqp.iter_deqp_test_cases(
72 deqp.gen_caselist_txt(_DEQP_VK_BIN, 'dEQP-VK-cases.txt',
73 _EXTRA_ARGS)),
74 DEQPVKTest)