Added test case for package diagram from directory structure for plain C

This commit is contained in:
Bartek Kryza
2023-05-26 21:46:23 +02:00
parent 2a29968f09
commit ba32b54395
12 changed files with 118 additions and 2 deletions

View File

@@ -559,6 +559,18 @@ bool translation_unit_visitor::find_relationships(const clang::QualType &type,
}
}
}
else if (type->isRecordType() && type->getAsRecordDecl()) {
// This is only possible for plain C translation unit, so we don't
// need to consider namespaces here
if (config().package_type() == config::package_type_t::kDirectory) {
if (diagram().should_include(
common::get_qualified_name(*type->getAsRecordDecl()))) {
const auto target_id = get_package_id(type->getAsRecordDecl());
relationships.emplace_back(target_id, relationship_hint);
result = true;
}
}
}
return result;
}