From d3f06bb92037f10cda805d7575da9dbae0d38c82 Mon Sep 17 00:00:00 2001
From: joanvallve <jvallve@iri.upc.edu>
Date: Thu, 4 Jul 2024 22:04:17 +0200
Subject: [PATCH] [skip ci] better gtest_schema

---
 test/gtest_schema.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/test/gtest_schema.cpp b/test/gtest_schema.cpp
index 68b7d69..835ba1c 100644
--- a/test/gtest_schema.cpp
+++ b/test/gtest_schema.cpp
@@ -119,6 +119,23 @@ TEST(Schema, validate_all_schemas)
     ASSERT_TRUE(validateAllSchemas({plugin_dir + "/schema", wolf_schema_dir}, true));
 }
 
+TEST(Schema, duplicated_schemas)
+{
+    std::set<std::string> schemas_found;
+
+    for (auto const& entry : filesystem::recursive_directory_iterator(plugin_dir))
+    {
+        if (filesystem::is_regular_file(entry) and entry.path().extension().string() == ".schema")
+        {
+            ASSERT_FALSE(schemas_found.count(entry.path().filename().string()));
+            schemas_found.insert(entry.path().filename().string());
+        }
+    }
+
+    WOLF_INFO("Found ", schemas_found.size(), " schema files.");
+}
+
+
 int main(int argc, char** argv)
 {
     testing::InitGoogleTest(&argc, argv);
-- 
GitLab