mirror of
https://github.com/status-im/Vulkan-Docs.git
synced 2025-02-02 01:26:08 +00:00
476e3f422d
* Update release number to 104. Public Issues: * Remove the incorrect line from "`Initial`" to "`Invalid`" state in the <<commandbuffer-lifecycle-diagram, Lifecycle of a command buffer>> diagram (public issue 881). * Add Fuchsia platform to <<boilerplate-wsi-header-table, Window System Extensions and Headers>> table (public pull request 933). * Change the type of slink:VkBufferDeviceAddressCreateInfoEXT::pname:deviceAddress from basetype:VkDeviceSize to basetype:VkDeviceAddress. These are both typedefs of code:uint64_t, so it is an ABI-compatible change (public issue 934). Internal Issues: * Remove generated header files and update the CI tests to build a copy of the headers for use by the hpp-generate / hpp-compile CI stages. Targets to generate the headers will not be removed, but keeping these generated files in the repository increased the frequency of conflicts between branches when merging to master (internal issue 745). * Reword "`undefined: behavior if *action*" to "`must: not do *action*`" in the places the old terminology was used, and add a new <<writing-undefined, Describing Undefined Behavior>> section of the style guide to explain how to write such language in the future (internal issue 1579). * Move almost all Python scripts into the toplevel `scripts/` directory. Apply extensive internal edits to clean up and simplify the scripts, and try to follow PEP8 guidelines. Generalize the scripts with the use of a Conventions object controlling many aspects of output generation, to enable their use in other Khronos projects with similar requirements. Autogenerate extension interface refpages (these are experimental and may be retired going forward). New Extensions: * `VK_AMD_display_native_hdr` * `VK_EXT_full_screen_exclusive` (internal issue 1439) * `VK_EXT_host_query_reset` * `VK_EXT_pipeline_creation_feedback` (internal issue 1560) * `VK_KHR_surface_protected_capabilities` (internal issue 1520)
94 lines
3.1 KiB
Python
94 lines
3.1 KiB
Python
#!/usr/bin/python3
|
|
#
|
|
# Copyright (c) 2018-2019 Collabora, Ltd.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
# Author(s): Ryan Pavlik <ryan.pavlik@collabora.com>
|
|
#
|
|
# Purpose: This file contains tests for check_spec_links.py
|
|
# that depend on the API being used.
|
|
|
|
import pytest
|
|
|
|
from check_spec_links import MacroChecker, MessageId, makeMacroChecker
|
|
from spec_tools.console_printer import ConsolePrinter
|
|
from spec_tools.macro_checker_file import shouldEntityBeText
|
|
from test_check_spec_links import (CheckerWrapper, allMessages,
|
|
loneMsgReplacement, message, msgReplacement)
|
|
|
|
|
|
@pytest.fixture
|
|
def ckr(capsys):
|
|
"""Fixture - add an arg named ckr to your test function to automatically get one passed to you."""
|
|
return CheckerWrapper(capsys)
|
|
|
|
|
|
def test_vulkan_refpage_mismatch(ckr):
|
|
"""Vulkan-specific tests of the REFPAGE_MISMATCH message."""
|
|
ckr.enabled([MessageId.REFPAGE_MISMATCH])
|
|
# Should error: this is actually a mismatch in Vulkan
|
|
assert(ckr.check(
|
|
"""[open,refpage='VkQueueFlags']
|
|
--
|
|
include::../api/enums/VkQueueFlagBits.txt[]""").numDiagnostics() == 1)
|
|
assert(ckr.check(
|
|
"""[open,refpage='VkQueueFlags']
|
|
--
|
|
include::../validity/enums/VkQueueFlagBits.txt[]""").numDiagnostics() == 1)
|
|
|
|
|
|
def test_vulkan_refpage_missing(ckr):
|
|
"""Vulkan-specific tests of the REFPAGE_MISSING message."""
|
|
ckr.enabled([MessageId.REFPAGE_MISSING])
|
|
|
|
# Should error: flags are expected to have their own ref page.
|
|
assert(ckr.check(
|
|
"include::../api/flags/VkQueueFlags.txt[]").numDiagnostics() == 1)
|
|
|
|
|
|
def test_vulkan_refpage_block(ckr):
|
|
"""Vulkan-specific tests of the REFPAGE_BLOCK message."""
|
|
ckr.enabled([MessageId.REFPAGE_BLOCK])
|
|
|
|
# Should have no errors: Non-refpage usage of '--' is acceptable
|
|
assert(not ckr.check(
|
|
"""--
|
|
bla
|
|
--""").messages)
|
|
|
|
# Should have 1 error:
|
|
# - line after tag isn't '--'
|
|
result = ckr.check(
|
|
"""--
|
|
[open,]
|
|
bla
|
|
--""")
|
|
assert(result.numDiagnostics() == 1)
|
|
# Internally, it's as if the following were the spec source, after putting in the "fake" lines
|
|
# (each of the added lines comes from one message):
|
|
#
|
|
# --
|
|
# [open,]
|
|
# --
|
|
# bla
|
|
# --
|
|
assert("but did not find, a line containing only -- following a reference page tag" in message(result))
|
|
|
|
|
|
def test_vulkan_legacy(ckr):
|
|
"""Test the LEGACY message which is Vulkan-only."""
|
|
ckr.enabled([MessageId.LEGACY])
|
|
# Should complain about LEGACY
|
|
assert(ckr.check('sname:VkDeviceMemory').numDiagnostics() == 1)
|