Available on crate feature
_test only.Expand description
Utilities used in the integration tests of this crate.
The Vulkan layer essentially provides a bunch of function pointers to the loader. To mock multiple layers in the same process, it is required to use different types so different function pointers will be generated. To avoid extremely long compile time, we shouldn’t create a new layer type for every test case. Instead we run test cases in different processes, and share the same layer type as possible. If a test case needs multiple layers at the same time, multiple layer types should be used.
Follow the following steps to write a unit test:
- Use
TestGlobal::builderto construct the static resources needed to mock one layer. Mocks to static methods can be set with different builder functions. - Call
TestGlobal::create_contextto set up the scope for expectations. - Use
TestLayeras a layer implementation.
Modules§
Structs§
- ArcDel
- A thread-safe reference-counting pointer, but with a custom deleter.
- Del
- A wrapper for T but with a user defined deleter. ‘Del’ stands for ‘deleter’.
- Mock
Device Info - A mock struct that implements the
DeviceInfotrait. - Mock
Drop - Mock
Global Hooks Info - A mock struct that implements the
GlobalHooksInfotrait. - Mock
Instance Info - A mock struct that implements the
InstanceInfotrait. - Mock
Test Layer - Tag
- Test layer tags to distinguish different
TestLayer. DifferentIwill result in different types. - Test
Global - The container of the static resources related to
TestLayer<T>. - Test
Global Builder - The builder for
TestGlobal. - Test
Layer - The mock for the
Layertrait. - VkLayer
Device Create Info - Sub type of structure for instance and device loader ext of CreateInfo. Bindings for the C
VkLayerDeviceCreateInfotype defined in thevk_layer.hfile. - VkLayer
Function Unix - Bindings for the C
VkLayerFunctiontype defined in thevk_layer.hfile. - VkLayer
Instance Create Info - Sub type of structure for instance and device loader ext of CreateInfo.
Traits§
- Layer
Manifest Ext - A trait to provide an extra meaningful constructor for
LayerManifest. - Test
Layer Mock - A set of interfaces that the integration tests are interested to mock.
- Test
Layer Tag - A trait used to include all possible
Tag<I>.
Type Aliases§
- VkLayer
Device Link - A list node that contains the next entity’s
vkGetInstanceProcAddrandvkGetDeviceProcAddrused by a layer. One possible payload ofVkLayerDeviceCreateInfo