Refactor tests FrameworkEnvironment class
authorCharles Giessen <charles@lunarg.com>
Wed, 8 Dec 2021 19:48:52 +0000 (12:48 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Sat, 11 Dec 2021 00:08:23 +0000 (17:08 -0700)
Move all the behavior found in child classes of FrameworkEnvironment to the
FrameworkEnvironment itself, allowing easier composibility of behavior. The
original idea was to allow special case behavior for specific test cases but
this resulted in a lot of code duplication and difficulty combining different
framework behavior, such as adding a fake ICD and setting VK_ICD_FILENAMES at
the same time.

tests/framework/test_environment.cpp
tests/framework/test_environment.h
tests/loader_alloc_callback_tests.cpp
tests/loader_get_proc_addr_tests.cpp
tests/loader_handle_validation_tests.cpp
tests/loader_layer_tests.cpp
tests/loader_regression_tests.cpp
tests/loader_threading_tests.cpp
tests/loader_unknown_ext_tests.cpp
tests/loader_version_tests.cpp
tests/loader_wsi_tests.cpp

index 2f43d9c2b2592a6d4245845b263c1a91e4bb0a43..cccf74368dd1c76a55e0dc894c503e2dce9ee901 100644 (file)
@@ -174,14 +174,35 @@ FrameworkEnvironment::FrameworkEnvironment(DebugMode debug_mode) noexcept
     platform_shim->set_path(ManifestCategory::implicit_layer, implicit_layer_folder.location());
 }
 
-void FrameworkEnvironment::AddICD(TestICDDetails icd_details, const std::string& json_name) noexcept {
-    ManifestICD icd_manifest;
-    icd_manifest.lib_path = fs::fixup_backslashes_in_path(icd_details.icd_path);
-    icd_manifest.api_version = icd_details.api_version;
-    auto driver_loc = icd_folder.write(json_name, icd_manifest);
-    platform_shim->add_manifest(ManifestCategory::icd, driver_loc);
+void FrameworkEnvironment::add_icd(TestICDDetails icd_details) noexcept {
+    size_t cur_icd_index = icds.size();
+    if (!icd_details.is_fake) {
+        fs::path new_driver_name = fs::path(icd_details.icd_path).stem() + "_" + std::to_string(cur_icd_index) +
+                                   fs::path(icd_details.icd_path).extension();
+
+        auto new_driver_location = icd_folder.copy_file(icd_details.icd_path, new_driver_name.str());
+
+        icds.push_back(TestICDHandle(new_driver_location));
+        icds.back().reset_icd();
+        icd_details.icd_path = new_driver_location;
+    }
+    std::string full_json_name = icd_details.json_name + "_" + std::to_string(cur_icd_index) + ".json";
+
+    auto driver_loc = icd_folder.write(full_json_name, ManifestICD{}
+                                                           .set_lib_path(fs::fixup_backslashes_in_path(icd_details.icd_path).str())
+                                                           .set_api_version(icd_details.api_version));
+
+    if (icd_details.use_env_var_icd_filenames) {
+        if (!env_var_vk_icd_filenames.empty()) {
+            env_var_vk_icd_filenames += OS_ENV_VAR_LIST_SEPARATOR;
+        }
+        env_var_vk_icd_filenames += (icd_folder.location() / full_json_name).str();
+        set_env_var("VK_ICD_FILENAMES", env_var_vk_icd_filenames);
+    } else {
+        platform_shim->add_manifest(ManifestCategory::icd, driver_loc);
+    }
 }
-void FrameworkEnvironment::AddImplicitLayer(ManifestLayer layer_manifest, const std::string& json_name) noexcept {
+void FrameworkEnvironment::add_implicit_layer(ManifestLayer layer_manifest, const std::string& json_name) noexcept {
     for (auto& layer : layer_manifest.layers) {
         if (!layer.lib_path.str().empty()) {
             std::string new_layer_name = layer.name + "_" + layer.lib_path.filename().str();
@@ -194,7 +215,7 @@ void FrameworkEnvironment::AddImplicitLayer(ManifestLayer layer_manifest, const
     auto layer_loc = implicit_layer_folder.write(json_name, layer_manifest);
     platform_shim->add_manifest(ManifestCategory::implicit_layer, layer_loc);
 }
-void FrameworkEnvironment::AddExplicitLayer(ManifestLayer layer_manifest, const std::string& json_name) noexcept {
+void FrameworkEnvironment::add_explicit_layer(ManifestLayer layer_manifest, const std::string& json_name) noexcept {
     for (auto& layer : layer_manifest.layers) {
         if (!layer.lib_path.str().empty()) {
             std::string new_layer_name = layer.name + "_" + layer.lib_path.filename().str();
@@ -208,62 +229,9 @@ void FrameworkEnvironment::AddExplicitLayer(ManifestLayer layer_manifest, const
     platform_shim->add_manifest(ManifestCategory::explicit_layer, layer_loc);
 }
 
-EnvVarICDOverrideShim::EnvVarICDOverrideShim(DebugMode debug_mode) noexcept : FrameworkEnvironment(debug_mode) {}
-
-void EnvVarICDOverrideShim::SetEnvOverrideICD(const char* icd_path, const char* manifest_name) noexcept {
-    ManifestICD icd_manifest;
-    icd_manifest.lib_path = icd_path;
-    icd_manifest.api_version = VK_MAKE_VERSION(1, 0, 0);
-
-    icd_folder.write(manifest_name, icd_manifest);
-    set_env_var("VK_ICD_FILENAMES", (icd_folder.location() / manifest_name).str());
-
-    driver_wrapper = LibraryWrapper(fs::path(icd_path));
-
-    reset_icd = driver_wrapper.get_symbol<GetNewTestICDFunc>(RESET_ICD_FUNC_STR);
-}
-
-SingleICDShim::SingleICDShim(TestICDDetails icd_details, DebugMode debug_mode) noexcept : FrameworkEnvironment(debug_mode) {
-    icd_handle = TestICDHandle(icd_details.icd_path);
-    icd_handle.reset_icd();
-
-    AddICD(icd_details, "test_icd.json");
-}
-TestICD& SingleICDShim::get_test_icd() noexcept { return icd_handle.get_test_icd(); }
-TestICD& SingleICDShim::reset_icd() noexcept { return icd_handle.reset_icd(); }
-fs::path SingleICDShim::get_test_icd_path() noexcept { return icd_handle.get_icd_full_path(); }
+TestICD& FrameworkEnvironment::get_test_icd(int index) noexcept { return icds[index].get_test_icd(); }
+TestICD& FrameworkEnvironment::reset_icd(int index) noexcept { return icds[index].reset_icd(); }
+fs::path FrameworkEnvironment::get_test_icd_path(int index) noexcept { return icds[index].get_icd_full_path(); }
 
-MultipleICDShim::MultipleICDShim(std::vector<TestICDDetails> icd_details_vector, DebugMode debug_mode) noexcept
-    : FrameworkEnvironment(debug_mode) {
-    uint32_t i = 0;
-    for (auto& test_icd_detail : icd_details_vector) {
-        fs::path new_driver_name =
-            fs::path(test_icd_detail.icd_path).stem() + "_" + std::to_string(i) + fs::path(test_icd_detail.icd_path).extension();
-
-        auto new_driver_location = icd_folder.copy_file(test_icd_detail.icd_path, new_driver_name.str());
-
-        icds.push_back(TestICDHandle(new_driver_location));
-        icds.back().reset_icd();
-        test_icd_detail.icd_path = new_driver_location.c_str();
-        AddICD(test_icd_detail, std::string("test_icd_") + std::to_string(i) + ".json");
-        i++;
-    }
-}
-TestICD& MultipleICDShim::get_test_icd(int index) noexcept { return icds[index].get_test_icd(); }
-TestICD& MultipleICDShim::reset_icd(int index) noexcept { return icds[index].reset_icd(); }
-fs::path MultipleICDShim::get_test_icd_path(int index) noexcept { return icds[index].get_icd_full_path(); }
-
-FakeBinaryICDShim::FakeBinaryICDShim(TestICDDetails read_icd_details, TestICDDetails fake_icd_details,
-                                     DebugMode debug_mode) noexcept
-    : FrameworkEnvironment(debug_mode) {
-    real_icd = TestICDHandle(read_icd_details.icd_path);
-    real_icd.reset_icd();
-
-    // Must use name that isn't a substring of eachother, otherwise loader removes the other ICD
-    // EX test_icd.json is fully contained in fake_test_icd.json, causing test_icd.json to not be loaded
-    AddICD(fake_icd_details, "test_fake_icd.json");
-    AddICD(read_icd_details, "test_icd.json");
-}
-TestICD& FakeBinaryICDShim::get_test_icd() noexcept { return real_icd.get_test_icd(); }
-TestICD& FakeBinaryICDShim::reset_icd() noexcept { return real_icd.reset_icd(); }
-fs::path FakeBinaryICDShim::get_test_icd_path() noexcept { return real_icd.get_icd_full_path(); }
\ No newline at end of file
+TestLayer& FrameworkEnvironment::get_test_layer(int index) noexcept { return layers[index].get_test_layer(); }
+TestLayer& FrameworkEnvironment::reset_layer(int index) noexcept { return layers[index].reset_layer(); }
\ No newline at end of file
index ed1d703546cf24ec7919c47513491edb37df2a2e..ac1f56484eb24961afa6c1351a19155ddd387047 100644 (file)
@@ -290,24 +290,35 @@ struct TestLayerHandle {
 };
 
 struct TestICDDetails {
-    TestICDDetails(const char* icd_path, uint32_t api_version = VK_MAKE_VERSION(1, 0, 0)) noexcept
+    TestICDDetails(fs::path icd_path, uint32_t api_version = VK_MAKE_VERSION(1, 0, 0)) noexcept
         : icd_path(icd_path), api_version(api_version) {}
-    const char* icd_path = nullptr;
-    uint32_t api_version = VK_MAKE_VERSION(1, 0, 0);
+    BUILDER_VALUE(TestICDDetails, fs::path, icd_path, {});
+    BUILDER_VALUE(TestICDDetails, uint32_t, api_version, VK_MAKE_VERSION(1, 0, 0));
+    BUILDER_VALUE(TestICDDetails, std::string, json_name, "test_icd");
+    BUILDER_VALUE(TestICDDetails, bool, use_env_var_icd_filenames, false);
+    BUILDER_VALUE(TestICDDetails, bool, is_fake, false);
 };
 struct TestLayerDetails {
-    TestLayerDetails(const char* layer_path, uint32_t api_version = VK_MAKE_VERSION(1, 0, 0)) noexcept
+    TestLayerDetails(fs::path layer_path, uint32_t api_version = VK_MAKE_VERSION(1, 0, 0)) noexcept
         : layer_path(layer_path), api_version(api_version) {}
-    const char* layer_path = nullptr;
-    uint32_t api_version = VK_MAKE_VERSION(1, 0, 0);
+    BUILDER_VALUE(TestLayerDetails, fs::path, layer_path, {});
+    BUILDER_VALUE(TestLayerDetails, uint32_t, api_version, VK_MAKE_VERSION(1, 0, 0));
 };
 
 struct FrameworkEnvironment {
     FrameworkEnvironment(DebugMode debug_mode = DebugMode::none) noexcept;
 
-    void AddICD(TestICDDetails icd_details, const std::string& json_name) noexcept;
-    void AddImplicitLayer(ManifestLayer layer_manifest, const std::string& json_name) noexcept;
-    void AddExplicitLayer(ManifestLayer layer_manifest, const std::string& json_name) noexcept;
+    void add_icd(TestICDDetails icd_details) noexcept;
+    void add_implicit_layer(ManifestLayer layer_manifest, const std::string& json_name) noexcept;
+    void add_explicit_layer(ManifestLayer layer_manifest, const std::string& json_name) noexcept;
+
+    TestICD& get_test_icd(int index = 0) noexcept;
+    TestICD& reset_icd(int index = 0) noexcept;
+    fs::path get_test_icd_path(int index = 0) noexcept;
+
+    TestLayer& get_test_layer(int index = 0) noexcept;
+    TestLayer& reset_layer(int index = 0) noexcept;
+    fs::path get_test_layer_path(int index = 0) noexcept;
 
     PlatformShimWrapper platform_shim;
     fs::FolderManager null_folder;
@@ -316,45 +327,9 @@ struct FrameworkEnvironment {
     fs::FolderManager implicit_layer_folder;
     DebugUtilsLogger debug_log;
     VulkanFunctions vulkan_functions;
-};
-
-struct EnvVarICDOverrideShim : public FrameworkEnvironment {
-    EnvVarICDOverrideShim(DebugMode debug_mode = DebugMode::none) noexcept;
-
-    void SetEnvOverrideICD(const char* icd_path, const char* manifest_name) noexcept;
-
-    LibraryWrapper driver_wrapper;
-    GetNewTestICDFunc reset_icd;
-};
-
-struct SingleICDShim : public FrameworkEnvironment {
-    SingleICDShim(TestICDDetails icd_details, DebugMode debug_mode = DebugMode::none) noexcept;
-
-    TestICD& get_test_icd() noexcept;
-    TestICD& reset_icd() noexcept;
-
-    fs::path get_test_icd_path() noexcept;
-
-    TestICDHandle icd_handle;
-};
-
-struct MultipleICDShim : public FrameworkEnvironment {
-    MultipleICDShim(std::vector<TestICDDetails> icd_details_vector, DebugMode debug_mode = DebugMode::none) noexcept;
-
-    TestICD& get_test_icd(int index) noexcept;
-    TestICD& reset_icd(int index) noexcept;
-    fs::path get_test_icd_path(int index) noexcept;
 
     std::vector<TestICDHandle> icds;
-};
+    std::vector<TestLayerHandle> layers;
 
-struct FakeBinaryICDShim : public FrameworkEnvironment {
-    FakeBinaryICDShim(TestICDDetails read_icd_details, TestICDDetails fake_icd_details,
-                      DebugMode debug_mode = DebugMode::none) noexcept;
-
-    TestICD& get_test_icd() noexcept;
-    TestICD& reset_icd() noexcept;
-    fs::path get_test_icd_path() noexcept;
-
-    TestICDHandle real_icd;
-};
\ No newline at end of file
+    std::string env_var_vk_icd_filenames;
+};
index 99bec73a58a4cba5052494a4861fafd27e74f0a0..b2d788341550b2db465939de938b4028f2ebdea7 100644 (file)
@@ -199,11 +199,12 @@ class MemoryTracker {
 class Allocation : public ::testing::Test {
    protected:
     virtual void SetUp() {
-        env = std::unique_ptr<SingleICDShim>(new SingleICDShim(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_MAKE_VERSION(1, 0, 0))));
+        env = std::unique_ptr<FrameworkEnvironment>(new FrameworkEnvironment());
+        env->add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
     }
 
     virtual void TearDown() { env.reset(); }
-    std::unique_ptr<SingleICDShim> env;
+    std::unique_ptr<FrameworkEnvironment> env;
 };
 
 // Test making sure the allocation functions are called to allocate and cleanup everything during
@@ -260,7 +261,7 @@ TEST_F(Allocation, InstanceAndDevice) {
     MemoryTracker tracker;
     auto& driver = env->get_test_icd();
     driver.physical_devices.emplace_back("physical_device_0");
-    driver.physical_devices[0].add_queue_family_properties({VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}});
+    driver.physical_devices[0].add_queue_family_properties({{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, false});
     {
         InstWrapper inst{env->vulkan_functions, tracker.get()};
         inst.CheckCreate();
@@ -305,7 +306,7 @@ TEST_F(Allocation, InstanceButNotDevice) {
     {
         auto& driver = env->get_test_icd();
         driver.physical_devices.emplace_back("physical_device_0");
-        driver.physical_devices[0].add_queue_family_properties({VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}});
+        driver.physical_devices[0].add_queue_family_properties({{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, false});
 
         InstWrapper inst{env->vulkan_functions, tracker.get()};
         inst.CheckCreate();
@@ -351,7 +352,7 @@ TEST_F(Allocation, DeviceButNotInstance) {
     {
         auto& driver = env->get_test_icd();
         driver.physical_devices.emplace_back("physical_device_0");
-        driver.physical_devices[0].add_queue_family_properties({VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}});
+        driver.physical_devices[0].add_queue_family_properties({{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, false});
 
         InstWrapper inst{env->vulkan_functions};
         inst.CheckCreate();
@@ -415,9 +416,9 @@ TEST_F(Allocation, CreateInstanceIntentionalAllocFail) {
 TEST_F(Allocation, CreateDeviceIntentionalAllocFail) {
     auto& driver = env->get_test_icd();
     driver.physical_devices.emplace_back("physical_device_0");
-    driver.physical_devices[0].add_queue_family_properties({VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}});
+    driver.physical_devices[0].add_queue_family_properties({{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, false});
     driver.physical_devices.emplace_back("physical_device_1");
-    driver.physical_devices[1].add_queue_family_properties({VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}});
+    driver.physical_devices[1].add_queue_family_properties({{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, false});
 
     InstWrapper inst{env->vulkan_functions};
     inst.CheckCreate();
@@ -469,7 +470,7 @@ TEST_F(Allocation, CreateDeviceIntentionalAllocFail) {
 TEST_F(Allocation, CreateInstanceDeviceIntentionalAllocFail) {
     auto& driver = env->get_test_icd();
     driver.physical_devices.emplace_back("physical_device_0");
-    driver.physical_devices[0].add_queue_family_properties({VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}});
+    driver.physical_devices[0].add_queue_family_properties({{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, false});
 
     size_t fail_index = 0;
     VkResult result = VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -536,7 +537,9 @@ TEST_F(Allocation, CreateInstanceDeviceIntentionalAllocFail) {
 // to make sure the loader uses the valid ICD and doesn't report incompatible driver just because
 // an incompatible driver exists
 TEST(TryLoadWrongBinaries, CreateInstanceIntentionalAllocFail) {
-    FakeBinaryICDShim env(TestICDDetails(TEST_ICD_PATH_VERSION_2), TestICDDetails(CURRENT_PLATFORM_DUMMY_BINARY));
+    FrameworkEnvironment env{};
+    env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+    env.add_icd(TestICDDetails(CURRENT_PLATFORM_DUMMY_BINARY).set_is_fake(true));
     size_t fail_index = 0;
     VkResult result = VK_ERROR_OUT_OF_HOST_MEMORY;
     while (result == VK_ERROR_OUT_OF_HOST_MEMORY && fail_index <= 10000) {
@@ -568,7 +571,7 @@ TEST_F(Allocation, EnumeratePhysicalDevicesIntentionalAllocFail) {
 
         for (uint32_t i = 0; i < physical_dev_count; i++) {
             driver.physical_devices.emplace_back(std::string("physical_device_") + std::to_string(i));
-            driver.physical_devices[i].add_queue_family_properties({VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}});
+            driver.physical_devices[i].add_queue_family_properties({{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, false});
         }
         MemoryTracker tracker{MemoryTrackerSettings{false, 0, true, fail_index}};
         InstanceCreateInfo inst_create_info;
index a8d83aebfe70a6bf7a6fb6749ffc80bc23dedd64..dc2ce16bbce30257015e3db09fa54cd41a37cae3 100644 (file)
@@ -30,7 +30,8 @@
 // Load the global function pointers with and without a NULL vkInstance handle.
 // Call the function to make sure it is callable, don't care about what is returned.
 TEST(GetProcAddr, GlobalFunctions) {
-    SingleICDShim env(TestICDDetails(TEST_ICD_PATH_VERSION_6));
+    FrameworkEnvironment env{};
+    env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_6));
     env.get_test_icd().physical_devices.emplace_back("physical_device_0");
 
     auto& gipa = env.vulkan_functions.vkGetInstanceProcAddr;
index a7ba57a7ac73f17aad3930cbfef56964bf214a9a..352987836a517a8a5157e8dd6b951a3a125f5148 100644 (file)
 
 class LoaderHandleValidTests : public ::testing::Test {
    protected:
-    virtual void SetUp() { env = std::unique_ptr<SingleICDShim>(new SingleICDShim(TEST_ICD_PATH_VERSION_2)); }
-
+    virtual void SetUp() {
+        env = std::unique_ptr<FrameworkEnvironment>(new FrameworkEnvironment());
+        env->add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+    }
     virtual void TearDown() { env.reset(); }
-    std::unique_ptr<SingleICDShim> env;
+    std::unique_ptr<FrameworkEnvironment> env;
 };
 
 // ---- Invalid Instance tests
@@ -91,7 +93,7 @@ TEST_F(LoaderHandleValidTests, BadInstDestroySurface) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_headless_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -111,7 +113,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateHeadlessSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_headless_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -136,7 +138,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateDisplayPlaneSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -163,7 +165,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateAndroidSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_android_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -190,7 +192,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateDirectFBSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_directfb_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -217,7 +219,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateFuchsiaSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_FUCHSIA_imagepipe_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -245,7 +247,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateGGPSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_GGP_stream_descriptor_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -273,7 +275,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateIOSSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_MVK_ios_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -300,7 +302,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateMacOSSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_MVK_macos_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -327,7 +329,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateMetalSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_metal_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -354,7 +356,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateQNXSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_QNX_screen_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -381,7 +383,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateViNNSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_NN_vi_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -408,7 +410,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateWaylandSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_wayland_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -435,7 +437,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateWin32Surf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_win32_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -462,7 +464,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateXCBSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_xcb_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -489,7 +491,7 @@ TEST_F(LoaderHandleValidTests, BadInstCreateXlibSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_xlib_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -906,7 +908,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevSurfaceSupportKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_headless_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -927,7 +929,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevSurfaceCapsKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_headless_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -947,7 +949,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevSurfaceFormatsKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_headless_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -967,7 +969,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevSurfacePresentModesKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_headless_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -989,7 +991,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetDirectFBPresentSupportKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_directfb_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1012,7 +1014,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetQNXPresentSupportKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_QNX_screen_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1034,7 +1036,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevWaylandPresentSupportKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_wayland_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1056,7 +1058,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevWin32PresentSupportKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_win32_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1078,7 +1080,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetXCBPresentSupportKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_xcb_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1102,7 +1104,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetXlibPresentSupportKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_xlib_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1125,7 +1127,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevDisplayPropsKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1146,7 +1148,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevDisplayPlanePropsKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1167,7 +1169,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetDisplayPlaneSupportedDisplaysKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1188,7 +1190,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetDisplayModePropsKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1209,7 +1211,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevCreateDisplayModeKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1234,7 +1236,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetDisplayPlaneCapsKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1255,7 +1257,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevPresentRectsKHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1277,7 +1279,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevDisplayProps2KHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_get_display_properties2"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1298,7 +1300,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevDisplayPlaneProps2KHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_get_display_properties2"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1319,7 +1321,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetDisplayModeProps2KHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_get_display_properties2"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1340,7 +1342,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetDisplayPlaneCaps2KHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_get_display_properties2"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1364,7 +1366,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevSurfaceCaps2KHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_get_surface_capabilities2"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1389,7 +1391,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetPhysDevSurfaceFormats2KHR) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_get_surface_capabilities2"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1495,7 +1497,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevAcquireDrmDisplayEXT) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_acquire_drm_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1517,7 +1519,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetDrmDisplayEXT) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_acquire_drm_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1539,7 +1541,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevReleaseDisplayEXT) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_direct_mode_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1562,7 +1564,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevAcquireXlibDisplayEXT) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_acquire_xlib_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1584,7 +1586,7 @@ TEST_F(LoaderHandleValidTests, BadPhysDevGetRandROutputDisplayEXT) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_acquire_xlib_display"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
     driver.physical_devices.emplace_back("physical_device_0");
 
     InstWrapper instance(env->vulkan_functions);
@@ -1653,7 +1655,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingAndroidSurface) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_android_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -1694,7 +1696,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingDirectFBSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_directfb_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -1735,7 +1737,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingFuchsiaSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_FUCHSIA_imagepipe_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -1776,7 +1778,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingGGPSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_GGP_stream_descriptor_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -1817,7 +1819,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingIOSSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_MVK_ios_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -1858,7 +1860,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingMacOSSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_MVK_macos_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -1899,7 +1901,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingMetalSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_EXT_metal_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -1940,7 +1942,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingQNXSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_QNX_screen_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -1981,7 +1983,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingViNNSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_NN_vi_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -2022,7 +2024,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingWaylandSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_wayland_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -2063,7 +2065,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingWin32Surf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_win32_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -2072,7 +2074,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingWin32Surf) {
 
     ManifestLayer wrap_objects_layer;
     wrap_objects_layer.layers.push_back(wrap_objects_description);
-    env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+    env->add_explicit_layer(wrap_objects_layer, "wrap_objects_layer.json");
 
     driver.physical_devices.emplace_back("physical_device_0");
     MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
@@ -2104,7 +2106,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingXCBSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_xcb_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -2145,7 +2147,7 @@ TEST_F(LoaderHandleValidTests, VerifyHandleWrappingXlibSurf) {
     Extension first_ext{"VK_KHR_surface"};
     Extension second_ext{"VK_KHR_xlib_surface"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({first_ext, second_ext});
+    driver.add_instance_extensions({first_ext, second_ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
@@ -2192,11 +2194,11 @@ static VkBool32 JunkDebugUtilsCallback(VkDebugUtilsMessageSeverityFlagBitsEXT me
     return VK_FALSE;
 }
 
-#if 0 // Disable for now to get this commit in
+#if 0  // Disable for now to get this commit in
 TEST_F(LoaderHandleValidTests, VerifyHandleWrappingDebugUtilsMessenger) {
     Extension ext{"VK_EXT_debug_utils"};
     auto& driver = env->get_test_icd();
-    driver.AddInstanceExtensions({ext});
+    driver.add_instance_extensions({ext});
 
     const char* wrap_objects_name = "WrapObjectsLayer";
     ManifestLayer::LayerDescription wrap_objects_description{};
index 9629e2de2d40e3227be6488c4852e812677c0499..3cb080e4447f0d05f2c6aa156f584c3760660390 100644 (file)
 class LayerTests : public ::testing::Test {
    protected:
     virtual void SetUp() {
-        env = std::unique_ptr<SingleICDShim>(new SingleICDShim(TestICDDetails(TEST_ICD_PATH_VERSION_6, VK_MAKE_VERSION(1, 0, 0))));
+        env = std::unique_ptr<FrameworkEnvironment>(new FrameworkEnvironment());
+        env->add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_6));
     }
 
     virtual void TearDown() { env.reset(); }
-    std::unique_ptr<SingleICDShim> env;
+    std::unique_ptr<FrameworkEnvironment> env;
 };
 
 // Subtyping for organization
@@ -44,7 +45,7 @@ class MetaLayers : public LayerTests {};
 class OverrideMetaLayer : public LayerTests {};
 class LayerCreateInstance : public LayerTests {};
 
-void CheckLogForLayerString(SingleICDShim& env, const char* implicit_layer_name, bool check_for_enable) {
+void CheckLogForLayerString(FrameworkEnvironment& env, const char* implicit_layer_name, bool check_for_enable) {
     {
         InstWrapper inst{env.vulkan_functions};
         FillDebugUtilsCreateDetails(inst.create_info, env.debug_log);
@@ -71,7 +72,7 @@ TEST_F(ImplicitLayers, WithEnableAndDisableEnvVar) {
 
     ManifestLayer implicit_layer;
     implicit_layer.layers.push_back(description);
-    env->AddImplicitLayer(implicit_layer, "implicit_test_layer.json");
+    env->add_implicit_layer(implicit_layer, "implicit_test_layer.json");
 
     uint32_t count = 0;
     ASSERT_EQ(VK_SUCCESS, env->vulkan_functions.vkEnumerateInstanceLayerProperties(&count, nullptr));
@@ -118,7 +119,7 @@ TEST_F(ImplicitLayers, OnlyDisableEnvVar) {
 
     ManifestLayer implicit_layer;
     implicit_layer.layers.push_back(description);
-    env->AddImplicitLayer(implicit_layer, "implicit_test_layer.json");
+    env->add_implicit_layer(implicit_layer, "implicit_test_layer.json");
 
     uint32_t count = 0;
     ASSERT_EQ(VK_SUCCESS, env->vulkan_functions.vkEnumerateInstanceLayerProperties(&count, nullptr));
@@ -157,7 +158,7 @@ TEST_F(MetaLayers, InvalidComponentLayer) {
     ManifestLayer meta_layer;
     meta_layer.file_format_version = ManifestVersion(1, 1, 2);
     meta_layer.layers.push_back(description);
-    env->AddImplicitLayer(meta_layer, "meta_test_layer.json");
+    env->add_implicit_layer(meta_layer, "meta_test_layer.json");
 
     const char* regular_layer_name = "TestLayer";
     ManifestLayer::LayerDescription regular_description{};
@@ -166,7 +167,7 @@ TEST_F(MetaLayers, InvalidComponentLayer) {
 
     ManifestLayer regular_layer;
     regular_layer.layers.push_back(regular_description);
-    env->AddExplicitLayer(regular_layer, "regular_test_layer.json");
+    env->add_explicit_layer(regular_layer, "regular_test_layer.json");
 
     // should find 1, the 'regular' layer
     uint32_t layer_count = 1;
@@ -202,7 +203,7 @@ TEST_F(OverrideMetaLayer, InvalidDisableEnvironment) {
 
     ManifestLayer regular_layer;
     regular_layer.layers.push_back(regular_description);
-    env->AddExplicitLayer(regular_layer, "regular_test_layer.json");
+    env->add_explicit_layer(regular_layer, "regular_test_layer.json");
 
     const char* lunarg_meta_layer_name = "VK_LAYER_LUNARG_override";
     ManifestLayer::LayerDescription description{};
@@ -214,7 +215,7 @@ TEST_F(OverrideMetaLayer, InvalidDisableEnvironment) {
     ManifestLayer lunarg_meta_layer;
     lunarg_meta_layer.file_format_version = ManifestVersion(1, 1, 2);
     lunarg_meta_layer.layers.push_back(description);
-    env->AddImplicitLayer(lunarg_meta_layer, "meta_test_layer.json");
+    env->add_implicit_layer(lunarg_meta_layer, "meta_test_layer.json");
 
     // should find 1, the 'regular' layer
     uint32_t layer_count = 2;
@@ -254,7 +255,7 @@ TEST_F(LayerCreateInstance, GetPhysicalDeviceProperties2) {
     ManifestLayer regular_layer;
     regular_layer.file_format_version = ManifestVersion(1, 1, 2);
     regular_layer.layers.push_back(regular_description);
-    env->AddExplicitLayer(regular_layer, "regular_test_layer.json");
+    env->add_explicit_layer(regular_layer, "regular_test_layer.json");
 
     TestLayerHandle layer_handle{regular_description.lib_path};
     auto& layer = layer_handle.get_test_layer();
@@ -288,7 +289,7 @@ TEST_F(LayerCreateInstance, GetPhysicalDeviceProperties2) {
 
 TEST_F(LayerCreateInstance, GetPhysicalDeviceProperties2KHR) {
     env->get_test_icd().physical_devices.push_back({});
-    env->get_test_icd().AddInstanceExtension({"VK_KHR_get_physical_device_properties2", 0});
+    env->get_test_icd().add_instance_extension({"VK_KHR_get_physical_device_properties2", 0});
     const char* regular_layer_name = "TestLayer";
     ManifestLayer::LayerDescription regular_description{};
     regular_description.name = regular_layer_name;
@@ -296,7 +297,7 @@ TEST_F(LayerCreateInstance, GetPhysicalDeviceProperties2KHR) {
 
     ManifestLayer regular_layer;
     regular_layer.layers.push_back(regular_description);
-    env->AddExplicitLayer(regular_layer, "regular_test_layer.json");
+    env->add_explicit_layer(regular_layer, "regular_test_layer.json");
 
     TestLayerHandle layer_handle{regular_description.lib_path};
     auto& layer = layer_handle.reset_layer();
@@ -332,7 +333,7 @@ TEST_F(ExplicitLayers, WrapObjects) {
 
     ManifestLayer wrap_objects_layer;
     wrap_objects_layer.layers.push_back(wrap_objects_description);
-    env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+    env->add_explicit_layer(wrap_objects_layer, "wrap_objects_layer.json");
 
     const char* regular_layer_name_1 = "RegularLayer1";
     ManifestLayer::LayerDescription regular_description_1{};
@@ -341,7 +342,7 @@ TEST_F(ExplicitLayers, WrapObjects) {
 
     ManifestLayer regular_layer_1;
     regular_layer_1.layers.push_back(regular_description_1);
-    env->AddExplicitLayer(regular_layer_1, "regular_layer_1.json");
+    env->add_explicit_layer(regular_layer_1, "regular_layer_1.json");
 
     const char* regular_layer_name_2 = "RegularLayer2";
     ManifestLayer::LayerDescription regular_description_2{};
@@ -350,7 +351,7 @@ TEST_F(ExplicitLayers, WrapObjects) {
 
     ManifestLayer regular_layer_2;
     regular_layer_2.layers.push_back(regular_description_2);
-    env->AddExplicitLayer(regular_layer_2, "regular_layer_2.json");
+    env->add_explicit_layer(regular_layer_2, "regular_layer_2.json");
 
     MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
 
index 8ccd548526c7e1e06f9c676df17b95e3773e5963..5718ed92c7fcb7d40a2c77571cd5ce35d5d49098 100644 (file)
 class RegressionTests : public ::testing::Test {
    protected:
     virtual void SetUp() {
-        env = std::unique_ptr<SingleICDShim>(new SingleICDShim(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_MAKE_VERSION(1, 0, 0))));
+        env = std::unique_ptr<FrameworkEnvironment>(new FrameworkEnvironment());
+        env->add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
     }
 
     virtual void TearDown() { env.reset(); }
-    std::unique_ptr<SingleICDShim> env;
+    std::unique_ptr<FrameworkEnvironment> env;
 };
 
 // Subtyping for organization
@@ -58,7 +59,7 @@ class WrapObjects : public RegressionTests {};
 
 TEST_F(CreateInstance, BasicRun) {
     auto& driver = env->get_test_icd();
-    driver.SetMinICDInterfaceVersion(5);
+    driver.set_min_icd_interface_version(5);
 
     InstWrapper inst{env->vulkan_functions};
     inst.CheckCreate();
@@ -107,7 +108,7 @@ TEST_F(CreateInstance, LayerPresent) {
 
     ManifestLayer layer;
     layer.layers.push_back(description);
-    env->AddExplicitLayer(layer, "test_layer.json");
+    env->add_explicit_layer(layer, "test_layer.json");
 
     InstWrapper inst{env->vulkan_functions};
     inst.create_info.add_layer(layer_name);
@@ -130,7 +131,7 @@ TEST_F(EnumerateInstanceLayerProperties, UsageChecks) {
 
     ManifestLayer layer1;
     layer1.layers.push_back(description1);
-    env->AddExplicitLayer(layer1, "test_layer_1.json");
+    env->add_explicit_layer(layer1, "test_layer_1.json");
 
     ManifestLayer::LayerDescription description2{};
     description2.name = layer_name_1;
@@ -138,7 +139,7 @@ TEST_F(EnumerateInstanceLayerProperties, UsageChecks) {
 
     ManifestLayer layer2;
     layer2.layers.push_back(description2);
-    env->AddExplicitLayer(layer2, "test_layer_2.json");
+    env->add_explicit_layer(layer2, "test_layer_2.json");
 
     {  // OnePass
         VkLayerProperties layer_props[2] = {};
@@ -170,7 +171,7 @@ TEST_F(EnumerateInstanceLayerProperties, UsageChecks) {
 TEST_F(EnumerateInstanceExtensionProperties, UsageChecks) {
     Extension first_ext{"VK_EXT_validation_features"};  // known instance extensions
     Extension second_ext{"VK_EXT_headless_surface"};
-    env->reset_icd().AddInstanceExtensions({first_ext, second_ext});
+    env->reset_icd().add_instance_extensions({first_ext, second_ext});
 
     {  // One Pass
         uint32_t extension_count = 4;
@@ -232,7 +233,7 @@ TEST_F(EnumerateInstanceExtensionProperties, PropertyCountLessThanAvailable) {
 TEST_F(EnumerateInstanceExtensionProperties, FilterUnkownInstanceExtensions) {
     Extension first_ext{"FirstTestExtension"};  // unknown instance extensions
     Extension second_ext{"SecondTestExtension"};
-    env->reset_icd().AddInstanceExtensions({first_ext, second_ext});
+    env->reset_icd().add_instance_extensions({first_ext, second_ext});
     {
         uint32_t extension_count = 0;
         ASSERT_EQ(VK_SUCCESS, env->vulkan_functions.vkEnumerateInstanceExtensionProperties("", &extension_count, nullptr));
@@ -277,7 +278,7 @@ TEST_F(EnumerateDeviceLayerProperties, LayersMatch) {
 
     ManifestLayer layer;
     layer.layers.push_back(description);
-    env->AddExplicitLayer(layer, "test_layer.json");
+    env->add_explicit_layer(layer, "test_layer.json");
 
     InstWrapper inst{env->vulkan_functions};
     inst.create_info.add_layer(layer_name);
@@ -358,7 +359,7 @@ TEST_F(EnumerateDeviceExtensionProperties, PropertyCountLessThanAvailable) {
 }
 
 TEST_F(EnumeratePhysicalDevices, OneCall) {
-    auto& driver = env->get_test_icd().SetMinICDInterfaceVersion(5);
+    auto& driver = env->get_test_icd().set_min_icd_interface_version(5);
 
     driver.physical_devices.emplace_back("physical_device_0");
     driver.physical_devices.emplace_back("physical_device_1");
@@ -376,7 +377,7 @@ TEST_F(EnumeratePhysicalDevices, OneCall) {
 }
 
 TEST_F(EnumeratePhysicalDevices, TwoCall) {
-    auto& driver = env->get_test_icd().SetMinICDInterfaceVersion(5);
+    auto& driver = env->get_test_icd().set_min_icd_interface_version(5);
 
     const uint32_t real_device_count = 2;
     for (size_t i = 0; i < real_device_count; i++) {
@@ -399,7 +400,7 @@ TEST_F(EnumeratePhysicalDevices, TwoCall) {
 
 TEST_F(EnumeratePhysicalDevices, MatchOneAndTwoCallNumbers) {
     auto& driver = env->get_test_icd();
-    driver.SetMinICDInterfaceVersion(5);
+    driver.set_min_icd_interface_version(5);
 
     const uint32_t real_device_count = 3;
     for (size_t i = 0; i < real_device_count; i++) {
@@ -431,7 +432,7 @@ TEST_F(EnumeratePhysicalDevices, MatchOneAndTwoCallNumbers) {
 }
 
 TEST_F(EnumeratePhysicalDevices, TwoCallIncomplete) {
-    auto& driver = env->get_test_icd().SetMinICDInterfaceVersion(5);
+    auto& driver = env->get_test_icd().set_min_icd_interface_version(5);
 
     const uint32_t real_device_count = 2;
     for (size_t i = 0; i < real_device_count; i++) {
@@ -455,7 +456,7 @@ TEST_F(EnumeratePhysicalDevices, TwoCallIncomplete) {
 }
 
 TEST_F(EnumeratePhysicalDevices, ZeroPhysicalDevicesAfterCreateInstance) {
-    auto& driver = env->get_test_icd().SetMinICDInterfaceVersion(5);
+    auto& driver = env->get_test_icd().set_min_icd_interface_version(5);
     InstWrapper inst{env->vulkan_functions};
     inst.create_info.set_api_version(VK_MAKE_API_VERSION(0, 1, 1, 0));
     inst.CheckCreate();
@@ -536,7 +537,9 @@ TEST_F(CreateDevice, LayersNotPresent) {
 }
 
 TEST(TryLoadWrongBinaries, WrongICD) {
-    FakeBinaryICDShim env(TestICDDetails(TEST_ICD_PATH_VERSION_2), TestICDDetails(CURRENT_PLATFORM_DUMMY_BINARY));
+    FrameworkEnvironment env{};
+    env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+    env.add_icd(TestICDDetails(CURRENT_PLATFORM_DUMMY_BINARY).set_is_fake(true));
     env.get_test_icd().physical_devices.emplace_back("physical_device_0");
 
     DebugUtilsLogger log{VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT};
@@ -561,7 +564,8 @@ TEST(TryLoadWrongBinaries, WrongICD) {
 }
 
 TEST(TryLoadWrongBinaries, WrongExplicitAndImplicit) {
-    SingleICDShim env(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+    FrameworkEnvironment env{};
+    env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
     env.get_test_icd().physical_devices.emplace_back("physical_device_0");
 
     const char* layer_name_0 = "DummyLayerExplicit";
@@ -610,7 +614,7 @@ TEST(TryLoadWrongBinaries, WrongExplicitAndImplicit) {
 }
 
 TEST_F(EnumeratePhysicalDeviceGroups, OneCall) {
-    auto& driver = env->get_test_icd().SetMinICDInterfaceVersion(5);
+    auto& driver = env->get_test_icd().set_min_icd_interface_version(5);
     // ICD contains 2 devices
     driver.physical_devices.emplace_back("PhysicalDevice0");
     driver.physical_devices.emplace_back("PhysicalDevice1");
@@ -641,7 +645,7 @@ TEST_F(EnumeratePhysicalDeviceGroups, OneCall) {
         handle_assert_equal(group_props.physicalDevices[0], physical_devices[0]);
         handle_assert_equal(group_props.physicalDevices[1], physical_devices[1]);
     }
-    driver.AddInstanceExtension({"VK_KHR_device_group_creation"});
+    driver.add_instance_extension({"VK_KHR_device_group_creation"});
     // Extension
     {
         InstWrapper inst{env->vulkan_functions};
@@ -668,7 +672,7 @@ TEST_F(EnumeratePhysicalDeviceGroups, OneCall) {
 }
 
 TEST_F(EnumeratePhysicalDeviceGroups, TwoCall) {
-    auto& driver = env->get_test_icd().SetMinICDInterfaceVersion(5);
+    auto& driver = env->get_test_icd().set_min_icd_interface_version(5);
     // ICD contains 2 devices
     driver.physical_devices.emplace_back("PhysicalDevice0");
     driver.physical_devices.emplace_back("PhysicalDevice1");
@@ -702,7 +706,7 @@ TEST_F(EnumeratePhysicalDeviceGroups, TwoCall) {
         handle_assert_equal(group_props.physicalDevices[0], physical_devices[0]);
         handle_assert_equal(group_props.physicalDevices[1], physical_devices[1]);
     }
-    driver.AddInstanceExtension({"VK_KHR_device_group_creation"});
+    driver.add_instance_extension({"VK_KHR_device_group_creation"});
     // Extension
     {
         InstWrapper inst{env->vulkan_functions};
@@ -732,7 +736,7 @@ TEST_F(EnumeratePhysicalDeviceGroups, TwoCall) {
 }
 
 TEST_F(EnumeratePhysicalDeviceGroups, TwoCallIncomplete) {
-    auto& driver = env->get_test_icd().SetMinICDInterfaceVersion(5);
+    auto& driver = env->get_test_icd().set_min_icd_interface_version(5);
     // ICD contains 2 devices
     driver.physical_devices.emplace_back("PhysicalDevice0");
     driver.physical_devices.emplace_back("PhysicalDevice1");
@@ -760,7 +764,7 @@ TEST_F(EnumeratePhysicalDeviceGroups, TwoCallIncomplete) {
         ASSERT_EQ(0, returned_group_count);
         handle_assert_no_values(returned_group_count, group_props.physicalDevices);
     }
-    driver.AddInstanceExtension({"VK_KHR_device_group_creation"});
+    driver.add_instance_extension({"VK_KHR_device_group_creation"});
     // Extension
     {
         InstWrapper inst{env->vulkan_functions};
@@ -877,7 +881,8 @@ TEST(ExtensionManual, ToolingProperties) {
                                                      "This tool does not exist",
                                                      "No-Layer"};
     {  // No support in driver
-        SingleICDShim env{TestICDDetails{TEST_ICD_PATH_VERSION_6}};
+        FrameworkEnvironment env{};
+        env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_6));
         env.get_test_icd().physical_devices.push_back({});
 
         InstWrapper inst{env.vulkan_functions};
@@ -894,7 +899,8 @@ TEST(ExtensionManual, ToolingProperties) {
         ASSERT_EQ(tool_count, 0);
     }
     {  // extension is supported in driver
-        SingleICDShim env{TestICDDetails{TEST_ICD_PATH_VERSION_6}};
+        FrameworkEnvironment env{};
+        env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_6));
         env.get_test_icd().physical_devices.push_back({});
         env.get_test_icd().supports_tooling_info_ext = true;
         env.get_test_icd().tooling_properties.push_back(icd_tool_props);
index 68e25aa80b6df0374a7f90390572e0c4cce38945..75619b497ebbba557767a5585795faa3583e6dc8 100644 (file)
 class ThreadingTests : public ::testing::Test {
    protected:
     virtual void SetUp() {
-        env = std::unique_ptr<SingleICDShim>(new SingleICDShim(TestICDDetails(TEST_ICD_PATH_VERSION_2, VK_MAKE_VERSION(1, 0, 0))));
+        env = std::unique_ptr<FrameworkEnvironment>(new FrameworkEnvironment());
+        env->add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_6));
     }
 
     virtual void TearDown() { env.reset(); }
-    std::unique_ptr<SingleICDShim> env;
+    std::unique_ptr<FrameworkEnvironment> env;
 };
 
 void create_destroy_device_loop(uint32_t num_loops_create_destroy_device, uint32_t num_loops_try_get_proc_addr, InstWrapper* inst,
index 202eb0e4c15145d79f3d37d175ce4d3b77546797..2c7f2b34e8859d631d7318f00d074ec28f3b2eea 100644 (file)
 class UnknownExtension : public ::testing::Test {
    protected:
     virtual void SetUp() {
-        env = std::unique_ptr<SingleICDShim>(
-            new SingleICDShim(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA, VK_MAKE_VERSION(1, 0, 0))));
+        env = std::unique_ptr<FrameworkEnvironment>(new FrameworkEnvironment());
+        env->add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
     }
 
     virtual void TearDown() { env.reset(); }
-    std::unique_ptr<SingleICDShim> env;
+    std::unique_ptr<FrameworkEnvironment> env;
 };
 
 /*
index 286ad610ffd5f089c2c1b1c4047ff38685cfdc60..4214e1228aab68beb9aac80e6b930ee1be726f14 100644 (file)
 
 class EnvVarICDOverrideSetup : public ::testing::Test {
    protected:
-    virtual void SetUp() { env = std::unique_ptr<EnvVarICDOverrideShim>(new EnvVarICDOverrideShim()); }
+    virtual void SetUp() { env = std::unique_ptr<FrameworkEnvironment>(new FrameworkEnvironment()); }
 
     virtual void TearDown() {
         remove_env_var("VK_ICD_FILENAMES");
         env.reset();
     }
-    std::unique_ptr<EnvVarICDOverrideShim> env;
+    std::unique_ptr<FrameworkEnvironment> env;
 };
 
 // Don't support vk_icdNegotiateLoaderICDInterfaceVersion
@@ -43,31 +43,32 @@ class EnvVarICDOverrideSetup : public ::testing::Test {
 // does not support vk_icdGetInstanceProcAddr
 // must export vkGetInstanceProcAddr, vkCreateInstance, vkEnumerateInstanceExtensionProperties
 TEST_F(EnvVarICDOverrideSetup, version_0_none) {
-    env->SetEnvOverrideICD(TEST_ICD_PATH_EXPORT_NONE, "test_icd_export_none.json");
-    auto* driver = env->reset_icd();
+    env->add_icd(TestICDDetails(TEST_ICD_PATH_EXPORT_NONE).set_use_env_var_icd_filenames(true));
+    auto& driver = env->reset_icd();
 
     InstWrapper inst{env->vulkan_functions};
     inst.CheckCreate();
 
-    ASSERT_EQ(driver->called_vk_icd_gipa, CalledICDGIPA::vk_gipa);
+    ASSERT_EQ(driver.called_vk_icd_gipa, CalledICDGIPA::vk_gipa);
 }
 
 // Don't support vk_icdNegotiateLoaderICDInterfaceVersion
 // the loader calls vk_icdGetInstanceProcAddr first
 TEST_F(EnvVarICDOverrideSetup, version_1_icd_gipa) {
-    env->SetEnvOverrideICD(TEST_ICD_PATH_EXPORT_ICD_GIPA, "test_icd_export_icd_gipa.json");
-    auto* driver = env->reset_icd();
+    env->add_icd(TestICDDetails(TEST_ICD_PATH_EXPORT_ICD_GIPA).set_use_env_var_icd_filenames(true));
+    auto& driver = env->reset_icd();
 
     InstWrapper inst{env->vulkan_functions};
     inst.CheckCreate();
 
-    ASSERT_EQ(driver->called_vk_icd_gipa, CalledICDGIPA::vk_icd_gipa);
+    ASSERT_EQ(driver.called_vk_icd_gipa, CalledICDGIPA::vk_icd_gipa);
 }
 
 // support vk_icdNegotiateLoaderICDInterfaceVersion but not vk_icdGetInstanceProcAddr
 // should assert that `interface_vers == 0` due to version mismatch, only checkable in Debug Mode
 TEST_F(EnvVarICDOverrideSetup, version_negotiate_interface_version_death_test) {
-    env->SetEnvOverrideICD(TEST_ICD_PATH_EXPORT_NEGOTIATE_INTERFACE_VERSION, "test_icd_export_negotiate_interface_version.json");
+    env->add_icd(TestICDDetails(TEST_ICD_PATH_EXPORT_NEGOTIATE_INTERFACE_VERSION).set_use_env_var_icd_filenames(true));
+    auto& driver = env->reset_icd();
 
     InstWrapper inst{env->vulkan_functions};
 
@@ -84,21 +85,23 @@ TEST_F(EnvVarICDOverrideSetup, version_negotiate_interface_version_death_test) {
 
 // export vk_icdNegotiateLoaderICDInterfaceVersion and vk_icdGetInstanceProcAddr
 TEST_F(EnvVarICDOverrideSetup, version_2_negotiate_interface_version_and_icd_gipa) {
-    env->SetEnvOverrideICD(TEST_ICD_PATH_VERSION_2, "test_icd_version_2.json");
-    auto* driver = env->reset_icd();
+    env->add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2).set_use_env_var_icd_filenames(true));
+    auto& driver = env->reset_icd();
 
     InstWrapper inst{env->vulkan_functions};
     inst.CheckCreate();
 
-    ASSERT_EQ(driver->called_vk_icd_gipa, CalledICDGIPA::vk_icd_gipa);
+    ASSERT_EQ(driver.called_vk_icd_gipa, CalledICDGIPA::vk_icd_gipa);
 }
 
 class ICDInterfaceVersion2Plus : public ::testing::Test {
    protected:
-    virtual void SetUp() { env = std::unique_ptr<SingleICDShim>(new SingleICDShim(TEST_ICD_PATH_VERSION_2)); }
-
+    virtual void SetUp() {
+        env = std::unique_ptr<FrameworkEnvironment>(new FrameworkEnvironment());
+        env->add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+    }
     virtual void TearDown() { env.reset(); }
-    std::unique_ptr<SingleICDShim> env;
+    std::unique_ptr<FrameworkEnvironment> env;
 };
 
 TEST_F(ICDInterfaceVersion2Plus, vk_icdNegotiateLoaderICDInterfaceVersion) {
@@ -172,12 +175,12 @@ TEST_F(ICDInterfaceVersion2Plus, l5_icd5) {
 class ICDInterfaceVersion2PlusEnumerateAdapterPhysicalDevices : public ::testing::Test {
    protected:
     virtual void SetUp() {
-        env = std::unique_ptr<SingleICDShim>(
-            new SingleICDShim(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_ENUMERATE_ADAPTER_PHYSICAL_DEVICES));
+        env = std::unique_ptr<FrameworkEnvironment>(new FrameworkEnvironment());
+        env->add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_ENUMERATE_ADAPTER_PHYSICAL_DEVICES));
     }
 
     virtual void TearDown() { env.reset(); }
-    std::unique_ptr<SingleICDShim> env;
+    std::unique_ptr<FrameworkEnvironment> env;
 };
 
 // Need more work to shim dxgi for this test to work
@@ -265,9 +268,10 @@ TEST_F(ICDInterfaceVersion2PlusEnumerateAdapterPhysicalDevices, EnumAdapters2) {
 #endif  // defined(WIN32)
 
 TEST(MultipleICDConfig, Basic) {
-    MultipleICDShim env(
-        {TestICDDetails(TEST_ICD_PATH_VERSION_2), TestICDDetails(TEST_ICD_PATH_VERSION_2), TestICDDetails(TEST_ICD_PATH_VERSION_2)},
-        DebugMode::none);
+    FrameworkEnvironment env{};
+    env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+    env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+    env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
 
     env.get_test_icd(0).physical_devices.emplace_back("physical_device_0");
     env.get_test_icd(1).physical_devices.emplace_back("physical_device_1");
@@ -294,9 +298,10 @@ TEST(MultipleICDConfig, Basic) {
 }
 
 TEST(MultipleDriverConfig, DifferentICDInterfaceVersions) {
-    MultipleICDShim env({TestICDDetails(TEST_ICD_PATH_EXPORT_ICD_GIPA), TestICDDetails(TEST_ICD_PATH_VERSION_2),
-                         TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA)},
-                        DebugMode::none);
+    FrameworkEnvironment env{};
+    env.add_icd(TestICDDetails(TEST_ICD_PATH_EXPORT_ICD_GIPA));
+    env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));
+    env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2_EXPORT_ICD_GPDPA));
 
     TestICD& icd0 = env.get_test_icd(0);
     icd0.physical_devices.emplace_back("physical_device_0");
index 686b65e5bab5cc84a81e78c08a2939d1d6dc146e..9e9acc906cbbddd005e457bb745f89ffae2d6b10 100644 (file)
 
 class RegressionTests : public ::testing::Test {
    protected:
-    virtual void SetUp() { env = std::unique_ptr<SingleICDShim>(new SingleICDShim(TestICDDetails(TEST_ICD_PATH_VERSION_2))); }
-
+    virtual void SetUp() {
+        env = std::unique_ptr<FrameworkEnvironment>(new FrameworkEnvironment());
+        env->add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_6));
+    }
     virtual void TearDown() { env.reset(); }
-    std::unique_ptr<SingleICDShim> env;
+    std::unique_ptr<FrameworkEnvironment> env;
 
     int width = 100;
     int height = 100;
@@ -49,10 +51,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { r
 
 TEST_F(RegressionTests, CreateSurfaceWin32) {
     auto& driver = env->get_test_icd();
-    driver.SetICDAPIVersion(VK_MAKE_VERSION(1, 0, 0));
-    driver.SetMinICDInterfaceVersion(5);
-    driver.AddInstanceExtension(Extension(VK_KHR_SURFACE_EXTENSION_NAME));
-    driver.AddInstanceExtension(Extension(VK_KHR_WIN32_SURFACE_EXTENSION_NAME));
+    driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0));
+    driver.set_min_icd_interface_version(5);
+    driver.add_instance_extension(Extension(VK_KHR_SURFACE_EXTENSION_NAME));
+    driver.add_instance_extension(Extension(VK_KHR_WIN32_SURFACE_EXTENSION_NAME));
     driver.enable_icd_wsi = true;
 
     InstWrapper inst{env->vulkan_functions};
@@ -116,10 +118,10 @@ TEST_F(RegressionTests, CreateSurfaceWin32) {
 #if defined(VK_USE_PLATFORM_XCB_KHR)
 TEST_F(RegressionTests, CreateSurfaceXCB) {
     auto& driver = env->get_test_icd();
-    driver.SetICDAPIVersion(VK_MAKE_VERSION(1, 0, 0));
-    driver.SetMinICDInterfaceVersion(5);
-    driver.AddInstanceExtension(Extension(VK_KHR_SURFACE_EXTENSION_NAME));
-    driver.AddInstanceExtension(Extension(VK_KHR_XCB_SURFACE_EXTENSION_NAME));
+    driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0));
+    driver.set_min_icd_interface_version(5);
+    driver.add_instance_extension(Extension(VK_KHR_SURFACE_EXTENSION_NAME));
+    driver.add_instance_extension(Extension(VK_KHR_XCB_SURFACE_EXTENSION_NAME));
     driver.enable_icd_wsi = true;
 
     InstWrapper inst{env->vulkan_functions};
@@ -177,10 +179,10 @@ TEST_F(RegressionTests, CreateSurfaceXCB) {
 #if defined(VK_USE_PLATFORM_XLIB_KHR)
 TEST_F(RegressionTests, CreateSurfaceXLIB) {
     auto& driver = env->get_test_icd();
-    driver.SetICDAPIVersion(VK_MAKE_VERSION(1, 0, 0));
-    driver.SetMinICDInterfaceVersion(5);
-    driver.AddInstanceExtension(Extension(VK_KHR_SURFACE_EXTENSION_NAME));
-    driver.AddInstanceExtension(Extension(VK_KHR_XLIB_SURFACE_EXTENSION_NAME));
+    driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0));
+    driver.set_min_icd_interface_version(5);
+    driver.add_instance_extension(Extension(VK_KHR_SURFACE_EXTENSION_NAME));
+    driver.add_instance_extension(Extension(VK_KHR_XLIB_SURFACE_EXTENSION_NAME));
     driver.enable_icd_wsi = true;
 
     InstWrapper inst{env->vulkan_functions};
@@ -245,10 +247,10 @@ static const struct wl_registry_listener wayland_registry_listener = {wayland_re
 
 TEST_F(RegressionTests, CreateSurfaceWayland) {
     auto& driver = env->get_test_icd();
-    driver.SetICDAPIVersion(VK_MAKE_VERSION(1, 0, 0));
-    driver.SetMinICDInterfaceVersion(5);
-    driver.AddInstanceExtension(Extension(VK_KHR_SURFACE_EXTENSION_NAME));
-    driver.AddInstanceExtension(Extension(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME));
+    driver.set_icd_api_version(VK_MAKE_VERSION(1, 0, 0));
+    driver.set_min_icd_interface_version(5);
+    driver.add_instance_extension(Extension(VK_KHR_SURFACE_EXTENSION_NAME));
+    driver.add_instance_extension(Extension(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME));
     driver.enable_icd_wsi = true;
 
     InstWrapper inst{env->vulkan_functions};