2525 * Author: Charles Giessen <[email protected] > 2626 */
2727
28+ #include " manifest_builders.h"
2829#include " test_environment.h"
2930
30- #include < fstream>
3131#include < mutex>
3232
3333struct MemoryTrackerSettings {
@@ -184,7 +184,7 @@ class MemoryTracker {
184184// a CreateInstance/DestroyInstance call pair.
185185TEST (Allocation, Instance) {
186186 FrameworkEnvironment env{};
187- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) );
187+ env.add_icd (TEST_ICD_PATH_VERSION_2);
188188
189189 MemoryTracker tracker;
190190 {
@@ -198,7 +198,7 @@ TEST(Allocation, Instance) {
198198// a CreateInstance/DestroyInstance call pair with a call to GetInstanceProcAddr.
199199TEST (Allocation, GetInstanceProcAddr) {
200200 FrameworkEnvironment env{};
201- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) );
201+ env.add_icd (TEST_ICD_PATH_VERSION_2);
202202
203203 MemoryTracker tracker;
204204 {
@@ -216,7 +216,7 @@ TEST(Allocation, GetInstanceProcAddr) {
216216// a vkEnumeratePhysicalDevices call pair.
217217TEST (Allocation, EnumeratePhysicalDevices) {
218218 FrameworkEnvironment env{};
219- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) ).add_physical_device (" physical_device_0" );
219+ env.add_icd (TEST_ICD_PATH_VERSION_2).add_physical_device (" physical_device_0" );
220220
221221 MemoryTracker tracker;
222222 {
@@ -239,7 +239,7 @@ TEST(Allocation, EnumeratePhysicalDevices) {
239239// allocators used on both the instance and device.
240240TEST (Allocation, InstanceAndDevice) {
241241 FrameworkEnvironment env{};
242- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) )
242+ env.add_icd (TEST_ICD_PATH_VERSION_2)
243243 .add_physical_device (PhysicalDevice{" physical_device_0" }
244244 .add_queue_family_properties ({{VK_QUEUE_GRAPHICS_BIT, 1 , 0 , {1 , 1 , 1 }}, false })
245245 .finish ());
@@ -288,7 +288,7 @@ TEST(Allocation, InstanceAndDevice) {
288288// allocators used on only the instance and not the device.
289289TEST (Allocation, InstanceButNotDevice) {
290290 FrameworkEnvironment env{};
291- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) )
291+ env.add_icd (TEST_ICD_PATH_VERSION_2)
292292 .add_physical_device (PhysicalDevice{" physical_device_0" }
293293 .add_queue_family_properties ({{VK_QUEUE_GRAPHICS_BIT, 1 , 0 , {1 , 1 , 1 }}, false })
294294 .finish ());
@@ -337,7 +337,7 @@ TEST(Allocation, InstanceButNotDevice) {
337337// allocators used on only the device and not the instance.
338338TEST (Allocation, DeviceButNotInstance) {
339339 FrameworkEnvironment env{};
340- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) )
340+ env.add_icd (TEST_ICD_PATH_VERSION_2)
341341 .add_physical_device (PhysicalDevice{" physical_device_0" }
342342 .add_queue_family_properties ({{VK_QUEUE_GRAPHICS_BIT, 1 , 0 , {1 , 1 , 1 }}, false })
343343 .finish ());
@@ -394,7 +394,7 @@ TEST(Allocation, DeviceButNotInstance) {
394394// one of the out-of-memory conditions trigger.
395395TEST (Allocation, CreateInstanceIntentionalAllocFail) {
396396 FrameworkEnvironment env{FrameworkSettings{}.set_log_filter (" error,warn" )};
397- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) );
397+ env.add_icd (TEST_ICD_PATH_VERSION_2);
398398
399399 const char * layer_name = " VK_LAYER_implicit" ;
400400 env.add_implicit_layer (ManifestLayer{}.add_layer (ManifestLayer::LayerDescription{}
@@ -424,7 +424,7 @@ TEST(Allocation, CreateInstanceIntentionalAllocFail) {
424424// one of the out-of-memory conditions trigger and there are invalid jsons in the same folder
425425TEST (Allocation, CreateInstanceIntentionalAllocFailInvalidManifests) {
426426 FrameworkEnvironment env{FrameworkSettings{}.set_log_filter (" error,warn" )};
427- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) );
427+ env.add_icd (TEST_ICD_PATH_VERSION_2);
428428
429429 std::vector<std::string> invalid_jsons;
430430 invalid_jsons.push_back (" ," );
@@ -472,7 +472,7 @@ TEST(Allocation, CreateInstanceIntentionalAllocFailInvalidManifests) {
472472// one of the out-of-memory conditions trigger.
473473TEST (Allocation, CreateSurfaceIntentionalAllocFail) {
474474 FrameworkEnvironment env{FrameworkSettings{}.set_log_filter (" error,warn" )};
475- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) ).setup_WSI ();
475+ env.add_icd (TEST_ICD_PATH_VERSION_2).setup_WSI ();
476476
477477 const char * layer_name = " VK_LAYER_implicit" ;
478478 env.add_implicit_layer (ManifestLayer{}.add_layer (ManifestLayer::LayerDescription{}
@@ -517,7 +517,7 @@ TEST(Allocation, CreateSurfaceIntentionalAllocFail) {
517517// one of the out-of-memory conditions trigger.
518518TEST (Allocation, CreateInstanceIntentionalAllocFailWithSettingsFilePresent) {
519519 FrameworkEnvironment env{FrameworkSettings{}.set_log_filter (" error,warn" )};
520- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) );
520+ env.add_icd (TEST_ICD_PATH_VERSION_2);
521521
522522 const char * layer_name = " VK_LAYER_implicit" ;
523523 env.add_implicit_layer (ManifestLayer{}.add_layer (ManifestLayer::LayerDescription{}
@@ -554,7 +554,7 @@ TEST(Allocation, CreateInstanceIntentionalAllocFailWithSettingsFilePresent) {
554554// one of the out-of-memory conditions trigger.
555555TEST (Allocation, CreateSurfaceIntentionalAllocFailWithSettingsFilePresent) {
556556 FrameworkEnvironment env{FrameworkSettings{}.set_log_filter (" error,warn" )};
557- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) ).setup_WSI ();
557+ env.add_icd (TEST_ICD_PATH_VERSION_2).setup_WSI ();
558558
559559 const char * layer_name = " VK_LAYER_implicit" ;
560560 env.add_implicit_layer (ManifestLayer{}.add_layer (ManifestLayer::LayerDescription{}
@@ -605,7 +605,7 @@ TEST(Allocation, CreateSurfaceIntentionalAllocFailWithSettingsFilePresent) {
605605// one of the out-of-memory conditions trigger.
606606TEST (Allocation, DriverEnvVarIntentionalAllocFail) {
607607 FrameworkEnvironment env{FrameworkSettings{}.set_log_filter (" error,warn" )};
608- env.add_icd (TestICDDetails{ TEST_ICD_PATH_VERSION_2}.set_discovery_type (ManifestDiscoveryType::env_var));
608+ env.add_icd (TEST_ICD_PATH_VERSION_2, ManifestOptions{ }.set_discovery_type (ManifestDiscoveryType::env_var));
609609
610610 const char * layer_name = " VK_LAYER_implicit" ;
611611 env.add_implicit_layer (ManifestLayer{}.add_layer (ManifestLayer::LayerDescription{}
@@ -639,7 +639,7 @@ TEST(Allocation, DriverEnvVarIntentionalAllocFail) {
639639// may fail.
640640TEST (Allocation, CreateDeviceIntentionalAllocFail) {
641641 FrameworkEnvironment env{FrameworkSettings{}.set_log_filter (" error,warn" )};
642- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) )
642+ env.add_icd (TEST_ICD_PATH_VERSION_2)
643643 .add_physical_device (PhysicalDevice{" physical_device_0" }
644644 .add_queue_family_properties ({{VK_QUEUE_GRAPHICS_BIT, 1 , 0 , {1 , 1 , 1 }}, false })
645645 .finish ())
@@ -709,19 +709,18 @@ TEST(Allocation, CreateInstanceDeviceIntentionalAllocFail) {
709709 uint32_t num_physical_devices = 4 ;
710710 uint32_t num_implicit_layers = 3 ;
711711 for (uint32_t i = 0 ; i < num_physical_devices; i++) {
712- env.add_icd (TestICDDetails (TEST_ICD_PATH_VERSION_2)
713- .icd_manifest .set_is_portability_driver (false )
714- .set_library_arch (sizeof (void *) == 8 ? " 64" : " 32" ))
712+ env.add_icd (TEST_ICD_PATH_VERSION_2, {},
713+ ManifestICD{}.set_is_portability_driver (false ).set_library_arch (sizeof (void *) == 8 ? " 64" : " 32" ))
715714 .set_icd_api_version (VK_API_VERSION_1_1)
716715 .add_instance_extension (" VK_KHR_get_physical_device_properties2" )
717716 .add_and_get_physical_device (" physical_device_0" )
718717 .add_queue_family_properties ({{VK_QUEUE_GRAPHICS_BIT, 1 , 0 , {1 , 1 , 1 }}, false })
719718 .add_extensions ({" VK_EXT_one" , " VK_EXT_two" , " VK_EXT_three" , " VK_EXT_four" , " VK_EXT_five" });
720719 }
721720
722- env.add_icd (TestICDDetails ( CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE) .set_is_fake (true ));
721+ env.add_icd (CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE, ManifestOptions{} .set_is_fake (true ));
723722
724- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_7) .set_discovery_type (ManifestDiscoveryType::none));
723+ env.add_icd (TEST_ICD_PATH_VERSION_7, ManifestOptions{} .set_discovery_type (ManifestDiscoveryType::none));
725724
726725 VkDirectDriverLoadingInfoLUNARG ddl_info{};
727726 ddl_info.sType = VK_STRUCTURE_TYPE_DIRECT_DRIVER_LOADING_INFO_LUNARG;
@@ -827,8 +826,8 @@ TEST(Allocation, CreateInstanceDeviceIntentionalAllocFail) {
827826// an incompatible driver exists
828827TEST (TryLoadWrongBinaries, CreateInstanceIntentionalAllocFail) {
829828 FrameworkEnvironment env{FrameworkSettings{}.set_log_filter (" error,warn" )};
830- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) );
831- env.add_icd (TestICDDetails ( CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE) .set_is_fake (true ));
829+ env.add_icd (TEST_ICD_PATH_VERSION_2);
830+ env.add_icd (CURRENT_PLATFORM_DUMMY_BINARY_WRONG_TYPE, ManifestOptions{} .set_is_fake (true ));
832831
833832 const char * layer_name = " VK_LAYER_implicit" ;
834833 env.add_implicit_layer (ManifestLayer{}.add_layer (ManifestLayer::LayerDescription{}
@@ -859,7 +858,7 @@ TEST(TryLoadWrongBinaries, CreateInstanceIntentionalAllocFail) {
859858// leak memory if one of the out-of-memory conditions trigger.
860859TEST (Allocation, EnumeratePhysicalDevicesIntentionalAllocFail) {
861860 FrameworkEnvironment env{FrameworkSettings{}.set_log_filter (" error,warn" )};
862- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) );
861+ env.add_icd (TEST_ICD_PATH_VERSION_2);
863862
864863 const char * layer_name = " VK_LAYER_implicit" ;
865864 env.add_implicit_layer (ManifestLayer{}.add_layer (ManifestLayer::LayerDescription{}
@@ -970,8 +969,8 @@ TEST(Allocation, EnumeratePhysicalDevicesIntentionalAllocFail) {
970969// leak memory if one of the out-of-memory conditions trigger.
971970TEST (Allocation, CreateInstanceDeviceWithDXGIDriverIntentionalAllocFail) {
972971 FrameworkEnvironment env{FrameworkSettings{}.set_log_filter (" error,warn" )};
973- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_6) .set_discovery_type (ManifestDiscoveryType::null_dir));
974- env.add_icd (TestICDDetails ( TEST_ICD_PATH_VERSION_2) );
972+ env.add_icd (TEST_ICD_PATH_VERSION_6, ManifestOptions{} .set_discovery_type (ManifestDiscoveryType::null_dir));
973+ env.add_icd (TEST_ICD_PATH_VERSION_2);
975974
976975 for (uint32_t i = 0 ; i < 2 ; i++) {
977976 auto & driver = env.get_test_icd (i);
0 commit comments