From 75431e4b1f9a19835d994a66be24b303278d2d0d Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Wed, 22 Sep 2021 16:17:50 -0600 Subject: [PATCH] test: Isolate Env-Vars from test framework Previously if any of the env-vars the loader looks for were set on the system, the loader would find and use them, leading to highly confusing logs. Removing them preemptively at tests start make this a non-issue. --- tests/loader_testing_main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/loader_testing_main.cpp b/tests/loader_testing_main.cpp index a97ba4af..1aacd55e 100644 --- a/tests/loader_testing_main.cpp +++ b/tests/loader_testing_main.cpp @@ -48,6 +48,13 @@ int main(int argc, char** argv) { fs::delete_folder(fs::path(FRAMEWORK_BUILD_DIRECTORY) / "explicit_layer_manifests"); fs::delete_folder(fs::path(FRAMEWORK_BUILD_DIRECTORY) / "implicit_layer_manifests"); + // make sure the tests don't find these env-vars if they were set on the system + remove_env_var("VK_ICD_FILENAMES"); + remove_env_var("VK_LAYER_PATH"); + remove_env_var("VK_INSTANCE_LAYERS"); + remove_env_var("VK_LOADER_DEBUG"); + remove_env_var("VK_LOADER_DISABLE_INST_EXT_FILTER"); + ::testing::InitGoogleTest(&argc, argv); int result = RUN_ALL_TESTS(); -- 2.34.1