Tests to use unique layer names
authorCharles Giessen <charles@lunarg.com>
Fri, 10 Dec 2021 19:04:04 +0000 (12:04 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Sat, 11 Dec 2021 00:08:23 +0000 (17:08 -0700)
While the logic to copy TestLayer binaries was present, it didn't rename them
to a unique string to prevent collisions when using the same binary.

tests/framework/test_environment.cpp

index 027e393fa39fa2e5d6c4906273caab7833da0779..1becd43b9c597374d831476cb5cd8357c92ed9bf 100644 (file)
@@ -212,8 +212,9 @@ void FrameworkEnvironment::add_explicit_layer(ManifestLayer layer_manifest, cons
 void FrameworkEnvironment::add_layer_impl(ManifestLayer& layer_manifest, const std::string& json_name,
                                           fs::FolderManager& folder_manager, ManifestCategory category) {
     for (auto& layer : layer_manifest.layers) {
+        size_t cur_layer_index = layers.size();
         if (!layer.lib_path.str().empty()) {
-            std::string new_layer_name = layer.name + "_" + layer.lib_path.filename().str();
+            std::string new_layer_name = layer.name + "_" + std::to_string(cur_layer_index) + "_" + layer.lib_path.filename().str();
 
             auto new_layer_location = folder_manager.copy_file(layer.lib_path, new_layer_name);