Don't build live verification tests by default. These are meant as manual tests for
developers to run to diagnose issues or verify correctness on a real system.
# Use these options to force a specific sanitizer on all test executables
option(TEST_USE_ADDRESS_SANITIZER "Linux only: Advanced memory checking" OFF)
option(TEST_USE_THREAD_SANITIZER "Linux only: Advanced thread checking" OFF)
+option(ENABLE_LIVE_VERIFICATION_TESTS "Enable tests which expect to run on live drivers. Meant for manual verification only" OFF)
include(GoogleTest)
add_subdirectory(framework)
loader_threading_tests.cpp)
target_link_libraries(test_threading PRIVATE testing_dependencies)
+# executables that are meant for testing against real drivers rather than the mocks
+if (ENABLE_LIVE_VERIFICATION_TESTS)
+ add_subdirectory(live_verification)
+endif()
+
if(WIN32)
# Copy loader and googletest (gtest) libs to test dir so the test executable can find them.
add_custom_command(TARGET test_regression POST_BUILD
add_custom_command(TARGET test_regression POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:vulkan> $<TARGET_FILE_DIR:test_regression>)
endif()
+
+ # Copy the gtest shared lib (if built) to the live verification tests directory so the tests finds it.
+ if(ENABLE_LIVE_VERIFICATION_TESTS)
+ add_custom_command(TARGET test_regression POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:gtest> $<TARGET_FILE_DIR:dynamic_rendering_get_proc_addr>)
+ endif()
endif()
# must happen after the dll's get copied over
-gtest_discover_tests(test_regression)
-
-# executables that are meant for testing against real drivers rather than the mocks
-add_subdirectory(live_verification)
\ No newline at end of file
+gtest_discover_tests(test_regression)
\ No newline at end of file
EXPECT_EQ(VK_SUCCESS, res);
std::vector<VkExtensionProperties> extensions;
extensions.resize(ext_count);
- res = inst.functions->vkEnumerateDeviceExtensionProperties(physical_device, nullptr, &ext_count, nullptr);
+ res = inst.functions->vkEnumerateDeviceExtensionProperties(physical_device, nullptr, &ext_count, extensions.data());
EXPECT_EQ(VK_SUCCESS, res);
extensions.resize(ext_count);
return extensions;
alloc_info.commandPool = command_pool;
funcs.vkAllocateCommandBuffers(dev, &alloc_info, &command_buffer);
PFN_vkBeginCommandBuffer vkBeginCommandBuffer =
- reinterpret_cast<PFN_vkBeginCommandBuffer>(vk_funcs.vkGetInstanceProcAddr(inst, "vkBeginCommandBuffer"));
+ reinterpret_cast<PFN_vkBeginCommandBuffer>(vk_funcs.vkGetInstanceProcAddr(inst.inst, "vkBeginCommandBuffer"));
VkCommandBufferBeginInfo begin_info{};
begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
VkResult res = vkBeginCommandBuffer(command_buffer, &begin_info);
assert(res == VK_SUCCESS);
- // call the dynamic rendering function
+ // call the dynamic rendering function -- should not go into the physical device function trampoline.
PFN_vkCmdBeginRenderingKHR vkCmdBeginRenderingKHR =
- reinterpret_cast<PFN_vkCmdBeginRenderingKHR>(vk_funcs.vkGetDeviceProcAddr(dev.dev, "vkCmdBeginRenderingKHR"));
+ reinterpret_cast<PFN_vkCmdBeginRenderingKHR>(vk_funcs.vkGetInstanceProcAddr(inst.inst, "vkCmdBeginRenderingKHR"));
VkRenderingInfoKHR rendering_info{};
rendering_info.sType = VK_STRUCTURE_TYPE_RENDERING_INFO_KHR;
vkCmdBeginRenderingKHR(command_buffer, &rendering_info);