diff --git a/test/gtest_schema.cpp b/test/gtest_schema.cpp index d6619ff2e5a2ac9486911661e57c9c3cfc572517..7998eb646079223707b2ab0ee7f76f0f9b88f734 100644 --- a/test/gtest_schema.cpp +++ b/test/gtest_schema.cpp @@ -126,20 +126,23 @@ TEST(Schema, duplicated_schemas) { std::map<std::string, std::string> schemas_found; unsigned int n_duplicated = 0; - for (auto const& entry : filesystem::recursive_directory_iterator(wolf_dir)) - { - if (filesystem::is_regular_file(entry) and entry.path().extension().string() == ".schema") + std::vector<std::string> root_folders{wolf_dir + "/schema", wolf_dir + "/test"}; + + for (auto root_folder : root_folders) + for (auto const& entry : filesystem::recursive_directory_iterator(root_folder)) { - bool duplicated = schemas_found.count(entry.path().filename().string()); - WOLF_ERROR_COND(duplicated, - "Found duplicated schema file:\n", - entry.path().string(), - "\n", - schemas_found[entry.path().filename().string()]) - schemas_found[entry.path().filename().string()] = entry.path().string(); - if (duplicated) n_duplicated++; + if (filesystem::is_regular_file(entry) and entry.path().extension().string() == ".schema") + { + bool duplicated = schemas_found.count(entry.path().filename().string()); + WOLF_ERROR_COND(duplicated, + "Found duplicated schema file:\n", + entry.path().string(), + "\n", + schemas_found[entry.path().filename().string()]) + schemas_found[entry.path().filename().string()] = entry.path().string(); + if (duplicated) n_duplicated++; + } } - } ASSERT_EQ(n_duplicated, 0); WOLF_INFO_COND(n_duplicated == 0, "Found ", schemas_found.size(), " schema files."); WOLF_ERROR_COND(