summaryrefslogtreecommitdiff
path: root/codegen/vulkan/scripts/test_entity_db.py
blob: ef08794c01f119b2ecabc411adc27e6e33d11461 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python3 -i
#
# Copyright (c) 2018-2019 Collabora, Ltd.
#
# SPDX-License-Identifier: Apache-2.0
#
# Author(s):    Ryan Pavlik <ryan.pavlik@collabora.com>


import pytest

from check_spec_links import VulkanEntityDatabase


@pytest.fixture
def db():
    ret = VulkanEntityDatabase()
    # print(ret.getEntityJson())
    return ret


def test_likely_recognized(db):
    assert(db.likelyRecognizedEntity('vkBla'))
    assert(db.likelyRecognizedEntity('VkBla'))
    assert(db.likelyRecognizedEntity('VK_BLA'))


def test_db(db):
    assert(db.findEntity('vkCreateInstance'))

    # VKAPI_CALL is not referenced, so not added to EntityDatabase.
    # assert(db.findEntity('VKAPI_CALL'))