@@ -2243,6 +2243,61 @@ TEST(SettingsFile, StderrLog_NoOutput) {
22432243 }
22442244}
22452245
2246+ // Settings can say which filters to use - make sure the lack of this filter works correctly with VK_LOADER_DEBUG
2247+ TEST (SettingsFile, NoStderr_log_but_VK_LOADER_DEBUG) {
2248+ FrameworkEnvironment env{FrameworkSettings{}.set_log_filter (" all" )};
2249+ env.add_icd (TestICDDetails (TEST_ICD_PATH_VERSION_2)).add_physical_device ({});
2250+
2251+ const char * explicit_layer_name = " Regular_TestLayer1" ;
2252+
2253+ env.add_explicit_layer (TestLayerDetails{
2254+ ManifestLayer{}.add_layer (
2255+ ManifestLayer::LayerDescription{}.set_name (explicit_layer_name).set_lib_path (TEST_LAYER_PATH_EXPORT_VERSION_2)),
2256+ " explicit_test_layer1.json" });
2257+
2258+ env.update_loader_settings (env.loader_settings .set_file_format_version ({1 , 0 , 0 }).add_app_specific_setting (
2259+ AppSpecificSettings{}
2260+ .add_layer_configuration (LoaderSettingsLayerConfiguration{}
2261+ .set_name (explicit_layer_name)
2262+ .set_path (env.get_shimmed_layer_manifest_path ())
2263+ .set_control (" auto" ))
2264+ .add_layer_configuration (
2265+ LoaderSettingsLayerConfiguration{}.set_name (" VK_LAYER_missing" ).set_path (" /road/to/nowhere" ).set_control (" auto" ))));
2266+ env.loader_settings .app_specific_settings .at (0 ).stderr_log = {};
2267+ env.update_loader_settings (env.loader_settings );
2268+
2269+ std::string expected_output_verbose;
2270+ expected_output_verbose += " DEBUG: Layer Configurations count = 2\n " ;
2271+ expected_output_verbose += " DEBUG: ---- Layer Configuration [0] ----\n " ;
2272+ expected_output_verbose += std::string (" DEBUG: Name: " ) + explicit_layer_name + " \n " ;
2273+ expected_output_verbose += " DEBUG: Path: " + env.get_shimmed_layer_manifest_path ().string () + " \n " ;
2274+ expected_output_verbose += " DEBUG: Control: auto\n " ;
2275+ expected_output_verbose += " DEBUG: ---- Layer Configuration [1] ----\n " ;
2276+ expected_output_verbose += " DEBUG: Name: VK_LAYER_missing\n " ;
2277+ expected_output_verbose += " DEBUG: Path: /road/to/nowhere\n " ;
2278+ expected_output_verbose += " DEBUG: Control: auto\n " ;
2279+ expected_output_verbose += " DEBUG: ---------------------------------\n " ;
2280+
2281+ std::string expected_output_info = std::string (" INFO: " ) + get_settings_location_log_message (env) + " \n " ;
2282+
2283+ std::string expected_output_warning =
2284+ " WARNING: Layer name Regular_TestLayer1 does not conform to naming standard (Policy #LLP_LAYER_3)\n " ;
2285+
2286+ std::string expected_output_error = " ERROR: loader_get_json: Failed to open JSON file /road/to/nowhere\n " ;
2287+
2288+ env.platform_shim ->clear_logs ();
2289+ {
2290+ InstWrapper inst{env.vulkan_functions };
2291+ inst.CheckCreate ();
2292+ EXPECT_TRUE (env.platform_shim ->find_in_log (expected_output_verbose));
2293+ EXPECT_TRUE (env.platform_shim ->find_in_log (expected_output_info));
2294+ EXPECT_TRUE (env.platform_shim ->find_in_log (expected_output_warning));
2295+ EXPECT_TRUE (env.platform_shim ->find_in_log (expected_output_error));
2296+
2297+ auto active_layer_props = inst.GetActiveLayers (inst.GetPhysDev (), 0 );
2298+ EXPECT_TRUE (active_layer_props.size () == 0 );
2299+ }
2300+ }
22462301TEST (SettingsFile, ManyLayersEnabledInManyWays) {
22472302 FrameworkEnvironment env{};
22482303 env.add_icd (TestICDDetails (TEST_ICD_PATH_VERSION_2)).add_physical_device ({});
0 commit comments