Skip to content
Snippets Groups Projects
Commit d2a70ccc authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

more verbose gtest

parent dbcdfe23
No related branches found
No related tags found
1 merge request!448Draft: Resolve "Implementation of new nodes creation"
Pipeline #18765 failed
...@@ -124,18 +124,25 @@ TEST(Schema, validate_all_schemas) ...@@ -124,18 +124,25 @@ TEST(Schema, validate_all_schemas)
TEST(Schema, duplicated_schemas) TEST(Schema, duplicated_schemas)
{ {
std::set<std::string> schemas_found; std::map<std::string, std::string> schemas_found;
unsigned int n_duplicated = 0;
for (auto const& entry : filesystem::recursive_directory_iterator(wolf_dir)) for (auto const& entry : filesystem::recursive_directory_iterator(wolf_dir))
{ {
if (filesystem::is_regular_file(entry) and entry.path().extension().string() == ".schema") if (filesystem::is_regular_file(entry) and entry.path().extension().string() == ".schema")
{ {
ASSERT_FALSE(schemas_found.count(entry.path().filename().string())); bool duplicated = schemas_found.count(entry.path().filename().string());
schemas_found.insert(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("Found ", schemas_found.size(), " schema files."); WOLF_INFO_COND(n_duplicated == 0, "Found ", schemas_found.size(), " schema files.");
WOLF_ERROR_COND(n_duplicated != 0, "Found ", n_duplicated, " duplicated schemas in ", schemas_found.size(), " schema files.");
} }
int main(int argc, char** argv) int main(int argc, char** argv)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment