From 6822930a123b61d7e7b7ebbe8b548edcb0d28c9e Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 5 Sep 2023 00:04:05 +0200 Subject: [PATCH 01/24] Initial mermaid class diagram support --- .../mermaid/class_diagram_generator.cc | 841 ++++++++++++++++++ .../mermaid/class_diagram_generator.h | 269 ++++++ src/common/generators/generators.h | 27 + src/common/generators/mermaid/generator.cc | 75 ++ src/common/generators/mermaid/generator.h | 454 ++++++++++ src/common/types.h | 3 +- src/config/config.cc | 6 + src/config/config.h | 17 + tests/t00002/test_case.h | 6 + tests/t00003/test_case.h | 6 + tests/t00004/test_case.h | 6 + tests/test_cases.cc | 37 + tests/test_cases.h | 1 + 13 files changed, 1747 insertions(+), 1 deletion(-) create mode 100644 src/class_diagram/generators/mermaid/class_diagram_generator.cc create mode 100644 src/class_diagram/generators/mermaid/class_diagram_generator.h create mode 100644 src/common/generators/mermaid/generator.cc create mode 100644 src/common/generators/mermaid/generator.h diff --git a/src/class_diagram/generators/mermaid/class_diagram_generator.cc b/src/class_diagram/generators/mermaid/class_diagram_generator.cc new file mode 100644 index 00000000..f6c202a8 --- /dev/null +++ b/src/class_diagram/generators/mermaid/class_diagram_generator.cc @@ -0,0 +1,841 @@ +/** + * @file src/class_diagram/generators/mermaid/class_diagram_generator.cc + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "class_diagram_generator.h" + +#include "util/error.h" + +#include + +namespace clanguml::class_diagram::generators::mermaid { + +generator::generator(diagram_config &config, diagram_model &model) + : common_generator{config, model} + , together_group_stack_{!config.generate_packages()} +{ +} + +std::string generator::render_name(std::string name) const +{ + util::replace_all(name, "<", "<"); + util::replace_all(name, ">", ">"); + util::replace_all(name, "(", "("); + util::replace_all(name, ")", ")"); + util::replace_all(name, "##", "::"); + + return name; +} + +void generator::generate_alias( + const common::model::element &c, std::ostream &ostr) const +{ + std::string full_name; + if (config().generate_packages()) + full_name = c.full_name_no_ns(); + else + full_name = c.full_name(true); + + assert(!full_name.empty()); + + print_debug(c, ostr); + + auto class_label = config().simplify_template_type(render_name(full_name)); + + ostr << " class " << c.alias() << "[\"" << class_label << "\"]\n"; + + // Register the added alias + m_generated_aliases.emplace(c.alias()); +} + +void generator::generate(const class_ &c, std::ostream &ostr) const +{ + namespace mermaid_common = clanguml::common::generators::mermaid; + + std::string class_type{"class"}; + + ostr << " class " << c.alias(); + + ostr << " {" << '\n'; + + if (c.is_union()) + ostr << " <>\n"; + else if (c.is_abstract()) + ostr << " <>\n"; + + // + // Process methods + // + if (config().group_methods()) { + generate_methods(group_methods(c.methods()), ostr); + } + else { + generate_methods(c.methods(), ostr); + } + + // + // Process relationships - here only generate the set of + // rendered_relationships we'll generate them in a seperate method + // + std::set rendered_relations; + + std::stringstream all_relations_str; + for (const auto &r : c.relationships()) { + if (!model().should_include(r.type())) + continue; + + try { + generate_relationship(r, rendered_relations); + } + catch (error::uml_alias_missing &e) { + LOG_DBG("Skipping {} relation from {} to {} due " + "to: {}", + mermaid_common::to_mermaid(r.type(), r.style()), c.full_name(), + r.destination(), e.what()); + } + } + + // + // Process members + // + std::vector members{ + c.members()}; + + sort_class_elements(members); + + for (const auto &m : members) { + if (!model().should_include(m)) + continue; + + if (!config().include_relations_also_as_members() && + rendered_relations.find(m.name()) != rendered_relations.end()) + continue; + + generate_member(m, ostr); + + ostr << '\n'; + } + + ostr << " }" << '\n'; + + generate_notes(ostr, c); + + for (const auto &member : c.members()) + generate_member_notes(ostr, member, c.alias()); + + for (const auto &method : c.methods()) + generate_member_notes(ostr, method, c.alias()); +} + +void generator::generate_methods( + const method_groups_t &methods, std::ostream &ostr) const +{ + for (const auto &group : method_groups_) { + const auto &group_methods = methods.at(group); + if (!group_methods.empty()) { + generate_methods(group_methods, ostr); + } + } +} + +void generator::generate_methods( + const std::vector &methods, std::ostream &ostr) const +{ + auto sorted_methods = methods; + sort_class_elements(sorted_methods); + + for (const auto &m : sorted_methods) { + if (!model().should_include(m)) + continue; + + generate_method(m, ostr); + + ostr << '\n'; + } +} + +generator::method_groups_t generator::group_methods( + const std::vector &methods) const +{ + std::map> result; + + // First get rid of methods which don't pass the filters + std::vector filtered_methods; + std::copy_if(methods.cbegin(), methods.cend(), + std::back_inserter(filtered_methods), + [this](auto &m) { return model().should_include(m); }); + + for (const auto &g : method_groups_) { + result[g] = {}; + } + + for (const auto &m : filtered_methods) { + if (m.is_constructor() || m.is_destructor()) { + result["constructors"].push_back(m); + } + else if (m.is_copy_assignment() || m.is_move_assignment()) { + result["assignment"].push_back(m); + } + else if (m.is_operator()) { + result["operators"].push_back(m); + } + else { + result["other"].push_back(m); + } + } + + return result; +} + +void generator::generate_method( + const class_diagram::model::class_method &m, std::ostream &ostr) const +{ + namespace mermaid_common = clanguml::common::generators::mermaid; + const auto &uns = config().using_namespace(); + + constexpr auto kAbbreviatedMethodArgumentsLength{15}; + + print_debug(m, ostr); + + std::string intend = " "; + + std::string type{uns.relative(config().simplify_template_type(m.type()))}; + + ostr << intend << mermaid_common::to_mermaid(m.access()) << m.name(); + + if (!m.template_params().empty()) { + m.render_template_params(ostr, config().using_namespace(), false); + } + + ostr << "("; + if (config().generate_method_arguments() != + config::method_arguments::none) { + std::vector params; + std::transform(m.parameters().cbegin(), m.parameters().cend(), + std::back_inserter(params), [this](const auto &mp) { + return config().simplify_template_type( + mp.to_string(config().using_namespace())); + }); + auto args_string = fmt::format("{}", fmt::join(params, ", ")); + if (config().generate_method_arguments() == + config::method_arguments::abbreviated) { + args_string = clanguml::util::abbreviate( + args_string, kAbbreviatedMethodArgumentsLength); + } + ostr << args_string; + } + ostr << ")"; + + ostr << " : " << render_name(type); + + if (m.is_pure_virtual()) + ostr << "*"; + + if (m.is_static()) + ostr << "$"; +} + +void generator::generate_member( + const class_diagram::model::class_member &m, std::ostream &ostr) const +{ + namespace mermaid_common = clanguml::common::generators::mermaid; + const auto &uns = config().using_namespace(); + + print_debug(m, ostr); + + ostr << " " << mermaid_common::to_mermaid(m.access()) << m.name() + << " : " + << render_name( + uns.relative(config().simplify_template_type(m.type()))); +} + +void generator::generate(const concept_ &c, std::ostream &ostr) const +{ + std::string class_type{"class"}; + + ostr << class_type << " " << c.alias() << " <>"; + + if (!c.style().empty()) + ostr << " " << c.style(); + + ostr << " {" << '\n'; + + // TODO: add option to enable/disable this + if (c.requires_parameters().size() + c.requires_statements().size() > 0) { + std::vector parameters; + parameters.reserve(c.requires_parameters().size()); + for (const auto &p : c.requires_parameters()) { + parameters.emplace_back(p.to_string(config().using_namespace())); + } + + ostr << fmt::format("({})\n", fmt::join(parameters, ",")); + + ostr << "..\n"; + + ostr << fmt::format("{}\n", fmt::join(c.requires_statements(), "\n")); + } + + ostr << " }" << '\n'; +} + +void generator::generate_member_notes(std::ostream &ostr, + const class_element &member, const std::string &alias) const +{ + for (const auto &decorator : member.decorators()) { + auto note = std::dynamic_pointer_cast(decorator); + if (note && note->applies_to_diagram(config().name)) { + ostr << "note " << note->position << " of " << alias + << "::" << member.name() << '\n' + << note->text << '\n' + << "end note\n"; + } + } +} + +void generator::generate_relationships(std::ostream &ostr) const +{ + for (const auto &p : model()) { + if (auto *pkg = dynamic_cast(p.get()); pkg) { + generate_relationships(*pkg, ostr); + } + else if (auto *cls = dynamic_cast(p.get()); cls) { + if (model().should_include(*cls)) { + generate_relationships(*cls, ostr); + } + } + else if (auto *enm = dynamic_cast(p.get()); enm) { + if (model().should_include(*enm)) { + generate_relationships(*enm, ostr); + } + } + else if (auto *cpt = dynamic_cast(p.get()); cpt) { + if (model().should_include(*cpt)) { + generate_relationships(*cpt, ostr); + } + } + } +} + +void generator::generate_relationship( + const relationship &r, std::set &rendered_relations) const +{ + namespace mermaid_common = clanguml::common::generators::mermaid; + + LOG_DBG("Processing relationship {}", + mermaid_common::to_mermaid(r.type(), r.style())); + + std::string destination; + + auto target_element = model().get(r.destination()); + if (!target_element.has_value()) + throw error::uml_alias_missing{fmt::format( + "Missing element in the model for ID: {}", r.destination())}; + + destination = target_element.value().full_name(false); + + if (util::starts_with(destination, std::string{"::"})) + destination = destination.substr(2, destination.size()); + + std::string puml_relation; + if (!r.multiplicity_source().empty()) + puml_relation += "\"" + r.multiplicity_source() + "\" "; + + puml_relation += mermaid_common::to_mermaid(r.type(), r.style()); + + if (!r.multiplicity_destination().empty()) + puml_relation += " \"" + r.multiplicity_destination() + "\""; + + if (!r.label().empty()) { + rendered_relations.emplace(r.label()); + } +} + +void generator::generate_relationships( + const class_ &c, std::ostream &ostr) const +{ + namespace mermaid_common = clanguml::common::generators::mermaid; + + // + // Process relationships + // + std::set rendered_relations; + + std::stringstream all_relations_str; + std::set unique_relations; + + for (const auto &r : c.relationships()) { + if (!model().should_include(r.type())) + continue; + + LOG_DBG("== Processing relationship {}", + mermaid_common::to_mermaid(r.type(), r.style())); + + std::stringstream relstr; + clanguml::common::id_t destination{0}; + try { + destination = r.destination(); + + std::string puml_relation; + if (!r.multiplicity_source().empty()) + puml_relation += "\"" + r.multiplicity_source() + "\" "; + + puml_relation += mermaid_common::to_mermaid(r.type(), r.style()); + + if (!r.multiplicity_destination().empty()) + puml_relation += " \"" + r.multiplicity_destination() + "\""; + + std::string target_alias; + try { + target_alias = model().to_alias(destination); + } + catch (...) { + LOG_DBG("Failed to find alias to {}", destination); + continue; + } + + if (m_generated_aliases.find(target_alias) == + m_generated_aliases.end()) + continue; + + relstr << c.alias() << " " << puml_relation << " " << target_alias; + + if (!r.label().empty()) { + relstr << " : " << mermaid_common::to_mermaid(r.access()) + << r.label(); + rendered_relations.emplace(r.label()); + } + + if(r.type() == relationship_t::kContainment) { + relstr << " : [nested]\n"; + } + + if (unique_relations.count(relstr.str()) == 0) { + unique_relations.emplace(relstr.str()); + + relstr << '\n'; + + LOG_DBG("=== Adding relation {}", relstr.str()); + + all_relations_str << " " << relstr.str(); + } + } + catch (error::uml_alias_missing &e) { + LOG_DBG("=== Skipping {} relation from {} to {} due " + "to: {}", + mermaid_common::to_mermaid(r.type(), r.style()), c.full_name(), + destination, e.what()); + } + } + + if (model().should_include(relationship_t::kExtension)) { + for (const auto &b : c.parents()) { + std::stringstream relstr; + try { + auto target_alias = model().to_alias(b.id()); + + if (m_generated_aliases.find(target_alias) == + m_generated_aliases.end()) + continue; + + relstr << target_alias << " <|-- " << c.alias() << '\n'; + all_relations_str << " " << relstr.str(); + } + catch (error::uml_alias_missing &e) { + LOG_DBG("=== Skipping inheritance relation from {} to {} due " + "to: {}", + b.name(), c.name(), e.what()); + } + } + } + + ostr << all_relations_str.str(); +} + +void generator::generate_relationships( + const concept_ &c, std::ostream &ostr) const +{ + namespace mermaid_common = clanguml::common::generators::mermaid; + + // + // Process relationships + // + std::set rendered_relations; + + std::stringstream all_relations_str; + std::set unique_relations; + + for (const auto &r : c.relationships()) { + if (!model().should_include(r.type())) + continue; + + LOG_DBG("== Processing relationship {}", + mermaid_common::to_mermaid(r.type(), r.style())); + + std::stringstream relstr; + clanguml::common::id_t destination{0}; + try { + destination = r.destination(); + + std::string puml_relation; + if (!r.multiplicity_source().empty()) + puml_relation += "\"" + r.multiplicity_source() + "\" "; + + puml_relation += mermaid_common::to_mermaid(r.type(), r.style()); + + if (!r.multiplicity_destination().empty()) + puml_relation += " \"" + r.multiplicity_destination() + "\""; + + std::string target_alias; + try { + target_alias = model().to_alias(destination); + } + catch (...) { + LOG_DBG("Failed to find alias to {}", destination); + continue; + } + + if (m_generated_aliases.find(target_alias) == + m_generated_aliases.end()) + continue; + + relstr << c.alias() << " " << puml_relation << " " << target_alias; + + if (!r.label().empty()) { + relstr << " : " << mermaid_common::to_mermaid(r.access()) + << r.label(); + rendered_relations.emplace(r.label()); + } + + if (unique_relations.count(relstr.str()) == 0) { + unique_relations.emplace(relstr.str()); + + relstr << '\n'; + + LOG_DBG("=== Adding relation {}", relstr.str()); + + all_relations_str << relstr.str(); + } + } + catch (error::uml_alias_missing &e) { + LOG_DBG("=== Skipping {} relation from {} to {} due " + "to: {}", + mermaid_common::to_mermaid(r.type(), r.style()), c.full_name(), + destination, e.what()); + } + } + + ostr << all_relations_str.str(); +} + +void generator::generate_relationships(const enum_ &e, std::ostream &ostr) const +{ + for (const auto &r : e.relationships()) { + if (!model().should_include(r.type())) + continue; + + clanguml::common::id_t destination{0}; + std::stringstream relstr; + try { + destination = r.destination(); + + auto target_alias = model().to_alias(destination); + + if (m_generated_aliases.find(target_alias) == + m_generated_aliases.end()) + continue; + + relstr << e.alias() << " " + << clanguml::common::generators::mermaid::to_mermaid( + r.type(), r.style()) + << " " << target_alias; + + if (!r.label().empty()) + relstr << " : " << r.label(); + + relstr << '\n'; + + ostr << " " << relstr.str(); + } + catch (error::uml_alias_missing &ex) { + LOG_DBG("Skipping {} relation from {} to {} due " + "to: {}", + clanguml::common::generators::mermaid::to_mermaid( + r.type(), r.style()), + e.full_name(), destination, ex.what()); + } + } +} + +void generator::generate(const enum_ &e, std::ostream &ostr) const +{ + ostr << " class " << e.alias(); + + ostr << " {" << '\n'; + + ostr << " <>\n"; + + for (const auto &enum_constant : e.constants()) { + ostr << " " << enum_constant << '\n'; + } + + ostr << " }" << '\n'; + + generate_notes(ostr, e); +} + +void generator::generate(const package &p, std::ostream &ostr) const +{ + const auto &uns = config().using_namespace(); + + if (config().generate_packages()) { + LOG_DBG("Generating package {}", p.name()); + + // Don't generate packages from namespaces filtered out by + // using_namespace + if (!uns.starts_with({p.full_name(false)})) { + print_debug(p, ostr); + ostr << "package [" << p.name() << "] "; + ostr << "as " << p.alias(); + + if (p.is_deprecated()) + ostr << " <>"; + + if (!p.style().empty()) + ostr << " " << p.style(); + + ostr << " {" << '\n'; + } + } + + for (const auto &subpackage : p) { + if (dynamic_cast(subpackage.get()) != nullptr) { + // TODO: add option - generate_empty_packages + const auto &sp = dynamic_cast(*subpackage); + if (!sp.is_empty()) { + together_group_stack_.enter(); + + generate(sp, ostr); + + together_group_stack_.leave(); + } + } + else if (auto *cls = dynamic_cast(subpackage.get()); cls) { + if (model().should_include(*subpackage)) { + auto together_group = + config().get_together_group(cls->full_name(false)); + if (together_group) { + together_group_stack_.group_together( + together_group.value(), cls); + } + else { + generate_alias(*cls, ostr); + generate(*cls, ostr); + } + } + } + else if (auto *enm = dynamic_cast(subpackage.get()); enm) { + if (model().should_include(*subpackage)) { + auto together_group = + config().get_together_group(subpackage->full_name(false)); + if (together_group) { + together_group_stack_.group_together( + together_group.value(), enm); + } + else { + generate_alias(*enm, ostr); + generate(*enm, ostr); + } + } + } + else if (auto *cpt = dynamic_cast(subpackage.get()); cpt) { + if (model().should_include(*subpackage)) { + auto together_group = + config().get_together_group(cpt->full_name(false)); + if (together_group) { + together_group_stack_.group_together( + together_group.value(), cpt); + } + else { + generate_alias(*cpt, ostr); + generate(*cpt, ostr); + } + } + } + } + + if (config().generate_packages()) { + // Now generate any diagram elements which are in together + // groups + for (const auto &[group_name, group_elements] : + together_group_stack_.get_current_groups()) { + ostr << "together {\n"; + + for (auto *e : group_elements) { + if (auto *cls = dynamic_cast(e); cls) { + generate_alias(*cls, ostr); + generate(*cls, ostr); + } + if (auto *enm = dynamic_cast(e); enm) { + generate_alias(*enm, ostr); + generate(*enm, ostr); + } + if (auto *cpt = dynamic_cast(e); cpt) { + generate_alias(*cpt, ostr); + generate(*cpt, ostr); + } + } + + ostr << "}\n"; + } + + // Don't generate packages from namespaces filtered out by + // using_namespace + if (!uns.starts_with({p.full_name(false)})) { + ostr << "}" << '\n'; + generate_notes(ostr, p); + } + } +} + +void generator::generate_relationships( + const package &p, std::ostream &ostr) const +{ + for (const auto &subpackage : p) { + if (dynamic_cast(subpackage.get()) != nullptr) { + // TODO: add option - generate_empty_packages, currently + // packages which do not contain anything but other + // packages are skipped + const auto &sp = dynamic_cast(*subpackage); + if (!sp.is_empty() && + !sp.all_of([this](const common::model::element &e) { + return !model().should_include(e); + })) + generate_relationships(sp, ostr); + } + else if (dynamic_cast(subpackage.get()) != nullptr) { + if (model().should_include(*subpackage)) { + generate_relationships( + dynamic_cast(*subpackage), ostr); + } + } + else if (dynamic_cast(subpackage.get()) != nullptr) { + if (model().should_include(*subpackage)) { + generate_relationships( + dynamic_cast(*subpackage), ostr); + } + } + else if (dynamic_cast(subpackage.get()) != nullptr) { + if (model().should_include(*subpackage)) { + generate_relationships( + dynamic_cast(*subpackage), ostr); + } + } + } +} + +void generator::generate_diagram(std::ostream &ostr) const +{ + ostr << "classDiagram\n"; + + generate_top_level_elements(ostr); + + generate_groups(ostr); + + generate_relationships(ostr); +} + +void generator::generate_top_level_elements(std::ostream &ostr) const +{ + for (const auto &p : model()) { + if (auto *pkg = dynamic_cast(p.get()); pkg) { + if (!pkg->is_empty() && + !pkg->all_of([this](const common::model::element &e) { + return !model().should_include(e); + })) + generate(*pkg, ostr); + } + else if (auto *cls = dynamic_cast(p.get()); cls) { + if (model().should_include(*cls)) { + auto together_group = + config().get_together_group(cls->full_name(false)); + if (together_group) { + together_group_stack_.group_together( + together_group.value(), cls); + } + else { + generate_alias(*cls, ostr); + generate(*cls, ostr); + } + } + } + else if (auto *enm = dynamic_cast(p.get()); enm) { + if (model().should_include(*enm)) { + auto together_group = + config().get_together_group(enm->full_name(false)); + if (together_group) { + together_group_stack_.group_together( + together_group.value(), enm); + } + else { + generate_alias(*enm, ostr); + generate(*enm, ostr); + } + } + } + else if (auto *cpt = dynamic_cast(p.get()); cpt) { + if (model().should_include(*cpt)) { + auto together_group = + config().get_together_group(cpt->full_name(false)); + if (together_group) { + together_group_stack_.group_together( + together_group.value(), cpt); + } + else { + generate_alias(*cpt, ostr); + generate(*cpt, ostr); + } + } + } + } +} + +void generator::generate_groups(std::ostream &ostr) const +{ + for (const auto &[group_name, group_elements] : + together_group_stack_.get_current_groups()) { + ostr << "together {\n"; + + for (auto *e : group_elements) { + if (auto *cls = dynamic_cast(e); cls) { + generate_alias(*cls, ostr); + generate(*cls, ostr); + } + if (auto *enm = dynamic_cast(e); enm) { + generate_alias(*enm, ostr); + generate(*enm, ostr); + } + if (auto *cpt = dynamic_cast(e); cpt) { + generate_alias(*cpt, ostr); + generate(*cpt, ostr); + } + } + + ostr << "}\n"; + } +} + +} // namespace clanguml::class_diagram::generators::plantuml diff --git a/src/class_diagram/generators/mermaid/class_diagram_generator.h b/src/class_diagram/generators/mermaid/class_diagram_generator.h new file mode 100644 index 00000000..b08be5f7 --- /dev/null +++ b/src/class_diagram/generators/mermaid/class_diagram_generator.h @@ -0,0 +1,269 @@ +/** + * @file src/class_diagram/generators/mermaid/class_diagram_generator.h + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "class_diagram/model/class.h" +#include "class_diagram/model/concept.h" +#include "class_diagram/model/diagram.h" +#include "class_diagram/model/enum.h" +#include "class_diagram/visitor/translation_unit_visitor.h" +#include "common/generators/mermaid/generator.h" +#include "common/generators/nested_element_stack.h" +#include "common/model/relationship.h" +#include "config/config.h" +#include "util/util.h" + +#include + +#include +#include +#include +#include + +namespace clanguml { +namespace class_diagram { +namespace generators { +namespace mermaid { + +using diagram_config = clanguml::config::class_diagram; +using diagram_model = clanguml::class_diagram::model::diagram; +template +using common_generator = clanguml::common::generators::mermaid::generator; + +using clanguml::class_diagram::model::class_; +using clanguml::class_diagram::model::class_element; +using clanguml::class_diagram::model::class_member; +using clanguml::class_diagram::model::class_method; +using clanguml::class_diagram::model::concept_; +using clanguml::class_diagram::model::enum_; +using clanguml::common::model::access_t; +using clanguml::common::model::package; +using clanguml::common::model::relationship; +using clanguml::common::model::relationship_t; + +using namespace clanguml::util; + +/** + * @brief Class diagram MermaidJS generator + */ +class generator : public common_generator { + using method_groups_t = std::map>; + +public: + generator(diagram_config &config, diagram_model &model); + + using common_generator::generate; + + /** + * @brief Main generator method. + * + * This method is called first and coordinates the entire diagram + * generation. + * + * @param ostr Output stream. + */ + void generate_diagram(std::ostream &ostr) const override; + + /** + * @brief In a nested diagram, generate the top level elements. + * + * This method iterates over the top level elements. In case the diagram + * is nested (i.e. includes packages), for each package it recursively + * call generation of elements contained in each package. + * + * @param parent JSON node + */ + void generate_top_level_elements(std::ostream &ostr) const; + + /** + * @brief Generate PlantUML alias for a class element. + * + * @param c Class element + * @param ostr Output stream + */ + void generate_alias( + const common::model::element &e, std::ostream &ostr) const; + + /** + * @brief Render class element to PlantUML + * + * @param c Class element + * @param ostr Output stream + */ + void generate(const class_ &c, std::ostream &ostr) const; + + /** + * @brief Render class methods to PlantUML + * + * @param methods List of class methods + * @param ostr Output stream + */ + void generate_methods( + const std::vector &methods, std::ostream &ostr) const; + + /** + * @brief Render class methods to PlantUML in groups + * + * @param methods Methods grouped by method type + * @param ostr Output stream + */ + void generate_methods( + const method_groups_t &methods, std::ostream &ostr) const; + + /** + * @brief Render class method to PlantUML + * + * @param m Class method + * @param ostr Output stream + */ + void generate_method(const class_method &m, std::ostream &ostr) const; + + /** + * @brief Render class member to PlantUML + * + * @param m Class member + * @param ostr Output stream + */ + void generate_member(const class_member &m, std::ostream &ostr) const; + + /** + * @brief Render all relationships in the diagram to PlantUML + * + * @param ostr Output stream + */ + void generate_relationships(std::ostream &ostr) const; + + /** + * @brief Render all relationships originating from class element. + * + * @param c Class element + * @param ostr Output stream + */ + void generate_relationships(const class_ &c, std::ostream &ostr) const; + + /** + * @brief Render a specific relationship to PlantUML. + * + * @param r Relationship model + * @param rendered_relations Set of already rendered relationships, to + * ensure that there are no duplicate + * relationships + */ + void generate_relationship( + const relationship &r, std::set &rendered_relations) const; + + /** + * @brief Render enum element to PlantUML + * + * @param e Enum element + * @param ostr Output stream + */ + void generate(const enum_ &e, std::ostream &ostr) const; + + /** + * @brief Render all relationships originating from enum element. + * + * @param c Enum element + * @param ostr Output stream + */ + void generate_relationships(const enum_ &c, std::ostream &ostr) const; + + /** + * @brief Render concept element to PlantUML + * + * @param c Concept element + * @param ostr Output stream + */ + void generate(const concept_ &c, std::ostream &ostr) const; + + /** + * @brief Render all relationships originating from concept element. + * + * @param c Concept element + * @param ostr Output stream + */ + void generate_relationships(const concept_ &c, std::ostream &ostr) const; + + /** + * @brief Render package element to PlantUML + * + * @param p Package element + * @param ostr Output stream + */ + void generate(const package &p, std::ostream &ostr) const; + + /** + * @brief Render all relationships originating from package element. + * + * @param p Package element + * @param ostr Output stream + */ + void generate_relationships(const package &p, std::ostream &ostr) const; + + /** + * @brief Generate any notes attached specifically to some class element. + * + * @param ostream Output stream + * @param member Class element (member or method) + * @param alias PlantUML class alias + */ + void generate_member_notes(std::ostream &ostream, + const class_element &member, const std::string &alias) const; + + /** + * @brief Generate elements grouped together in `together` groups. + * + * @param ostr Output stream + */ + void generate_groups(std::ostream &ostr) const; + + /** + * @brief Group class methods based on method type. + * + * @param methods List of class methods. + * + * @return Map of method groups. + */ + method_groups_t group_methods( + const std::vector &methods) const; + +private: + const std::vector method_groups_{ + "constructors", "assignment", "operators", "other"}; + + std::string render_name(std::string name) const; + + template + void sort_class_elements(std::vector &elements) const + { + if (config().member_order() == config::member_order_t::lexical) { + std::sort(elements.begin(), elements.end(), + [](const auto &m1, const auto &m2) { + return m1.name() < m2.name(); + }); + } + } + + mutable common::generators::nested_element_stack + together_group_stack_; +}; + +} // namespace mermaid +} // namespace generators +} // namespace class_diagram +} // namespace clanguml diff --git a/src/common/generators/generators.h b/src/common/generators/generators.h index 8f36e386..b4d3b5c1 100644 --- a/src/common/generators/generators.h +++ b/src/common/generators/generators.h @@ -19,6 +19,7 @@ #include "class_diagram/generators/json/class_diagram_generator.h" #include "class_diagram/generators/plantuml/class_diagram_generator.h" +#include "class_diagram/generators/mermaid/class_diagram_generator.h" #include "cli/cli_handler.h" #include "common/compilation_database.h" #include "common/generators/generators.h" @@ -105,6 +106,9 @@ struct plantuml_generator_tag { struct json_generator_tag { inline static const std::string extension = "json"; }; +struct mermaid_generator_tag { + inline static const std::string extension = "mmd"; +}; /** @} */ /** @defgroup diagram_generator_t Diagram generator selector @@ -114,6 +118,7 @@ struct json_generator_tag { * * @{ */ +// plantuml template struct diagram_generator_t; template <> @@ -136,6 +141,7 @@ struct diagram_generator_t { using type = clanguml::include_diagram::generators::plantuml::generator; }; +// json template <> struct diagram_generator_t { @@ -156,6 +162,27 @@ struct diagram_generator_t { using type = clanguml::include_diagram::generators::json::generator; }; +// mermaid +template <> +struct diagram_generator_t { + using type = clanguml::class_diagram::generators::mermaid::generator; +}; +//template <> +//struct diagram_generator_t { +// using type = clanguml::sequence_diagram::generators::mermaid::generator; +//}; +//template <> +//struct diagram_generator_t { +// using type = clanguml::package_diagram::generators::mermaid::generator; +//}; +//template <> +//struct diagram_generator_t { +// using type = clanguml::include_diagram::generators::mermaid::generator; +//}; /** @} */ /** diff --git a/src/common/generators/mermaid/generator.cc b/src/common/generators/mermaid/generator.cc new file mode 100644 index 00000000..3eea909a --- /dev/null +++ b/src/common/generators/mermaid/generator.cc @@ -0,0 +1,75 @@ +/** + * @file src/common/generators/mermaid/generator.h + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "generator.h" + +namespace clanguml::common::generators::mermaid { + +std::string to_mermaid(relationship_t r, const std::string &style) +{ + switch (r) { + case relationship_t::kOwnership: + case relationship_t::kComposition: + return style.empty() ? "*--" : fmt::format("*-[{}]-", style); + case relationship_t::kAggregation: + return style.empty() ? "o--" : fmt::format("o-[{}]-", style); + case relationship_t::kContainment: + return style.empty() ? "--" : fmt::format("-[{}]-", style); + case relationship_t::kAssociation: + return style.empty() ? "-->" : fmt::format("-[{}]->", style); + case relationship_t::kInstantiation: + return style.empty() ? "..|>" : fmt::format(".[{}].|>", style); + case relationship_t::kFriendship: + return style.empty() ? "<.." : fmt::format("<.[{}].", style); + case relationship_t::kDependency: + return style.empty() ? "..>" : fmt::format(".[{}].>", style); + case relationship_t::kConstraint: + return style.empty() ? "..>" : fmt::format(".[{}].>", style); + case relationship_t::kAlias: + return style.empty() ? ".." : fmt::format(".[{}].", style); + default: + return ""; + } +} + +std::string to_mermaid(access_t scope) +{ + switch (scope) { + case access_t::kPublic: + return "+"; + case access_t::kProtected: + return "#"; + case access_t::kPrivate: + return "-"; + default: + return ""; + } +} + +std::string to_mermaid(message_t r) +{ + switch (r) { + case message_t::kCall: + return "->"; + case message_t::kReturn: + return "-->"; + default: + return ""; + } +} + +} // namespace clanguml::common::generators::mermaid diff --git a/src/common/generators/mermaid/generator.h b/src/common/generators/mermaid/generator.h new file mode 100644 index 00000000..111448b8 --- /dev/null +++ b/src/common/generators/mermaid/generator.h @@ -0,0 +1,454 @@ +/** + * @file src/common/generators/mermaid/generator.h + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "common/generators/generator.h" +#include "common/model/diagram_filter.h" +#include "config/config.h" +#include "util/error.h" +#include "util/util.h" +#include "version.h" + +#include +#include +#include +#include +#include +#include + +namespace clanguml::common::generators::mermaid { + +using clanguml::common::model::access_t; +using clanguml::common::model::element; +using clanguml::common::model::message_t; +using clanguml::common::model::relationship_t; + +std::string to_mermaid(relationship_t r, const std::string &style); +std::string to_mermaid(access_t scope); +std::string to_mermaid(message_t r); + +/** + * @brief Base class for diagram generators + * + * @tparam ConfigType Configuration type + * @tparam DiagramType Diagram model type + */ +template +class generator + : public clanguml::common::generators::generator { +public: + /** + * @brief Constructor + * + * @param config Reference to instance of @link clanguml::config::diagram + * @param model Reference to instance of @link clanguml::model::diagram + */ + generator(ConfigType &config, DiagramType &model) + : clanguml::common::generators::generator{ + config, model} + { + init_context(); + init_env(); + } + + ~generator() override = default; + + /** + * @brief Generate diagram + * + * This is the main diagram generation entrypoint. It is responsible for + * calling other methods in appropriate order to generate the diagram into + * the output stream. It generates diagram elements, that are common + * to all types of diagrams in a given generator. + * + * @param ostr Output stream + */ + void generate(std::ostream &ostr) const override; + + /** + * @brief Generate diagram specific part + * + * This method must be implemented in subclasses for specific diagram + * types. + * + * @param ostr Output stream + */ + virtual void generate_diagram(std::ostream &ostr) const = 0; + + /** + * @brief Generate diagram layout hints + * + * This method adds to the diagram any layout hints that were provided + * in the configuration file. + * + * @param ostr Output stream + */ + void generate_config_layout_hints(std::ostream &ostr) const; + + /** + * @brief Generate MermaidJS directives from config file. + * + * This method renders the MermaidJS directives provided in the configuration + * file, including resolving any element aliases and Jinja templates. + * + * @param ostr Output stream + * @param directives List of directives from the configuration file + */ + void generate_mermaid_directives( + std::ostream &ostr, const std::vector &directives) const; + + /** + * @brief Generate diagram notes + * + * This method adds any notes in the diagram, which were declared in the + * code using inline directives + * + * @param ostr Output stream + * @param element Element to which the note should be attached + */ + void generate_notes( + std::ostream &ostr, const model::element &element) const; + + /** + * @brief Generate comment with diagram metadata + * + * @param ostr Output stream + */ + void generate_metadata(std::ostream &ostr) const; + + /** + * @brief Generate hyper link to element + * + * This method renders links to URL's based on templates provided + * in the configuration file (e.g. Git browser with specific line and + * column offset) + * + * @param ostr Output stream + * @param e Reference to diagram element + * @tparam E Diagram element type + */ + template + void generate_link(std::ostream &ostr, const E &e) const; + + /** + * @brief Print debug information in diagram comments + * + * @param m Diagram element to describe + * @param ostr Output stream + */ + void print_debug( + const common::model::source_location &e, std::ostream &ostr) const; + /** + * @brief Update diagram Jinja context + * + * This method updates the diagram context with models properties + * which can be used to render Jinja templates in the diagram (e.g. + * in notes or links) + */ + void update_context() const; + +protected: + const inja::json &context() const; + + inja::Environment &env() const; + + template inja::json element_context(const E &e) const; + +private: + void init_context(); + + void init_env(); + +protected: + mutable std::set m_generated_aliases; + mutable inja::json m_context; + mutable inja::Environment m_env; +}; + +template +const inja::json &generator::context() const +{ + return m_context; +} + +template +inja::Environment &generator::env() const +{ + return m_env; +} + +template +template +inja::json generator::element_context(const E &e) const +{ + auto ctx = context(); + + ctx["element"] = e.context(); + + if (!e.file().empty()) { + std::filesystem::path file{e.file()}; + std::string relative_path = file.string(); +#if _MSC_VER + if (file.is_absolute() && ctx.contains("git")) +#else + if (file.is_absolute() && ctx.template contains("git")) +#endif + relative_path = + std::filesystem::relative(file, ctx["git"]["toplevel"]) + .string(); + + ctx["element"]["source"]["path"] = util::path_to_url(relative_path); + ctx["element"]["source"]["full_path"] = file.string(); + ctx["element"]["source"]["name"] = file.filename().string(); + ctx["element"]["source"]["line"] = e.line(); + } + + const auto maybe_comment = e.comment(); + if (maybe_comment) { + ctx["element"]["comment"] = maybe_comment.value(); + } + + return ctx; +} + +template +void generator::generate(std::ostream &ostr) const +{ + const auto &config = generators::generator::config(); + + update_context(); + + // generate_mermaid_diagram_type(ostr, config); + + generate_mermaid_directives(ostr, config.puml().before); + + generate_diagram(ostr); + + generate_mermaid_directives(ostr, config.puml().after); + + generate_metadata(ostr); +} + +template +void generator::generate_config_layout_hints(std::ostream &ostr) const +{ + using namespace clanguml::util; + + const auto &config = generators::generator::config(); + + // Generate layout hints + for (const auto &[entity_name, hints] : config.layout()) { + for (const auto &hint : hints) { + try { + if (hint.hint == config::hint_t::together) { + // 'together' layout hint is handled separately + } + else if (hint.hint == config::hint_t::row || + hint.hint == config::hint_t::column) { + generate_row_column_hints(ostr, entity_name, hint); + } + else { + generate_position_hints(ostr, entity_name, hint); + } + } + catch (clanguml::error::uml_alias_missing &e) { + LOG_DBG("=== Skipping layout hint '{}' from {} due " + "to: {}", + to_string(hint.hint), entity_name, e.what()); + } + } + } +} + +template +void generator::generate_mermaid_directives( + std::ostream &ostr, const std::vector &directives) const +{ + +} + +template +void generator::generate_notes( + std::ostream &ostr, const model::element &e) const +{ +// const auto &config = generators::generator::config(); +// +// for (const auto &decorator : e.decorators()) { +// auto note = std::dynamic_pointer_cast(decorator); +// if (note && note->applies_to_diagram(config.name)) { +// ostr << "note " << note->position << " of " << e.alias() << '\n' +// << note->text << '\n' +// << "end note\n"; +// } +// } +} + +template +void generator::generate_metadata(std::ostream &ostr) const +{ + const auto &config = generators::generator::config(); + + if (config.generate_metadata()) { + ostr << '\n' + << " %% Generated with clang-uml, version " + << clanguml::version::CLANG_UML_VERSION << '\n' + << " %% LLVM version " << clang::getClangFullVersion() << '\n'; + } +} + +template +void generator::print_debug( + const common::model::source_location &e, std::ostream &ostr) const +{ + const auto &config = generators::generator::config(); + + if (config.debug_mode()) + ostr << " %% " << e.file() << ":" << e.line() << '\n'; +} + +template +std::ostream &operator<<( + std::ostream &os, const generator &g) +{ + g.generate(os); + return os; +} + +template void generator::init_context() +{ + const auto &config = generators::generator::config(); + + if (config.git) { + m_context["git"]["branch"] = config.git().branch; + m_context["git"]["revision"] = config.git().revision; + m_context["git"]["commit"] = config.git().commit; + m_context["git"]["toplevel"] = config.git().toplevel; + } +} + +template void generator::update_context() const +{ + m_context["diagram"] = generators::generator::model().context(); +} + +template void generator::init_env() +{ + const auto &model = generators::generator::model(); + const auto &config = generators::generator::config(); + + // + // Add basic string functions to inja environment + // + + // Check if string is empty + m_env.add_callback("empty", 1, [](inja::Arguments &args) { + return args.at(0)->get().empty(); + }); + + // Remove spaces from the left of a string + m_env.add_callback("ltrim", 1, [](inja::Arguments &args) { + return util::ltrim(args.at(0)->get()); + }); + + // Remove trailing spaces from a string + m_env.add_callback("rtrim", 1, [](inja::Arguments &args) { + return util::rtrim(args.at(0)->get()); + }); + + // Remove spaces before and after a string + m_env.add_callback("trim", 1, [](inja::Arguments &args) { + return util::trim(args.at(0)->get()); + }); + + // Make a string shorted with a limit to + m_env.add_callback("abbrv", 2, [](inja::Arguments &args) { + return util::abbreviate( + args.at(0)->get(), args.at(1)->get()); + }); + + m_env.add_callback("replace", 3, [](inja::Arguments &args) { + std::string result = args[0]->get(); + std::regex pattern(args[1]->get()); + return std::regex_replace(result, pattern, args[2]->get()); + }); + + m_env.add_callback("split", 2, [](inja::Arguments &args) { + return util::split( + args[0]->get(), args[1]->get()); + }); + + // + // Add PlantUML specific functions + // + + // Return the entire element JSON context based on element name + // e.g.: + // {{ element("clanguml::t00050::A").comment }} + // + m_env.add_callback("element", 1, [&model, &config](inja::Arguments &args) { + inja::json res{}; + auto element_opt = model.get_with_namespace( + args[0]->get(), config.using_namespace()); + + if (element_opt.has_value()) + res = element_opt.value().context(); + + return res; + }); + + // Convert C++ entity to PlantUML alias, e.g. + // "note left of {{ alias("A") }}: This is a note" + // Shortcut to: + // {{ element("A").alias }} + // + m_env.add_callback("alias", 1, [&model, &config](inja::Arguments &args) { + auto element_opt = model.get_with_namespace( + args[0]->get(), config.using_namespace()); + + if (!element_opt.has_value()) + throw clanguml::error::uml_alias_missing( + args[0]->get()); + + return element_opt.value().alias(); + }); + + // Get elements' comment: + // "note left of {{ alias("A") }}: {{ comment("A") }}" + // Shortcut to: + // {{ element("A").comment }} + // + m_env.add_callback("comment", 1, [&model, &config](inja::Arguments &args) { + inja::json res{}; + auto element_opt = model.get_with_namespace( + args[0]->get(), config.using_namespace()); + + if (!element_opt.has_value()) + throw clanguml::error::uml_alias_missing( + args[0]->get()); + + auto comment = element_opt.value().comment(); + + if (comment.has_value()) { + assert(comment.value().is_object()); + res = comment.value(); + } + + return res; + }); +} +} // namespace clanguml::common::generators::mermaid \ No newline at end of file diff --git a/src/common/types.h b/src/common/types.h index 3541d61f..a3f828d6 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -36,7 +36,8 @@ using id_t = int64_t; */ enum class generator_type_t { plantuml, /*!< Diagrams will be gnerated in PlantUML format */ - json /*!< Diagrams will be generated in JSON format */ + json, /*!< Diagrams will be generated in JSON format */ + mermaid /*!< Diagrams will be generated in MermaidJS format */ }; std::string to_string(const std::string &s); diff --git a/src/config/config.cc b/src/config/config.cc index a77571ea..9a7b39e4 100644 --- a/src/config/config.cc +++ b/src/config/config.cc @@ -172,6 +172,12 @@ void plantuml::append(const plantuml &r) after.insert(after.end(), r.after.begin(), r.after.end()); } +void mermaid::append(const mermaid &r) +{ + before.insert(before.end(), r.before.begin(), r.before.end()); + after.insert(after.end(), r.after.begin(), r.after.end()); +} + void inheritable_diagram_options::inherit( const inheritable_diagram_options &parent) { diff --git a/src/config/config.h b/src/config/config.h index 8a634c39..a6c95c35 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -125,6 +125,22 @@ struct plantuml { void append(const plantuml &r); }; +/** + * @brief MermaidJS diagram config section + * + * This configuration option can be used to add any MermaidJS directives + * before or after the generated diagram, such as diagram name, or custom + * notes. + */ +struct mermaid { + /*! List of directives to add before diagram */ + std::vector before; + /*! List of directives to add before diagram */ + std::vector after; + + void append(const mermaid &r); +}; + /** * @brief Definition of diagram template */ @@ -430,6 +446,7 @@ struct inheritable_diagram_options { option include{"include"}; option exclude{"exclude"}; option puml{"plantuml", option_inherit_mode::kAppend}; + option mermaid{"mermaid", option_inherit_mode::kAppend}; option generate_method_arguments{ "generate_method_arguments", method_arguments::full}; option group_methods{"group_methods", true}; diff --git a/tests/t00002/test_case.h b/tests/t00002/test_case.h index 4cfd2cfd..ec976f02 100644 --- a/tests/t00002/test_case.h +++ b/tests/t00002/test_case.h @@ -107,4 +107,10 @@ TEST_CASE("t00002", "[test-case][class]") save_json(config.output_directory() + "/" + diagram->name + ".json", j); } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_puml( + config.output_directory() + "/" + diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t00003/test_case.h b/tests/t00003/test_case.h index 33f1774b..c7cb2b7a 100644 --- a/tests/t00003/test_case.h +++ b/tests/t00003/test_case.h @@ -95,4 +95,10 @@ TEST_CASE("t00003", "[test-case][class]") save_json(config.output_directory() + "/" + diagram->name + ".json", j); } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_puml( + config.output_directory() + "/" + diagram->name + ".mmd", mmd); + } } diff --git a/tests/t00004/test_case.h b/tests/t00004/test_case.h index a41d6a2b..316878fe 100644 --- a/tests/t00004/test_case.h +++ b/tests/t00004/test_case.h @@ -91,4 +91,10 @@ TEST_CASE("t00004", "[test-case][class]") save_json(config.output_directory() + "/" + diagram->name + ".json", j); } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_puml( + config.output_directory() + "/" + diagram->name + ".mmd", mmd); + } } diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 1c9b3919..64874fac 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -111,6 +111,24 @@ auto generate_diagram_json( return nlohmann::json::parse(ss.str()); } + +template +auto generate_diagram_mermaid( + std::shared_ptr config, DiagramModel &model) +{ + using diagram_config = DiagramConfig; + using diagram_model = DiagramModel; + using diagram_generator = + typename clanguml::common::generators::diagram_generator_t< + DiagramConfig, + clanguml::common::generators::mermaid_generator_tag>::type; + + std::stringstream ss; + + ss << diagram_generator(dynamic_cast(*config), model); + + return ss.str(); +} } std::unique_ptr generate_class_diagram( @@ -209,6 +227,14 @@ nlohmann::json generate_include_json( config, model); } +std::string generate_class_mermaid( + std::shared_ptr config, + clanguml::class_diagram::model::diagram &model) +{ + return detail::generate_diagram_mermaid( + config, model); +} + void save_puml(const std::string &path, const std::string &puml) { std::filesystem::path p{path}; @@ -229,6 +255,17 @@ void save_json(const std::string &path, const nlohmann::json &j) ofs.close(); } +void save_mermaid(const std::string &path, const std::string &mmd) +{ + std::filesystem::path p{path}; + std::filesystem::create_directory(p.parent_path()); + std::ofstream ofs; + ofs.open(p, std::ofstream::out | std::ofstream::trunc); + ofs << mmd; + ofs.close(); +} + + using namespace clanguml::test::matchers; /// diff --git a/tests/test_cases.h b/tests/test_cases.h index 980cde6f..8c9aa56d 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -20,6 +20,7 @@ #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG #include "class_diagram/generators/plantuml/class_diagram_generator.h" +#include "class_diagram/generators/mermaid/class_diagram_generator.h" #include "class_diagram/model/diagram.h" #include "class_diagram/visitor/translation_unit_visitor.h" #include "common/clang_utils.h" From 084bb20ef7c105145e31be5ee8ae8a8a709a6fcb Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 6 Sep 2023 21:20:57 +0200 Subject: [PATCH 02/24] First working version of Mermaid class diagram generator --- Makefile | 8 +- README.md | 2 +- docs/class_diagrams.md | 2 +- docs/include_diagrams.md | 2 +- docs/package_diagrams.md | 2 +- docs/quick_start.md | 2 +- docs/sequence_diagrams.md | 4 +- docs/test_cases/t00002.md | 2 +- docs/test_cases/t00003.md | 2 +- docs/test_cases/t00004.md | 2 +- docs/test_cases/t00005.md | 2 +- docs/test_cases/t00006.md | 2 +- docs/test_cases/t00007.md | 2 +- docs/test_cases/t00008.md | 2 +- docs/test_cases/t00009.md | 2 +- docs/test_cases/t00010.md | 2 +- docs/test_cases/t00011.md | 2 +- docs/test_cases/t00012.md | 2 +- docs/test_cases/t00013.md | 2 +- docs/test_cases/t00014.md | 2 +- docs/test_cases/t00015.md | 2 +- docs/test_cases/t00016.md | 2 +- docs/test_cases/t00017.md | 2 +- docs/test_cases/t00018.md | 2 +- docs/test_cases/t00019.md | 2 +- docs/test_cases/t00020.md | 2 +- docs/test_cases/t00021.md | 2 +- docs/test_cases/t00022.md | 2 +- docs/test_cases/t00023.md | 2 +- docs/test_cases/t00024.md | 2 +- docs/test_cases/t00025.md | 2 +- docs/test_cases/t00026.md | 2 +- docs/test_cases/t00027.md | 2 +- docs/test_cases/t00028.md | 2 +- docs/test_cases/t00029.md | 2 +- docs/test_cases/t00030.md | 2 +- docs/test_cases/t00031.md | 2 +- docs/test_cases/t00032.md | 2 +- docs/test_cases/t00033.md | 2 +- docs/test_cases/t00034.md | 2 +- docs/test_cases/t00035.md | 2 +- docs/test_cases/t00036.md | 2 +- docs/test_cases/t00037.md | 2 +- docs/test_cases/t00038.md | 2 +- docs/test_cases/t00039.md | 2 +- docs/test_cases/t00040.md | 2 +- docs/test_cases/t00041.md | 2 +- docs/test_cases/t00042.md | 2 +- docs/test_cases/t00043.md | 2 +- docs/test_cases/t00044.md | 2 +- docs/test_cases/t00045.md | 2 +- docs/test_cases/t00046.md | 2 +- docs/test_cases/t00047.md | 2 +- docs/test_cases/t00048.md | 2 +- docs/test_cases/t00049.md | 2 +- docs/test_cases/t00050.md | 2 +- docs/test_cases/t00051.md | 2 +- docs/test_cases/t00052.md | 2 +- docs/test_cases/t00053.md | 2 +- docs/test_cases/t00054.md | 2 +- docs/test_cases/t00055.md | 2 +- docs/test_cases/t00056.md | 2 +- docs/test_cases/t00057.md | 2 +- docs/test_cases/t00058.md | 2 +- docs/test_cases/t00059.md | 2 +- docs/test_cases/t00060.md | 2 +- docs/test_cases/t00061.md | 2 +- docs/test_cases/t00062.md | 2 +- docs/test_cases/t00063.md | 2 +- docs/test_cases/t00064.md | 2 +- docs/test_cases/t00065.md | 2 +- docs/test_cases/t00066.md | 2 +- docs/test_cases/t00067.md | 2 +- docs/test_cases/t20001.md | 2 +- docs/test_cases/t20002.md | 2 +- docs/test_cases/t20003.md | 2 +- docs/test_cases/t20004.md | 2 +- docs/test_cases/t20005.md | 2 +- docs/test_cases/t20006.md | 2 +- docs/test_cases/t20007.md | 2 +- docs/test_cases/t20008.md | 2 +- docs/test_cases/t20009.md | 2 +- docs/test_cases/t20010.md | 2 +- docs/test_cases/t20011.md | 2 +- docs/test_cases/t20012.md | 2 +- docs/test_cases/t20013.md | 2 +- docs/test_cases/t20014.md | 2 +- docs/test_cases/t20015.md | 2 +- docs/test_cases/t20016.md | 2 +- docs/test_cases/t20017.md | 2 +- docs/test_cases/t20018.md | 2 +- docs/test_cases/t20019.md | 2 +- docs/test_cases/t20020.md | 2 +- docs/test_cases/t20021.md | 2 +- docs/test_cases/t20022.md | 2 +- docs/test_cases/t20023.md | 2 +- docs/test_cases/t20024.md | 2 +- docs/test_cases/t20025.md | 2 +- docs/test_cases/t20026.md | 2 +- docs/test_cases/t20027.md | 2 +- docs/test_cases/t20028.md | 2 +- docs/test_cases/t20029.md | 2 +- docs/test_cases/t20030.md | 2 +- docs/test_cases/t20031.md | 2 +- docs/test_cases/t20032.md | 2 +- docs/test_cases/t20033.md | 2 +- docs/test_cases/t20034.md | 2 +- docs/test_cases/t20035.md | 2 +- docs/test_cases/t20036.md | 2 +- docs/test_cases/t30001.md | 2 +- docs/test_cases/t30002.md | 2 +- docs/test_cases/t30003.md | 2 +- docs/test_cases/t30004.md | 2 +- docs/test_cases/t30005.md | 2 +- docs/test_cases/t30006.md | 2 +- docs/test_cases/t30007.md | 2 +- docs/test_cases/t30008.md | 2 +- docs/test_cases/t30009.md | 2 +- docs/test_cases/t30010.md | 2 +- docs/test_cases/t30011.md | 2 +- docs/test_cases/t40001.md | 2 +- docs/test_cases/t40002.md | 2 +- docs/test_cases/t40003.md | 2 +- docs/test_cases/t90000.md | 2 +- .../mermaid/class_diagram_generator.cc | 142 ++++++------------ .../mermaid/class_diagram_generator.h | 24 +-- src/common/generators/generators.h | 32 ++-- src/common/generators/mermaid/generator.cc | 24 +-- src/common/generators/mermaid/generator.h | 37 ++--- src/common/types.h | 2 +- src/config/schema.h | 15 ++ tests/t00002/.clang-uml | 2 +- tests/t00002/test_case.h | 8 +- tests/t00003/.clang-uml | 2 +- tests/t00003/test_case.h | 10 +- tests/t00004/.clang-uml | 2 +- tests/t00004/test_case.h | 10 +- tests/t00005/.clang-uml | 2 +- tests/t00005/test_case.h | 12 +- tests/t00006/.clang-uml | 2 +- tests/t00006/test_case.h | 12 +- tests/t00007/.clang-uml | 2 +- tests/t00007/test_case.h | 12 +- tests/t00008/.clang-uml | 2 +- tests/t00008/test_case.h | 12 +- tests/t00009/.clang-uml | 2 +- tests/t00009/test_case.h | 12 +- tests/t00010/.clang-uml | 2 +- tests/t00010/test_case.h | 12 +- tests/t00011/.clang-uml | 2 +- tests/t00011/test_case.h | 12 +- tests/t00012/.clang-uml | 2 +- tests/t00012/test_case.h | 12 +- tests/t00013/.clang-uml | 2 +- tests/t00013/test_case.h | 12 +- tests/t00014/.clang-uml | 7 +- tests/t00014/test_case.h | 13 +- tests/t00015/.clang-uml | 2 +- tests/t00015/test_case.h | 12 +- tests/t00016/.clang-uml | 2 +- tests/t00016/test_case.h | 12 +- tests/t00017/.clang-uml | 2 +- tests/t00017/test_case.h | 12 +- tests/t00018/.clang-uml | 2 +- tests/t00018/test_case.h | 12 +- tests/t00019/.clang-uml | 2 +- tests/t00019/test_case.h | 12 +- tests/t00020/.clang-uml | 2 +- tests/t00020/test_case.h | 12 +- tests/t00021/.clang-uml | 2 +- tests/t00021/test_case.h | 12 +- tests/t00022/.clang-uml | 2 +- tests/t00022/test_case.h | 10 +- tests/t00023/.clang-uml | 2 +- tests/t00023/test_case.h | 12 +- tests/t00024/.clang-uml | 2 +- tests/t00024/test_case.h | 12 +- tests/t00025/.clang-uml | 2 +- tests/t00025/test_case.h | 12 +- tests/t00026/.clang-uml | 2 +- tests/t00026/test_case.h | 12 +- tests/t00027/.clang-uml | 2 +- tests/t00027/test_case.h | 12 +- tests/t00028/.clang-uml | 2 +- tests/t00028/test_case.h | 12 +- tests/t00029/.clang-uml | 2 +- tests/t00029/test_case.h | 12 +- tests/t00030/.clang-uml | 2 +- tests/t00030/test_case.h | 12 +- tests/t00031/.clang-uml | 2 +- tests/t00031/test_case.h | 12 +- tests/t00032/.clang-uml | 2 +- tests/t00032/test_case.h | 12 +- tests/t00033/.clang-uml | 2 +- tests/t00033/test_case.h | 12 +- tests/t00034/.clang-uml | 2 +- tests/t00034/test_case.h | 12 +- tests/t00035/.clang-uml | 2 +- tests/t00035/test_case.h | 12 +- tests/t00036/.clang-uml | 2 +- tests/t00036/test_case.h | 12 +- tests/t00037/.clang-uml | 2 +- tests/t00037/test_case.h | 12 +- tests/t00038/.clang-uml | 2 +- tests/t00038/test_case.h | 12 +- tests/t00039/.clang-uml | 2 +- tests/t00039/test_case.h | 10 +- tests/t00040/.clang-uml | 2 +- tests/t00040/test_case.h | 12 +- tests/t00041/.clang-uml | 2 +- tests/t00041/test_case.h | 12 +- tests/t00042/.clang-uml | 2 +- tests/t00042/test_case.h | 12 +- tests/t00043/.clang-uml | 2 +- tests/t00043/test_case.h | 12 +- tests/t00044/.clang-uml | 2 +- tests/t00044/test_case.h | 12 +- tests/t00045/.clang-uml | 2 +- tests/t00045/test_case.h | 12 +- tests/t00046/.clang-uml | 2 +- tests/t00046/test_case.h | 12 +- tests/t00047/.clang-uml | 2 +- tests/t00047/test_case.h | 10 +- tests/t00048/.clang-uml | 2 +- tests/t00048/test_case.h | 10 +- tests/t00049/.clang-uml | 2 +- tests/t00049/test_case.h | 10 +- tests/t00050/.clang-uml | 2 +- tests/t00050/test_case.h | 10 +- tests/t00051/.clang-uml | 2 +- tests/t00051/test_case.h | 11 +- tests/t00052/.clang-uml | 2 +- tests/t00052/test_case.h | 10 +- tests/t00053/.clang-uml | 2 +- tests/t00053/test_case.h | 10 +- tests/t00054/.clang-uml | 2 +- tests/t00054/test_case.h | 10 +- tests/t00055/.clang-uml | 2 +- tests/t00055/test_case.h | 10 +- tests/t00056/.clang-uml | 2 +- tests/t00056/test_case.h | 10 +- tests/t00057/.clang-uml | 2 +- tests/t00057/test_case.h | 10 +- tests/t00058/.clang-uml | 2 +- tests/t00058/test_case.h | 10 +- tests/t00059/.clang-uml | 2 +- tests/t00059/test_case.h | 10 +- tests/t00060/.clang-uml | 2 +- tests/t00060/test_case.h | 10 +- tests/t00061/.clang-uml | 2 +- tests/t00061/test_case.h | 10 +- tests/t00062/.clang-uml | 2 +- tests/t00062/test_case.h | 10 +- tests/t00063/.clang-uml | 2 +- tests/t00063/test_case.h | 10 +- tests/t00064/.clang-uml | 2 +- tests/t00064/test_case.h | 10 +- tests/t00065/.clang-uml | 2 +- tests/t00065/test_case.h | 10 +- tests/t00066/.clang-uml | 2 +- tests/t00066/test_case.h | 10 +- tests/t00067/.clang-uml | 2 +- tests/t00067/test_case.h | 10 +- tests/t20001/.clang-uml | 2 +- tests/t20001/test_case.h | 5 +- tests/t20002/.clang-uml | 2 +- tests/t20002/test_case.h | 5 +- tests/t20003/.clang-uml | 2 +- tests/t20003/test_case.h | 5 +- tests/t20004/.clang-uml | 2 +- tests/t20004/test_case.h | 5 +- tests/t20005/.clang-uml | 2 +- tests/t20005/test_case.h | 5 +- tests/t20006/.clang-uml | 2 +- tests/t20006/test_case.h | 5 +- tests/t20007/.clang-uml | 2 +- tests/t20007/test_case.h | 5 +- tests/t20008/.clang-uml | 2 +- tests/t20008/test_case.h | 5 +- tests/t20009/.clang-uml | 2 +- tests/t20009/test_case.h | 5 +- tests/t20010/.clang-uml | 2 +- tests/t20010/test_case.h | 5 +- tests/t20011/.clang-uml | 2 +- tests/t20011/test_case.h | 5 +- tests/t20012/.clang-uml | 2 +- tests/t20012/test_case.h | 5 +- tests/t20013/.clang-uml | 2 +- tests/t20013/test_case.h | 5 +- tests/t20014/.clang-uml | 2 +- tests/t20014/test_case.h | 5 +- tests/t20015/.clang-uml | 2 +- tests/t20015/test_case.h | 5 +- tests/t20016/.clang-uml | 2 +- tests/t20016/test_case.h | 5 +- tests/t20017/.clang-uml | 2 +- tests/t20017/test_case.h | 5 +- tests/t20018/.clang-uml | 2 +- tests/t20018/test_case.h | 5 +- tests/t20019/.clang-uml | 2 +- tests/t20019/test_case.h | 5 +- tests/t20020/.clang-uml | 2 +- tests/t20020/test_case.h | 5 +- tests/t20021/.clang-uml | 2 +- tests/t20021/test_case.h | 5 +- tests/t20022/.clang-uml | 2 +- tests/t20022/test_case.h | 5 +- tests/t20023/.clang-uml | 2 +- tests/t20023/test_case.h | 5 +- tests/t20024/.clang-uml | 2 +- tests/t20024/test_case.h | 5 +- tests/t20025/.clang-uml | 2 +- tests/t20025/test_case.h | 5 +- tests/t20026/.clang-uml | 2 +- tests/t20026/test_case.h | 5 +- tests/t20027/.clang-uml | 2 +- tests/t20027/test_case.h | 5 +- tests/t20028/.clang-uml | 2 +- tests/t20028/test_case.h | 5 +- tests/t20029/.clang-uml | 2 +- tests/t20029/test_case.h | 5 +- tests/t20030/.clang-uml | 2 +- tests/t20030/test_case.h | 5 +- tests/t20031/.clang-uml | 2 +- tests/t20031/test_case.h | 5 +- tests/t20032/.clang-uml | 2 +- tests/t20032/test_case.h | 5 +- tests/t20033/.clang-uml | 2 +- tests/t20033/test_case.h | 5 +- tests/t20034/.clang-uml | 2 +- tests/t20034/test_case.h | 5 +- tests/t20035/.clang-uml | 2 +- tests/t20035/test_case.h | 5 +- tests/t20036/.clang-uml | 2 +- tests/t20036/test_case.h | 5 +- tests/t30001/.clang-uml | 2 +- tests/t30001/test_case.h | 5 +- tests/t30002/.clang-uml | 2 +- tests/t30002/test_case.h | 5 +- tests/t30003/.clang-uml | 2 +- tests/t30003/test_case.h | 5 +- tests/t30004/.clang-uml | 2 +- tests/t30004/test_case.h | 5 +- tests/t30005/.clang-uml | 2 +- tests/t30005/test_case.h | 5 +- tests/t30006/.clang-uml | 2 +- tests/t30006/test_case.h | 5 +- tests/t30007/.clang-uml | 2 +- tests/t30007/test_case.h | 5 +- tests/t30008/.clang-uml | 2 +- tests/t30008/test_case.h | 5 +- tests/t30009/.clang-uml | 2 +- tests/t30009/test_case.h | 5 +- tests/t30010/.clang-uml | 2 +- tests/t30010/test_case.h | 5 +- tests/t30011/.clang-uml | 2 +- tests/t30011/test_case.h | 5 +- tests/t40001/.clang-uml | 2 +- tests/t40001/test_case.h | 5 +- tests/t40002/.clang-uml | 2 +- tests/t40002/test_case.h | 5 +- tests/t40003/.clang-uml | 2 +- tests/t40003/test_case.h | 5 +- tests/t90000/.clang-uml | 2 +- tests/t90000/test_case.h | 2 +- tests/test_cases.cc | 49 +++--- tests/test_cases.h | 2 +- util/generate_mermaid.py | 47 ++++++ util/generate_test_cases_docs.py | 10 +- util/templates/test_cases/.clang-uml | 2 +- util/templates/test_cases/test_case.h | 4 +- util/validate_json.py | 46 ++++++ 372 files changed, 1102 insertions(+), 821 deletions(-) create mode 100644 util/generate_mermaid.py create mode 100644 util/validate_json.py diff --git a/Makefile b/Makefile index 5a07603f..ae3c0b04 100644 --- a/Makefile +++ b/Makefile @@ -93,10 +93,12 @@ test_release: release install: release make -C release install DESTDIR=${DESTDIR} -test_plantuml: test - plantuml -tsvg debug/tests/puml/*.puml +test_diagrams: test + plantuml -tsvg debug/tests/diagrams/puml/*.puml + python3 util/validate_json.py debug/tests/diagrams/json/*.json + python3 util/generate_mermaid.py debug/tests/diagrams/mermaid/*.mmd -document_test_cases: test_plantuml +document_test_cases: test_diagrams python3 util/generate_test_cases_docs.py python3 util/format_svg.py docs/test_cases/*.svg diff --git a/README.md b/README.md index 88f03fc9..5edf5ccd 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ which should be generated by `clang-uml`. Basic example is as follows: ```yaml compilation_database_dir: . -output_directory: puml +output_directory: diagrams diagrams: myproject_class: type: class diff --git a/docs/class_diagrams.md b/docs/class_diagrams.md index 611f02c3..26240c4f 100644 --- a/docs/class_diagrams.md +++ b/docs/class_diagrams.md @@ -18,7 +18,7 @@ The minimal config required to generate a class diagram is presented below: # Path to the directory where `compile_commands.json` can be found compilation_database_dir: _build # Output directory for the diagrams -output_directory: puml +output_directory: diagrams # Diagrams definitions diagrams: # Diagram name diff --git a/docs/include_diagrams.md b/docs/include_diagrams.md index b05f0fbf..0a2041e0 100644 --- a/docs/include_diagrams.md +++ b/docs/include_diagrams.md @@ -15,7 +15,7 @@ The minimal config required to generate an include diagram is presented below: # Path to the directory where `compile_commands.json` can be found compilation_database_dir: _build # Output directory for the diagrams -output_directory: puml +output_directory: diagrams # Diagrams definitions diagrams: # Diagram name diff --git a/docs/package_diagrams.md b/docs/package_diagrams.md index 58543cad..756e3b72 100644 --- a/docs/package_diagrams.md +++ b/docs/package_diagrams.md @@ -15,7 +15,7 @@ The minimal config required to generate a package diagram is presented below: # Path to the directory where `compile_commands.json` can be found compilation_database_dir: _build # Output directory for the diagrams -output_directory: puml +output_directory: diagrams # Diagrams definitions diagrams: # Diagram name diff --git a/docs/quick_start.md b/docs/quick_start.md index 5240f7c6..254a836a 100644 --- a/docs/quick_start.md +++ b/docs/quick_start.md @@ -17,7 +17,7 @@ To add an initial class diagram to your project, follow these steps: # Path to `compile_commands.json` directory compilation_database_dir: . # Path to diagram output directory - output_directory: puml + output_directory: diagrams diagrams: # This is the name of the diagram some_class_diagram: diff --git a/docs/sequence_diagrams.md b/docs/sequence_diagrams.md index 8fe0f54e..9f32dff9 100644 --- a/docs/sequence_diagrams.md +++ b/docs/sequence_diagrams.md @@ -17,7 +17,7 @@ The minimal config required to generate a sequence diagram is presented below: # Path to the directory where `compile_commands.json` can be found compilation_database_dir: _build # Output directory for the diagrams -output_directory: puml +output_directory: diagrams # Diagrams definitions diagrams: # Diagram name @@ -259,7 +259,7 @@ possible to override this order in the diagram definition using ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20029_sequence: type: sequence diff --git a/docs/test_cases/t00002.md b/docs/test_cases/t00002.md index 87e846f6..e36492f1 100644 --- a/docs/test_cases/t00002.md +++ b/docs/test_cases/t00002.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00002_class: type: class diff --git a/docs/test_cases/t00003.md b/docs/test_cases/t00003.md index 45740e26..f5c4d34e 100644 --- a/docs/test_cases/t00003.md +++ b/docs/test_cases/t00003.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00003_class: type: class diff --git a/docs/test_cases/t00004.md b/docs/test_cases/t00004.md index 4200fd7c..55005143 100644 --- a/docs/test_cases/t00004.md +++ b/docs/test_cases/t00004.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00004_class: type: class diff --git a/docs/test_cases/t00005.md b/docs/test_cases/t00005.md index 593827e8..9ab741bc 100644 --- a/docs/test_cases/t00005.md +++ b/docs/test_cases/t00005.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00005_class: type: class diff --git a/docs/test_cases/t00006.md b/docs/test_cases/t00006.md index 87e6e5ba..6bf1d77e 100644 --- a/docs/test_cases/t00006.md +++ b/docs/test_cases/t00006.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00006_class: type: class diff --git a/docs/test_cases/t00007.md b/docs/test_cases/t00007.md index d15b158e..7cb51a11 100644 --- a/docs/test_cases/t00007.md +++ b/docs/test_cases/t00007.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00007_class: type: class diff --git a/docs/test_cases/t00008.md b/docs/test_cases/t00008.md index 951054ad..ba236715 100644 --- a/docs/test_cases/t00008.md +++ b/docs/test_cases/t00008.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00008_class: type: class diff --git a/docs/test_cases/t00009.md b/docs/test_cases/t00009.md index 0355da0a..c71d264a 100644 --- a/docs/test_cases/t00009.md +++ b/docs/test_cases/t00009.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00009_class: type: class diff --git a/docs/test_cases/t00010.md b/docs/test_cases/t00010.md index ee0f92c7..e98defe3 100644 --- a/docs/test_cases/t00010.md +++ b/docs/test_cases/t00010.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00010_class: type: class diff --git a/docs/test_cases/t00011.md b/docs/test_cases/t00011.md index 2acaf086..595a9081 100644 --- a/docs/test_cases/t00011.md +++ b/docs/test_cases/t00011.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00011_class: type: class diff --git a/docs/test_cases/t00012.md b/docs/test_cases/t00012.md index 928cc425..daaf66f9 100644 --- a/docs/test_cases/t00012.md +++ b/docs/test_cases/t00012.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00012_class: type: class diff --git a/docs/test_cases/t00013.md b/docs/test_cases/t00013.md index 52d54c16..28b27b4a 100644 --- a/docs/test_cases/t00013.md +++ b/docs/test_cases/t00013.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00013_class: type: class diff --git a/docs/test_cases/t00014.md b/docs/test_cases/t00014.md index 58885733..71b713b2 100644 --- a/docs/test_cases/t00014.md +++ b/docs/test_cases/t00014.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00014_class: type: class diff --git a/docs/test_cases/t00015.md b/docs/test_cases/t00015.md index 21d85ca6..5ca19533 100644 --- a/docs/test_cases/t00015.md +++ b/docs/test_cases/t00015.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00015_class: type: class diff --git a/docs/test_cases/t00016.md b/docs/test_cases/t00016.md index 20ae6df8..c1ce09d6 100644 --- a/docs/test_cases/t00016.md +++ b/docs/test_cases/t00016.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00016_class: type: class diff --git a/docs/test_cases/t00017.md b/docs/test_cases/t00017.md index ed5f59ce..dbaeb11f 100644 --- a/docs/test_cases/t00017.md +++ b/docs/test_cases/t00017.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00017_class: type: class diff --git a/docs/test_cases/t00018.md b/docs/test_cases/t00018.md index cc9762bd..b87d9cdf 100644 --- a/docs/test_cases/t00018.md +++ b/docs/test_cases/t00018.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00018_class: type: class diff --git a/docs/test_cases/t00019.md b/docs/test_cases/t00019.md index 1651e8f3..ec164484 100644 --- a/docs/test_cases/t00019.md +++ b/docs/test_cases/t00019.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00019_class: type: class diff --git a/docs/test_cases/t00020.md b/docs/test_cases/t00020.md index b8b7ba2d..b4d9a8e9 100644 --- a/docs/test_cases/t00020.md +++ b/docs/test_cases/t00020.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00020_class: type: class diff --git a/docs/test_cases/t00021.md b/docs/test_cases/t00021.md index f9914636..7a70f81b 100644 --- a/docs/test_cases/t00021.md +++ b/docs/test_cases/t00021.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00021_class: type: class diff --git a/docs/test_cases/t00022.md b/docs/test_cases/t00022.md index 33b26714..253d4b4b 100644 --- a/docs/test_cases/t00022.md +++ b/docs/test_cases/t00022.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00022_class: type: class diff --git a/docs/test_cases/t00023.md b/docs/test_cases/t00023.md index 41abff3e..e7b7d97d 100644 --- a/docs/test_cases/t00023.md +++ b/docs/test_cases/t00023.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00023_class: type: class diff --git a/docs/test_cases/t00024.md b/docs/test_cases/t00024.md index b45ba2be..51aa05e7 100644 --- a/docs/test_cases/t00024.md +++ b/docs/test_cases/t00024.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00024_class: type: class diff --git a/docs/test_cases/t00025.md b/docs/test_cases/t00025.md index 96b3d860..e9b6dcf2 100644 --- a/docs/test_cases/t00025.md +++ b/docs/test_cases/t00025.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00025_class: type: class diff --git a/docs/test_cases/t00026.md b/docs/test_cases/t00026.md index f6d0343b..c26438e5 100644 --- a/docs/test_cases/t00026.md +++ b/docs/test_cases/t00026.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00026_class: type: class diff --git a/docs/test_cases/t00027.md b/docs/test_cases/t00027.md index 462e782d..5d72bec2 100644 --- a/docs/test_cases/t00027.md +++ b/docs/test_cases/t00027.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00027_class: type: class diff --git a/docs/test_cases/t00028.md b/docs/test_cases/t00028.md index 1e891cd4..e5485b47 100644 --- a/docs/test_cases/t00028.md +++ b/docs/test_cases/t00028.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00028_class: type: class diff --git a/docs/test_cases/t00029.md b/docs/test_cases/t00029.md index e8b5898d..880fa983 100644 --- a/docs/test_cases/t00029.md +++ b/docs/test_cases/t00029.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00029_class: type: class diff --git a/docs/test_cases/t00030.md b/docs/test_cases/t00030.md index f375d031..58e57173 100644 --- a/docs/test_cases/t00030.md +++ b/docs/test_cases/t00030.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00030_class: type: class diff --git a/docs/test_cases/t00031.md b/docs/test_cases/t00031.md index 456a1c3a..18c5cbab 100644 --- a/docs/test_cases/t00031.md +++ b/docs/test_cases/t00031.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00031_class: type: class diff --git a/docs/test_cases/t00032.md b/docs/test_cases/t00032.md index 8c5756a2..ebdec154 100644 --- a/docs/test_cases/t00032.md +++ b/docs/test_cases/t00032.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00032_class: type: class diff --git a/docs/test_cases/t00033.md b/docs/test_cases/t00033.md index 35542ceb..241c6c20 100644 --- a/docs/test_cases/t00033.md +++ b/docs/test_cases/t00033.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00033_class: type: class diff --git a/docs/test_cases/t00034.md b/docs/test_cases/t00034.md index 84570b84..1eada8f9 100644 --- a/docs/test_cases/t00034.md +++ b/docs/test_cases/t00034.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00034_class: type: class diff --git a/docs/test_cases/t00035.md b/docs/test_cases/t00035.md index 9939fe26..a6172637 100644 --- a/docs/test_cases/t00035.md +++ b/docs/test_cases/t00035.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00035_class: type: class diff --git a/docs/test_cases/t00036.md b/docs/test_cases/t00036.md index 3b68c378..508ee267 100644 --- a/docs/test_cases/t00036.md +++ b/docs/test_cases/t00036.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00036_class: type: class diff --git a/docs/test_cases/t00037.md b/docs/test_cases/t00037.md index 98d4409f..0f4eb8aa 100644 --- a/docs/test_cases/t00037.md +++ b/docs/test_cases/t00037.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00037_class: type: class diff --git a/docs/test_cases/t00038.md b/docs/test_cases/t00038.md index bf67d3cb..17ab9e44 100644 --- a/docs/test_cases/t00038.md +++ b/docs/test_cases/t00038.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00038_class: type: class diff --git a/docs/test_cases/t00039.md b/docs/test_cases/t00039.md index 826bd042..b7ac5aaf 100644 --- a/docs/test_cases/t00039.md +++ b/docs/test_cases/t00039.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00039_class: type: class diff --git a/docs/test_cases/t00040.md b/docs/test_cases/t00040.md index 9987b51a..daed1831 100644 --- a/docs/test_cases/t00040.md +++ b/docs/test_cases/t00040.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00040_class: type: class diff --git a/docs/test_cases/t00041.md b/docs/test_cases/t00041.md index 068b8344..70c8ed07 100644 --- a/docs/test_cases/t00041.md +++ b/docs/test_cases/t00041.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00041_class: type: class diff --git a/docs/test_cases/t00042.md b/docs/test_cases/t00042.md index 784356f9..b6c12cae 100644 --- a/docs/test_cases/t00042.md +++ b/docs/test_cases/t00042.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00042_class: type: class diff --git a/docs/test_cases/t00043.md b/docs/test_cases/t00043.md index 3de9ab65..4da12efb 100644 --- a/docs/test_cases/t00043.md +++ b/docs/test_cases/t00043.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00043_class: type: class diff --git a/docs/test_cases/t00044.md b/docs/test_cases/t00044.md index 26128337..c149a98b 100644 --- a/docs/test_cases/t00044.md +++ b/docs/test_cases/t00044.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00044_class: type: class diff --git a/docs/test_cases/t00045.md b/docs/test_cases/t00045.md index ddbd892a..0b5f4e99 100644 --- a/docs/test_cases/t00045.md +++ b/docs/test_cases/t00045.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00045_class: type: class diff --git a/docs/test_cases/t00046.md b/docs/test_cases/t00046.md index bce68ce3..fe400fcc 100644 --- a/docs/test_cases/t00046.md +++ b/docs/test_cases/t00046.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00046_class: type: class diff --git a/docs/test_cases/t00047.md b/docs/test_cases/t00047.md index d24e203b..e0dd5452 100644 --- a/docs/test_cases/t00047.md +++ b/docs/test_cases/t00047.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00047_class: type: class diff --git a/docs/test_cases/t00048.md b/docs/test_cases/t00048.md index 9a932067..97602829 100644 --- a/docs/test_cases/t00048.md +++ b/docs/test_cases/t00048.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00048_class: type: class diff --git a/docs/test_cases/t00049.md b/docs/test_cases/t00049.md index 708b2d5c..eee6b9de 100644 --- a/docs/test_cases/t00049.md +++ b/docs/test_cases/t00049.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00049_class: type: class diff --git a/docs/test_cases/t00050.md b/docs/test_cases/t00050.md index a233da47..6af63138 100644 --- a/docs/test_cases/t00050.md +++ b/docs/test_cases/t00050.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00050_class: type: class diff --git a/docs/test_cases/t00051.md b/docs/test_cases/t00051.md index f9b463c5..f779ab00 100644 --- a/docs/test_cases/t00051.md +++ b/docs/test_cases/t00051.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00051_class: type: class diff --git a/docs/test_cases/t00052.md b/docs/test_cases/t00052.md index 7a1854fc..074a6b2f 100644 --- a/docs/test_cases/t00052.md +++ b/docs/test_cases/t00052.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00052_class: type: class diff --git a/docs/test_cases/t00053.md b/docs/test_cases/t00053.md index 48f486eb..5bad95ef 100644 --- a/docs/test_cases/t00053.md +++ b/docs/test_cases/t00053.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00053_class: type: class diff --git a/docs/test_cases/t00054.md b/docs/test_cases/t00054.md index 96016cf9..e92614ff 100644 --- a/docs/test_cases/t00054.md +++ b/docs/test_cases/t00054.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00054_class: type: class diff --git a/docs/test_cases/t00055.md b/docs/test_cases/t00055.md index ae2cbd83..5b50b3e0 100644 --- a/docs/test_cases/t00055.md +++ b/docs/test_cases/t00055.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00055_class: type: class diff --git a/docs/test_cases/t00056.md b/docs/test_cases/t00056.md index 22737e67..d2e494ac 100644 --- a/docs/test_cases/t00056.md +++ b/docs/test_cases/t00056.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00056_class: type: class diff --git a/docs/test_cases/t00057.md b/docs/test_cases/t00057.md index 479b3839..7d9a7076 100644 --- a/docs/test_cases/t00057.md +++ b/docs/test_cases/t00057.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00057_class: type: class diff --git a/docs/test_cases/t00058.md b/docs/test_cases/t00058.md index b445768c..29b92be6 100644 --- a/docs/test_cases/t00058.md +++ b/docs/test_cases/t00058.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00058_class: type: class diff --git a/docs/test_cases/t00059.md b/docs/test_cases/t00059.md index 697d368b..f00dc70e 100644 --- a/docs/test_cases/t00059.md +++ b/docs/test_cases/t00059.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00059_class: type: class diff --git a/docs/test_cases/t00060.md b/docs/test_cases/t00060.md index f8b08e7a..fea43baa 100644 --- a/docs/test_cases/t00060.md +++ b/docs/test_cases/t00060.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00060_class: type: class diff --git a/docs/test_cases/t00061.md b/docs/test_cases/t00061.md index ee1771b8..5a1b99f6 100644 --- a/docs/test_cases/t00061.md +++ b/docs/test_cases/t00061.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00061_class: type: class diff --git a/docs/test_cases/t00062.md b/docs/test_cases/t00062.md index 76f740d2..33e3bed7 100644 --- a/docs/test_cases/t00062.md +++ b/docs/test_cases/t00062.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00062_class: type: class diff --git a/docs/test_cases/t00063.md b/docs/test_cases/t00063.md index a91dcf32..3cfd7028 100644 --- a/docs/test_cases/t00063.md +++ b/docs/test_cases/t00063.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00063_class: type: class diff --git a/docs/test_cases/t00064.md b/docs/test_cases/t00064.md index 90c15e14..8a632325 100644 --- a/docs/test_cases/t00064.md +++ b/docs/test_cases/t00064.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00064_class: type: class diff --git a/docs/test_cases/t00065.md b/docs/test_cases/t00065.md index 3dd1227c..cc219cf9 100644 --- a/docs/test_cases/t00065.md +++ b/docs/test_cases/t00065.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00065_class: type: class diff --git a/docs/test_cases/t00066.md b/docs/test_cases/t00066.md index 49953e27..a1a1ce84 100644 --- a/docs/test_cases/t00066.md +++ b/docs/test_cases/t00066.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00066_class: type: class diff --git a/docs/test_cases/t00067.md b/docs/test_cases/t00067.md index d6d5a79e..044dd2a7 100644 --- a/docs/test_cases/t00067.md +++ b/docs/test_cases/t00067.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00067_class: type: class diff --git a/docs/test_cases/t20001.md b/docs/test_cases/t20001.md index 45fd634e..02d86640 100644 --- a/docs/test_cases/t20001.md +++ b/docs/test_cases/t20001.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20001_sequence: type: sequence diff --git a/docs/test_cases/t20002.md b/docs/test_cases/t20002.md index 4469d224..6874730a 100644 --- a/docs/test_cases/t20002.md +++ b/docs/test_cases/t20002.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20002_sequence: type: sequence diff --git a/docs/test_cases/t20003.md b/docs/test_cases/t20003.md index f4dc9ab9..624e3366 100644 --- a/docs/test_cases/t20003.md +++ b/docs/test_cases/t20003.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20003_sequence: type: sequence diff --git a/docs/test_cases/t20004.md b/docs/test_cases/t20004.md index 8a9f41ad..75e7f0af 100644 --- a/docs/test_cases/t20004.md +++ b/docs/test_cases/t20004.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20004_sequence: type: sequence diff --git a/docs/test_cases/t20005.md b/docs/test_cases/t20005.md index ffcd06a5..e27f5940 100644 --- a/docs/test_cases/t20005.md +++ b/docs/test_cases/t20005.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20005_sequence: type: sequence diff --git a/docs/test_cases/t20006.md b/docs/test_cases/t20006.md index 8f31ad6c..414fbb69 100644 --- a/docs/test_cases/t20006.md +++ b/docs/test_cases/t20006.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20006_sequence: type: sequence diff --git a/docs/test_cases/t20007.md b/docs/test_cases/t20007.md index 4a098ee5..780cbe69 100644 --- a/docs/test_cases/t20007.md +++ b/docs/test_cases/t20007.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20007_sequence: type: sequence diff --git a/docs/test_cases/t20008.md b/docs/test_cases/t20008.md index d2e72e27..4878842d 100644 --- a/docs/test_cases/t20008.md +++ b/docs/test_cases/t20008.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20008_sequence: type: sequence diff --git a/docs/test_cases/t20009.md b/docs/test_cases/t20009.md index 3ad191c3..2194e5df 100644 --- a/docs/test_cases/t20009.md +++ b/docs/test_cases/t20009.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20009_sequence: type: sequence diff --git a/docs/test_cases/t20010.md b/docs/test_cases/t20010.md index f9a4a576..a67bff8b 100644 --- a/docs/test_cases/t20010.md +++ b/docs/test_cases/t20010.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20010_sequence: type: sequence diff --git a/docs/test_cases/t20011.md b/docs/test_cases/t20011.md index c354e5e2..84feb92e 100644 --- a/docs/test_cases/t20011.md +++ b/docs/test_cases/t20011.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20011_sequence: type: sequence diff --git a/docs/test_cases/t20012.md b/docs/test_cases/t20012.md index b1415c20..65999936 100644 --- a/docs/test_cases/t20012.md +++ b/docs/test_cases/t20012.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20012_sequence: type: sequence diff --git a/docs/test_cases/t20013.md b/docs/test_cases/t20013.md index 45c8d073..f5ac0dc6 100644 --- a/docs/test_cases/t20013.md +++ b/docs/test_cases/t20013.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20013_sequence: type: sequence diff --git a/docs/test_cases/t20014.md b/docs/test_cases/t20014.md index e6c9bc23..6beb752b 100644 --- a/docs/test_cases/t20014.md +++ b/docs/test_cases/t20014.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20014_sequence: type: sequence diff --git a/docs/test_cases/t20015.md b/docs/test_cases/t20015.md index aa3984e5..95567135 100644 --- a/docs/test_cases/t20015.md +++ b/docs/test_cases/t20015.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20015_sequence: type: sequence diff --git a/docs/test_cases/t20016.md b/docs/test_cases/t20016.md index 52f36349..adc8285d 100644 --- a/docs/test_cases/t20016.md +++ b/docs/test_cases/t20016.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20016_sequence: type: sequence diff --git a/docs/test_cases/t20017.md b/docs/test_cases/t20017.md index b09bedc5..d48751c7 100644 --- a/docs/test_cases/t20017.md +++ b/docs/test_cases/t20017.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20017_sequence: type: sequence diff --git a/docs/test_cases/t20018.md b/docs/test_cases/t20018.md index 6a7506a8..056d985c 100644 --- a/docs/test_cases/t20018.md +++ b/docs/test_cases/t20018.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20018_sequence: type: sequence diff --git a/docs/test_cases/t20019.md b/docs/test_cases/t20019.md index 7bd92ef5..b2abaa3b 100644 --- a/docs/test_cases/t20019.md +++ b/docs/test_cases/t20019.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20019_sequence: type: sequence diff --git a/docs/test_cases/t20020.md b/docs/test_cases/t20020.md index 322a4865..770ea4a1 100644 --- a/docs/test_cases/t20020.md +++ b/docs/test_cases/t20020.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20020_sequence: type: sequence diff --git a/docs/test_cases/t20021.md b/docs/test_cases/t20021.md index a3e7e81a..bcfd778f 100644 --- a/docs/test_cases/t20021.md +++ b/docs/test_cases/t20021.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20021_sequence: type: sequence diff --git a/docs/test_cases/t20022.md b/docs/test_cases/t20022.md index 89d5835c..9412e454 100644 --- a/docs/test_cases/t20022.md +++ b/docs/test_cases/t20022.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20022_sequence: type: sequence diff --git a/docs/test_cases/t20023.md b/docs/test_cases/t20023.md index fb13d0a1..a7b60c0f 100644 --- a/docs/test_cases/t20023.md +++ b/docs/test_cases/t20023.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20023_sequence: type: sequence diff --git a/docs/test_cases/t20024.md b/docs/test_cases/t20024.md index a60056cd..83f56170 100644 --- a/docs/test_cases/t20024.md +++ b/docs/test_cases/t20024.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20024_sequence: type: sequence diff --git a/docs/test_cases/t20025.md b/docs/test_cases/t20025.md index 5e9c2565..5fb534a7 100644 --- a/docs/test_cases/t20025.md +++ b/docs/test_cases/t20025.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20025_sequence: type: sequence diff --git a/docs/test_cases/t20026.md b/docs/test_cases/t20026.md index 15bf509f..4c0397df 100644 --- a/docs/test_cases/t20026.md +++ b/docs/test_cases/t20026.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20026_sequence: type: sequence diff --git a/docs/test_cases/t20027.md b/docs/test_cases/t20027.md index 70edc879..fd7ef6bf 100644 --- a/docs/test_cases/t20027.md +++ b/docs/test_cases/t20027.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20027_sequence: type: sequence diff --git a/docs/test_cases/t20028.md b/docs/test_cases/t20028.md index 10118fce..e89c4a2b 100644 --- a/docs/test_cases/t20028.md +++ b/docs/test_cases/t20028.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20028_sequence: type: sequence diff --git a/docs/test_cases/t20029.md b/docs/test_cases/t20029.md index 4601353b..7d2ab56a 100644 --- a/docs/test_cases/t20029.md +++ b/docs/test_cases/t20029.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20029_sequence: type: sequence diff --git a/docs/test_cases/t20030.md b/docs/test_cases/t20030.md index 90f8cb6b..f6c9be4a 100644 --- a/docs/test_cases/t20030.md +++ b/docs/test_cases/t20030.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20030_sequence: type: sequence diff --git a/docs/test_cases/t20031.md b/docs/test_cases/t20031.md index 7bbeb738..5ee55c41 100644 --- a/docs/test_cases/t20031.md +++ b/docs/test_cases/t20031.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20031_sequence: type: sequence diff --git a/docs/test_cases/t20032.md b/docs/test_cases/t20032.md index a4a1b541..9acdcd66 100644 --- a/docs/test_cases/t20032.md +++ b/docs/test_cases/t20032.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20032_sequence: type: sequence diff --git a/docs/test_cases/t20033.md b/docs/test_cases/t20033.md index e5b0632d..289783cc 100644 --- a/docs/test_cases/t20033.md +++ b/docs/test_cases/t20033.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20033_sequence: type: sequence diff --git a/docs/test_cases/t20034.md b/docs/test_cases/t20034.md index 8e570407..3f779b2b 100644 --- a/docs/test_cases/t20034.md +++ b/docs/test_cases/t20034.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20034_sequence: type: sequence diff --git a/docs/test_cases/t20035.md b/docs/test_cases/t20035.md index 74137990..608bae86 100644 --- a/docs/test_cases/t20035.md +++ b/docs/test_cases/t20035.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20035_sequence: type: sequence diff --git a/docs/test_cases/t20036.md b/docs/test_cases/t20036.md index 8f7cb08c..32ca367e 100644 --- a/docs/test_cases/t20036.md +++ b/docs/test_cases/t20036.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20036_sequence: type: sequence diff --git a/docs/test_cases/t30001.md b/docs/test_cases/t30001.md index 02be978b..8006c1b7 100644 --- a/docs/test_cases/t30001.md +++ b/docs/test_cases/t30001.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30001_package: type: package diff --git a/docs/test_cases/t30002.md b/docs/test_cases/t30002.md index ec4b99e5..5e53ed7f 100644 --- a/docs/test_cases/t30002.md +++ b/docs/test_cases/t30002.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30002_package: type: package diff --git a/docs/test_cases/t30003.md b/docs/test_cases/t30003.md index fc87a937..09d30327 100644 --- a/docs/test_cases/t30003.md +++ b/docs/test_cases/t30003.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30003_package: type: package diff --git a/docs/test_cases/t30004.md b/docs/test_cases/t30004.md index e2005b0a..2303e078 100644 --- a/docs/test_cases/t30004.md +++ b/docs/test_cases/t30004.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30004_package: type: package diff --git a/docs/test_cases/t30005.md b/docs/test_cases/t30005.md index 9b9ca455..2231e69f 100644 --- a/docs/test_cases/t30005.md +++ b/docs/test_cases/t30005.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30005_package: type: package diff --git a/docs/test_cases/t30006.md b/docs/test_cases/t30006.md index 81909a20..62c2fcb4 100644 --- a/docs/test_cases/t30006.md +++ b/docs/test_cases/t30006.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30006_package: type: package diff --git a/docs/test_cases/t30007.md b/docs/test_cases/t30007.md index 2298b863..88407edb 100644 --- a/docs/test_cases/t30007.md +++ b/docs/test_cases/t30007.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30007_package: type: package diff --git a/docs/test_cases/t30008.md b/docs/test_cases/t30008.md index 7ed7b9d5..c6b305da 100644 --- a/docs/test_cases/t30008.md +++ b/docs/test_cases/t30008.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30008_package: type: package diff --git a/docs/test_cases/t30009.md b/docs/test_cases/t30009.md index 7e88afbe..2e1eea17 100644 --- a/docs/test_cases/t30009.md +++ b/docs/test_cases/t30009.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30009_package: type: package diff --git a/docs/test_cases/t30010.md b/docs/test_cases/t30010.md index d64f0317..d46dceba 100644 --- a/docs/test_cases/t30010.md +++ b/docs/test_cases/t30010.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30010_package: type: package diff --git a/docs/test_cases/t30011.md b/docs/test_cases/t30011.md index 9fae3402..ad929ae9 100644 --- a/docs/test_cases/t30011.md +++ b/docs/test_cases/t30011.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30011_package: type: package diff --git a/docs/test_cases/t40001.md b/docs/test_cases/t40001.md index 4693d820..bb63aacf 100644 --- a/docs/test_cases/t40001.md +++ b/docs/test_cases/t40001.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t40001_include: type: include diff --git a/docs/test_cases/t40002.md b/docs/test_cases/t40002.md index 77f4bd5e..78585bb8 100644 --- a/docs/test_cases/t40002.md +++ b/docs/test_cases/t40002.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t40002_include: type: include diff --git a/docs/test_cases/t40003.md b/docs/test_cases/t40003.md index 9069b526..0e6349e7 100644 --- a/docs/test_cases/t40003.md +++ b/docs/test_cases/t40003.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t40003_include: type: include diff --git a/docs/test_cases/t90000.md b/docs/test_cases/t90000.md index 95ffd5ff..aca68865 100644 --- a/docs/test_cases/t90000.md +++ b/docs/test_cases/t90000.md @@ -2,7 +2,7 @@ ## Config ```yaml compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t90000_class: type: class diff --git a/src/class_diagram/generators/mermaid/class_diagram_generator.cc b/src/class_diagram/generators/mermaid/class_diagram_generator.cc index f6c202a8..64fc15aa 100644 --- a/src/class_diagram/generators/mermaid/class_diagram_generator.cc +++ b/src/class_diagram/generators/mermaid/class_diagram_generator.cc @@ -24,9 +24,11 @@ namespace clanguml::class_diagram::generators::mermaid { +using clanguml::common::generators::mermaid::indent; + generator::generator(diagram_config &config, diagram_model &model) : common_generator{config, model} - , together_group_stack_{!config.generate_packages()} + , together_group_stack_{true} { } @@ -37,6 +39,8 @@ std::string generator::render_name(std::string name) const util::replace_all(name, "(", "("); util::replace_all(name, ")", ")"); util::replace_all(name, "##", "::"); + util::replace_all(name, "{", "{"); + util::replace_all(name, "}", "}"); return name; } @@ -44,11 +48,7 @@ std::string generator::render_name(std::string name) const void generator::generate_alias( const common::model::element &c, std::ostream &ostr) const { - std::string full_name; - if (config().generate_packages()) - full_name = c.full_name_no_ns(); - else - full_name = c.full_name(true); + const auto full_name = c.full_name(true); assert(!full_name.empty()); @@ -56,7 +56,8 @@ void generator::generate_alias( auto class_label = config().simplify_template_type(render_name(full_name)); - ostr << " class " << c.alias() << "[\"" << class_label << "\"]\n"; + ostr << indent(1) << "class " << c.alias() << "[\"" << class_label + << "\"]\n"; // Register the added alias m_generated_aliases.emplace(c.alias()); @@ -68,14 +69,14 @@ void generator::generate(const class_ &c, std::ostream &ostr) const std::string class_type{"class"}; - ostr << " class " << c.alias(); + ostr << indent(1) << "class " << c.alias(); ostr << " {" << '\n'; if (c.is_union()) - ostr << " <>\n"; + ostr << indent(2) << "<>\n"; else if (c.is_abstract()) - ostr << " <>\n"; + ostr << indent(2) << "<>\n"; // // Process methods @@ -130,7 +131,7 @@ void generator::generate(const class_ &c, std::ostream &ostr) const ostr << '\n'; } - ostr << " }" << '\n'; + ostr << indent(1) << "}" << '\n'; generate_notes(ostr, c); @@ -211,11 +212,9 @@ void generator::generate_method( print_debug(m, ostr); - std::string intend = " "; - std::string type{uns.relative(config().simplify_template_type(m.type()))}; - ostr << intend << mermaid_common::to_mermaid(m.access()) << m.name(); + ostr << indent(2) << mermaid_common::to_mermaid(m.access()) << m.name(); if (!m.template_params().empty()) { m.render_template_params(ostr, config().using_namespace(), false); @@ -257,7 +256,7 @@ void generator::generate_member( print_debug(m, ostr); - ostr << " " << mermaid_common::to_mermaid(m.access()) << m.name() + ostr << indent(2) << mermaid_common::to_mermaid(m.access()) << m.name() << " : " << render_name( uns.relative(config().simplify_template_type(m.type()))); @@ -265,31 +264,33 @@ void generator::generate_member( void generator::generate(const concept_ &c, std::ostream &ostr) const { - std::string class_type{"class"}; - - ostr << class_type << " " << c.alias() << " <>"; + ostr << indent(1) << "class" + << " " << c.alias(); if (!c.style().empty()) ostr << " " << c.style(); ostr << " {" << '\n'; + ostr << indent(2) << "<>\n"; // TODO: add option to enable/disable this if (c.requires_parameters().size() + c.requires_statements().size() > 0) { std::vector parameters; parameters.reserve(c.requires_parameters().size()); for (const auto &p : c.requires_parameters()) { - parameters.emplace_back(p.to_string(config().using_namespace())); + parameters.emplace_back( + render_name(p.to_string(config().using_namespace()))); } - ostr << fmt::format("({})\n", fmt::join(parameters, ",")); + ostr << indent(2) + << fmt::format("\"({})\"\n", fmt::join(parameters, ",")); - ostr << "..\n"; - - ostr << fmt::format("{}\n", fmt::join(c.requires_statements(), "\n")); + for (const auto &req : c.requires_statements()) { + ostr << indent(2) << fmt::format("\"{}\"\n", render_name(req)); + } } - ostr << " }" << '\n'; + ostr << indent(1) << "}" << '\n'; } void generator::generate_member_notes(std::ostream &ostr, @@ -298,10 +299,8 @@ void generator::generate_member_notes(std::ostream &ostr, for (const auto &decorator : member.decorators()) { auto note = std::dynamic_pointer_cast(decorator); if (note && note->applies_to_diagram(config().name)) { - ostr << "note " << note->position << " of " << alias - << "::" << member.name() << '\n' - << note->text << '\n' - << "end note\n"; + ostr << indent(1) << "note for " << alias << " \"" << note->text + << "\"" << '\n'; } } } @@ -411,7 +410,8 @@ void generator::generate_relationships( m_generated_aliases.end()) continue; - relstr << c.alias() << " " << puml_relation << " " << target_alias; + relstr << indent(1) << c.alias() << " " << puml_relation << " " + << target_alias; if (!r.label().empty()) { relstr << " : " << mermaid_common::to_mermaid(r.access()) @@ -419,7 +419,7 @@ void generator::generate_relationships( rendered_relations.emplace(r.label()); } - if(r.type() == relationship_t::kContainment) { + if (r.type() == relationship_t::kContainment) { relstr << " : [nested]\n"; } @@ -430,7 +430,7 @@ void generator::generate_relationships( LOG_DBG("=== Adding relation {}", relstr.str()); - all_relations_str << " " << relstr.str(); + all_relations_str << relstr.str(); } } catch (error::uml_alias_missing &e) { @@ -451,8 +451,9 @@ void generator::generate_relationships( m_generated_aliases.end()) continue; - relstr << target_alias << " <|-- " << c.alias() << '\n'; - all_relations_str << " " << relstr.str(); + relstr << indent(1) << target_alias << " <|-- " << c.alias() + << '\n'; + all_relations_str << relstr.str(); } catch (error::uml_alias_missing &e) { LOG_DBG("=== Skipping inheritance relation from {} to {} due " @@ -512,7 +513,8 @@ void generator::generate_relationships( m_generated_aliases.end()) continue; - relstr << c.alias() << " " << puml_relation << " " << target_alias; + relstr << indent(1) << c.alias() << " " << puml_relation << " " + << target_alias; if (!r.label().empty()) { relstr << " : " << mermaid_common::to_mermaid(r.access()) @@ -558,7 +560,7 @@ void generator::generate_relationships(const enum_ &e, std::ostream &ostr) const m_generated_aliases.end()) continue; - relstr << e.alias() << " " + relstr << indent(1) << e.alias() << " " << clanguml::common::generators::mermaid::to_mermaid( r.type(), r.style()) << " " << target_alias; @@ -568,7 +570,7 @@ void generator::generate_relationships(const enum_ &e, std::ostream &ostr) const relstr << '\n'; - ostr << " " << relstr.str(); + ostr << relstr.str(); } catch (error::uml_alias_missing &ex) { LOG_DBG("Skipping {} relation from {} to {} due " @@ -582,45 +584,23 @@ void generator::generate_relationships(const enum_ &e, std::ostream &ostr) const void generator::generate(const enum_ &e, std::ostream &ostr) const { - ostr << " class " << e.alias(); + ostr << indent(1) << "class " << e.alias(); ostr << " {" << '\n'; - ostr << " <>\n"; + ostr << indent(2) << "<>\n"; for (const auto &enum_constant : e.constants()) { - ostr << " " << enum_constant << '\n'; + ostr << indent(2) << enum_constant << '\n'; } - ostr << " }" << '\n'; + ostr << indent(1) << "}" << '\n'; generate_notes(ostr, e); } void generator::generate(const package &p, std::ostream &ostr) const { - const auto &uns = config().using_namespace(); - - if (config().generate_packages()) { - LOG_DBG("Generating package {}", p.name()); - - // Don't generate packages from namespaces filtered out by - // using_namespace - if (!uns.starts_with({p.full_name(false)})) { - print_debug(p, ostr); - ostr << "package [" << p.name() << "] "; - ostr << "as " << p.alias(); - - if (p.is_deprecated()) - ostr << " <>"; - - if (!p.style().empty()) - ostr << " " << p.style(); - - ostr << " {" << '\n'; - } - } - for (const auto &subpackage : p) { if (dynamic_cast(subpackage.get()) != nullptr) { // TODO: add option - generate_empty_packages @@ -676,39 +656,6 @@ void generator::generate(const package &p, std::ostream &ostr) const } } } - - if (config().generate_packages()) { - // Now generate any diagram elements which are in together - // groups - for (const auto &[group_name, group_elements] : - together_group_stack_.get_current_groups()) { - ostr << "together {\n"; - - for (auto *e : group_elements) { - if (auto *cls = dynamic_cast(e); cls) { - generate_alias(*cls, ostr); - generate(*cls, ostr); - } - if (auto *enm = dynamic_cast(e); enm) { - generate_alias(*enm, ostr); - generate(*enm, ostr); - } - if (auto *cpt = dynamic_cast(e); cpt) { - generate_alias(*cpt, ostr); - generate(*cpt, ostr); - } - } - - ostr << "}\n"; - } - - // Don't generate packages from namespaces filtered out by - // using_namespace - if (!uns.starts_with({p.full_name(false)})) { - ostr << "}" << '\n'; - generate_notes(ostr, p); - } - } } void generator::generate_relationships( @@ -817,7 +764,6 @@ void generator::generate_groups(std::ostream &ostr) const { for (const auto &[group_name, group_elements] : together_group_stack_.get_current_groups()) { - ostr << "together {\n"; for (auto *e : group_elements) { if (auto *cls = dynamic_cast(e); cls) { @@ -833,9 +779,7 @@ void generator::generate_groups(std::ostream &ostr) const generate(*cpt, ostr); } } - - ostr << "}\n"; } } -} // namespace clanguml::class_diagram::generators::plantuml +} // namespace clanguml::class_diagram::generators::mermaid diff --git a/src/class_diagram/generators/mermaid/class_diagram_generator.h b/src/class_diagram/generators/mermaid/class_diagram_generator.h index b08be5f7..5da861a7 100644 --- a/src/class_diagram/generators/mermaid/class_diagram_generator.h +++ b/src/class_diagram/generators/mermaid/class_diagram_generator.h @@ -91,7 +91,7 @@ public: void generate_top_level_elements(std::ostream &ostr) const; /** - * @brief Generate PlantUML alias for a class element. + * @brief Generate MermaidJS alias for a class element. * * @param c Class element * @param ostr Output stream @@ -100,7 +100,7 @@ public: const common::model::element &e, std::ostream &ostr) const; /** - * @brief Render class element to PlantUML + * @brief Render class element to MermaidJS * * @param c Class element * @param ostr Output stream @@ -108,7 +108,7 @@ public: void generate(const class_ &c, std::ostream &ostr) const; /** - * @brief Render class methods to PlantUML + * @brief Render class methods to MermaidJS * * @param methods List of class methods * @param ostr Output stream @@ -117,7 +117,7 @@ public: const std::vector &methods, std::ostream &ostr) const; /** - * @brief Render class methods to PlantUML in groups + * @brief Render class methods to MermaidJS in groups * * @param methods Methods grouped by method type * @param ostr Output stream @@ -126,7 +126,7 @@ public: const method_groups_t &methods, std::ostream &ostr) const; /** - * @brief Render class method to PlantUML + * @brief Render class method to MermaidJS * * @param m Class method * @param ostr Output stream @@ -134,7 +134,7 @@ public: void generate_method(const class_method &m, std::ostream &ostr) const; /** - * @brief Render class member to PlantUML + * @brief Render class member to MermaidJS * * @param m Class member * @param ostr Output stream @@ -142,7 +142,7 @@ public: void generate_member(const class_member &m, std::ostream &ostr) const; /** - * @brief Render all relationships in the diagram to PlantUML + * @brief Render all relationships in the diagram to MermaidJS * * @param ostr Output stream */ @@ -157,7 +157,7 @@ public: void generate_relationships(const class_ &c, std::ostream &ostr) const; /** - * @brief Render a specific relationship to PlantUML. + * @brief Render a specific relationship to MermaidJS. * * @param r Relationship model * @param rendered_relations Set of already rendered relationships, to @@ -168,7 +168,7 @@ public: const relationship &r, std::set &rendered_relations) const; /** - * @brief Render enum element to PlantUML + * @brief Render enum element to MermaidJS * * @param e Enum element * @param ostr Output stream @@ -184,7 +184,7 @@ public: void generate_relationships(const enum_ &c, std::ostream &ostr) const; /** - * @brief Render concept element to PlantUML + * @brief Render concept element to MermaidJS * * @param c Concept element * @param ostr Output stream @@ -200,7 +200,7 @@ public: void generate_relationships(const concept_ &c, std::ostream &ostr) const; /** - * @brief Render package element to PlantUML + * @brief Render package element to MermaidJS * * @param p Package element * @param ostr Output stream @@ -220,7 +220,7 @@ public: * * @param ostream Output stream * @param member Class element (member or method) - * @param alias PlantUML class alias + * @param alias MermaidJS class alias */ void generate_member_notes(std::ostream &ostream, const class_element &member, const std::string &alias) const; diff --git a/src/common/generators/generators.h b/src/common/generators/generators.h index b4d3b5c1..639a5fe6 100644 --- a/src/common/generators/generators.h +++ b/src/common/generators/generators.h @@ -18,8 +18,8 @@ #pragma once #include "class_diagram/generators/json/class_diagram_generator.h" -#include "class_diagram/generators/plantuml/class_diagram_generator.h" #include "class_diagram/generators/mermaid/class_diagram_generator.h" +#include "class_diagram/generators/plantuml/class_diagram_generator.h" #include "cli/cli_handler.h" #include "common/compilation_database.h" #include "common/generators/generators.h" @@ -168,21 +168,21 @@ struct diagram_generator_t { using type = clanguml::class_diagram::generators::mermaid::generator; }; -//template <> -//struct diagram_generator_t { -// using type = clanguml::sequence_diagram::generators::mermaid::generator; -//}; -//template <> -//struct diagram_generator_t { -// using type = clanguml::package_diagram::generators::mermaid::generator; -//}; -//template <> -//struct diagram_generator_t { -// using type = clanguml::include_diagram::generators::mermaid::generator; -//}; +// template <> +// struct diagram_generator_t { +// using type = clanguml::sequence_diagram::generators::mermaid::generator; +// }; +// template <> +// struct diagram_generator_t { +// using type = clanguml::package_diagram::generators::mermaid::generator; +// }; +// template <> +// struct diagram_generator_t { +// using type = clanguml::include_diagram::generators::mermaid::generator; +// }; /** @} */ /** diff --git a/src/common/generators/mermaid/generator.cc b/src/common/generators/mermaid/generator.cc index 3eea909a..740ac3cb 100644 --- a/src/common/generators/mermaid/generator.cc +++ b/src/common/generators/mermaid/generator.cc @@ -24,23 +24,23 @@ std::string to_mermaid(relationship_t r, const std::string &style) switch (r) { case relationship_t::kOwnership: case relationship_t::kComposition: - return style.empty() ? "*--" : fmt::format("*-[{}]-", style); + return "*--"; case relationship_t::kAggregation: - return style.empty() ? "o--" : fmt::format("o-[{}]-", style); + return "o--"; case relationship_t::kContainment: - return style.empty() ? "--" : fmt::format("-[{}]-", style); + return "--"; case relationship_t::kAssociation: - return style.empty() ? "-->" : fmt::format("-[{}]->", style); + return "-->"; case relationship_t::kInstantiation: - return style.empty() ? "..|>" : fmt::format(".[{}].|>", style); + return "..|>"; case relationship_t::kFriendship: - return style.empty() ? "<.." : fmt::format("<.[{}].", style); + return "<.."; case relationship_t::kDependency: - return style.empty() ? "..>" : fmt::format(".[{}].>", style); + return "..>"; case relationship_t::kConstraint: - return style.empty() ? "..>" : fmt::format(".[{}].>", style); + return "..>"; case relationship_t::kAlias: - return style.empty() ? ".." : fmt::format(".[{}].", style); + return ".."; default: return ""; } @@ -72,4 +72,10 @@ std::string to_mermaid(message_t r) } } +std::string indent(const unsigned level) +{ + const auto kIndentWidth = 4U; + return std::string(level * kIndentWidth, ' '); +} + } // namespace clanguml::common::generators::mermaid diff --git a/src/common/generators/mermaid/generator.h b/src/common/generators/mermaid/generator.h index 111448b8..7eee83c2 100644 --- a/src/common/generators/mermaid/generator.h +++ b/src/common/generators/mermaid/generator.h @@ -42,6 +42,8 @@ std::string to_mermaid(relationship_t r, const std::string &style); std::string to_mermaid(access_t scope); std::string to_mermaid(message_t r); +std::string indent(const unsigned level); + /** * @brief Base class for diagram generators * @@ -103,8 +105,9 @@ public: /** * @brief Generate MermaidJS directives from config file. * - * This method renders the MermaidJS directives provided in the configuration - * file, including resolving any element aliases and Jinja templates. + * This method renders the MermaidJS directives provided in the + * configuration file, including resolving any element aliases and Jinja + * templates. * * @param ostr Output stream * @param directives List of directives from the configuration file @@ -279,23 +282,21 @@ template void generator::generate_mermaid_directives( std::ostream &ostr, const std::vector &directives) const { - } template void generator::generate_notes( std::ostream &ostr, const model::element &e) const { -// const auto &config = generators::generator::config(); -// -// for (const auto &decorator : e.decorators()) { -// auto note = std::dynamic_pointer_cast(decorator); -// if (note && note->applies_to_diagram(config.name)) { -// ostr << "note " << note->position << " of " << e.alias() << '\n' -// << note->text << '\n' -// << "end note\n"; -// } -// } + const auto &config = generators::generator::config(); + + for (const auto &decorator : e.decorators()) { + auto note = std::dynamic_pointer_cast(decorator); + if (note && note->applies_to_diagram(config.name)) { + ostr << indent(1) << "note for " << e.alias() << " \"" << note->text + << "\"" << '\n'; + } + } } template @@ -305,9 +306,9 @@ void generator::generate_metadata(std::ostream &ostr) const if (config.generate_metadata()) { ostr << '\n' - << " %% Generated with clang-uml, version " + << "%% Generated with clang-uml, version " << clanguml::version::CLANG_UML_VERSION << '\n' - << " %% LLVM version " << clang::getClangFullVersion() << '\n'; + << "%% LLVM version " << clang::getClangFullVersion() << '\n'; } } @@ -318,7 +319,7 @@ void generator::print_debug( const auto &config = generators::generator::config(); if (config.debug_mode()) - ostr << " %% " << e.file() << ":" << e.line() << '\n'; + ostr << "%% " << e.file() << ":" << e.line() << '\n'; } template @@ -393,7 +394,7 @@ template void generator::init_env() }); // - // Add PlantUML specific functions + // Add MermaidJS specific functions // // Return the entire element JSON context based on element name @@ -411,7 +412,7 @@ template void generator::init_env() return res; }); - // Convert C++ entity to PlantUML alias, e.g. + // Convert C++ entity to MermaidJS alias, e.g. // "note left of {{ alias("A") }}: This is a note" // Shortcut to: // {{ element("A").alias }} diff --git a/src/common/types.h b/src/common/types.h index a3f828d6..272135bf 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -37,7 +37,7 @@ using id_t = int64_t; enum class generator_type_t { plantuml, /*!< Diagrams will be gnerated in PlantUML format */ json, /*!< Diagrams will be generated in JSON format */ - mermaid /*!< Diagrams will be generated in MermaidJS format */ + mermaid /*!< Diagrams will be generated in MermaidJS format */ }; std::string to_string(const std::string &s); diff --git a/src/config/schema.h b/src/config/schema.h index 54996bc8..a14e55fa 100644 --- a/src/config/schema.h +++ b/src/config/schema.h @@ -150,6 +150,9 @@ types: plantuml: !optional before: !optional [string] after: !optional [string] + mermaid: !optional + before: !optional [string] + after: !optional [string] relative_to: !optional string using_namespace: !optional [string, [string]] generate_metadata: !optional bool @@ -183,6 +186,9 @@ types: plantuml: !optional before: !optional [string] after: !optional [string] + mermaid: !optional + before: !optional [string] + after: !optional [string] relative_to: !optional string using_namespace: !optional [string, [string]] generate_metadata: !optional bool @@ -214,6 +220,9 @@ types: plantuml: !optional before: !optional [string] after: !optional [string] + mermaid: !optional + before: !optional [string] + after: !optional [string] relative_to: !optional string using_namespace: !optional [string, [string]] generate_metadata: !optional bool @@ -239,6 +248,9 @@ types: plantuml: !optional before: !optional [string] after: !optional [string] + mermaid: !optional + before: !optional [string] + after: !optional [string] relative_to: !optional string using_namespace: !optional [string, [string]] generate_metadata: !optional bool @@ -281,6 +293,9 @@ root: plantuml: !optional before: !optional [string] after: !optional [string] + mermaid: !optional + before: !optional [string] + after: !optional [string] relative_to: !optional string using_namespace: !optional [string, [string]] generate_metadata: !optional bool diff --git a/tests/t00002/.clang-uml b/tests/t00002/.clang-uml index c27c8e78..1bb1ed91 100644 --- a/tests/t00002/.clang-uml +++ b/tests/t00002/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00002_class: type: class diff --git a/tests/t00002/test_case.h b/tests/t00002/test_case.h index ec976f02..b376de34 100644 --- a/tests/t00002/test_case.h +++ b/tests/t00002/test_case.h @@ -85,8 +85,7 @@ TEST_CASE("t00002", "[test-case][class]") clanguml::util::get_git_commit()), "as")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -105,12 +104,11 @@ TEST_CASE("t00002", "[test-case][class]") REQUIRE(IsField(j, "E", "as", "std::vector")); REQUIRE(IsAssociation(j, "D", "A", "as")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } { auto mmd = generate_class_mermaid(diagram, *model); - save_puml( - config.output_directory() + "/" + diagram->name + ".mmd", mmd); + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00003/.clang-uml b/tests/t00003/.clang-uml index b783db86..e57c3032 100644 --- a/tests/t00003/.clang-uml +++ b/tests/t00003/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00003_class: type: class diff --git a/tests/t00003/test_case.h b/tests/t00003/test_case.h index c7cb2b7a..102ec684 100644 --- a/tests/t00003/test_case.h +++ b/tests/t00003/test_case.h @@ -73,8 +73,7 @@ TEST_CASE("t00003", "[test-case][class]") REQUIRE_THAT(puml, (IsField("b_", "int"))); REQUIRE_THAT(puml, (IsField("c_", "int"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -93,12 +92,11 @@ TEST_CASE("t00003", "[test-case][class]") REQUIRE(!IsDependency(j, "A", "A")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } { auto mmd = generate_class_mermaid(diagram, *model); - save_puml( - config.output_directory() + "/" + diagram->name + ".mmd", mmd); + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } -} +} \ No newline at end of file diff --git a/tests/t00004/.clang-uml b/tests/t00004/.clang-uml index d9231e66..dceb4e5c 100644 --- a/tests/t00004/.clang-uml +++ b/tests/t00004/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00004_class: type: class diff --git a/tests/t00004/test_case.h b/tests/t00004/test_case.h index 316878fe..1fa72940 100644 --- a/tests/t00004/test_case.h +++ b/tests/t00004/test_case.h @@ -65,8 +65,7 @@ TEST_CASE("t00004", "[test-case][class]") REQUIRE_THAT(puml, IsClass(_A("detail::D::DD"))); REQUIRE_THAT(puml, IsEnum(_A("detail::D::AA"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -89,12 +88,11 @@ TEST_CASE("t00004", "[test-case][class]") REQUIRE(IsClass(j, "detail::D::DD")); REQUIRE(IsEnum(j, "detail::D::AA")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } { auto mmd = generate_class_mermaid(diagram, *model); - save_puml( - config.output_directory() + "/" + diagram->name + ".mmd", mmd); + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } -} +} \ No newline at end of file diff --git a/tests/t00005/.clang-uml b/tests/t00005/.clang-uml index d433a5d5..010559a3 100644 --- a/tests/t00005/.clang-uml +++ b/tests/t00005/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00005_class: type: class diff --git a/tests/t00005/test_case.h b/tests/t00005/test_case.h index 0383deb9..375bf307 100644 --- a/tests/t00005/test_case.h +++ b/tests/t00005/test_case.h @@ -64,8 +64,7 @@ TEST_CASE("t00005", "[test-case][class]") REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("J"), "+j")); REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("K"), "+k")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -98,6 +97,11 @@ TEST_CASE("t00005", "[test-case][class]") REQUIRE(IsAssociation(j, "R", "J", "j")); REQUIRE(IsAssociation(j, "R", "K", "k")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00006/.clang-uml b/tests/t00006/.clang-uml index 9b44b117..1c2231a0 100644 --- a/tests/t00006/.clang-uml +++ b/tests/t00006/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00006_class: type: class diff --git a/tests/t00006/test_case.h b/tests/t00006/test_case.h index 3ed43aa1..dc676dac 100644 --- a/tests/t00006/test_case.h +++ b/tests/t00006/test_case.h @@ -73,8 +73,7 @@ TEST_CASE("t00006", "[test-case][class]") REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("NN"), "+ns")); REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("NNN"), "+ns")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -104,6 +103,11 @@ TEST_CASE("t00006", "[test-case][class]") REQUIRE(IsInstantiation( j, "custom_container", "custom_container")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00007/.clang-uml b/tests/t00007/.clang-uml index 6bd80b76..c6e2cab5 100644 --- a/tests/t00007/.clang-uml +++ b/tests/t00007/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00007_class: type: class diff --git a/tests/t00007/test_case.h b/tests/t00007/test_case.h index ce80ef52..0155b4d7 100644 --- a/tests/t00007/test_case.h +++ b/tests/t00007/test_case.h @@ -43,8 +43,7 @@ TEST_CASE("t00007", "[test-case][class]") REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("B"), "+b")); REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("C"), "+c")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -59,6 +58,11 @@ TEST_CASE("t00007", "[test-case][class]") REQUIRE(IsAssociation(j, "R", "B", "b")); REQUIRE(IsAssociation(j, "R", "C", "c")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00008/.clang-uml b/tests/t00008/.clang-uml index 07c18890..a46ad77c 100644 --- a/tests/t00008/.clang-uml +++ b/tests/t00008/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00008_class: type: class diff --git a/tests/t00008/test_case.h b/tests/t00008/test_case.h index f3288622..189cc2da 100644 --- a/tests/t00008/test_case.h +++ b/tests/t00008/test_case.h @@ -56,8 +56,7 @@ TEST_CASE("t00008", "[test-case][class]") IsInstantiation( _A("E::nested_template"), _A("E::nested_template"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -73,6 +72,11 @@ TEST_CASE("t00008", "[test-case][class]") REQUIRE(IsClassTemplate(j, "E::nested_template")); REQUIRE(IsClass(j, "E::nested_template")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00009/.clang-uml b/tests/t00009/.clang-uml index fd2b5b38..fe115036 100644 --- a/tests/t00009/.clang-uml +++ b/tests/t00009/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00009_class: type: class diff --git a/tests/t00009/test_case.h b/tests/t00009/test_case.h index cbcae450..d0d0b413 100644 --- a/tests/t00009/test_case.h +++ b/tests/t00009/test_case.h @@ -53,8 +53,7 @@ TEST_CASE("t00009", "[test-case][class]") IsAssociation( _A("B"), _A("A>"), "+avector")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -71,6 +70,11 @@ TEST_CASE("t00009", "[test-case][class]") REQUIRE(IsField(j, "B", "astring", "A *")); REQUIRE(IsField(j, "B", "avector", "A> &")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00010/.clang-uml b/tests/t00010/.clang-uml index 1388e6f1..40230948 100644 --- a/tests/t00010/.clang-uml +++ b/tests/t00010/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00010_class: type: class diff --git a/tests/t00010/test_case.h b/tests/t00010/test_case.h index b527ab49..c6d77578 100644 --- a/tests/t00010/test_case.h +++ b/tests/t00010/test_case.h @@ -48,8 +48,7 @@ TEST_CASE("t00010", "[test-case][class]") IsAggregation(_A("B"), _A("A"), "+astring")); REQUIRE_THAT(puml, IsAggregation(_A("C"), _A("B"), "+aintstring")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -64,6 +63,11 @@ TEST_CASE("t00010", "[test-case][class]") REQUIRE(IsField(j, "C", "aintstring", "B")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00011/.clang-uml b/tests/t00011/.clang-uml index 69ef8449..96f0f3bb 100644 --- a/tests/t00011/.clang-uml +++ b/tests/t00011/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00011_class: type: class diff --git a/tests/t00011/test_case.h b/tests/t00011/test_case.h index 99eabbdb..fd44377b 100644 --- a/tests/t00011/test_case.h +++ b/tests/t00011/test_case.h @@ -43,8 +43,7 @@ TEST_CASE("t00011", "[test-case][class]") REQUIRE_THAT(puml, IsFriend(_A("A"), _A("B"))); // REQUIRE_THAT(puml, IsFriend(_A("A"), _A("D"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -56,6 +55,11 @@ TEST_CASE("t00011", "[test-case][class]") REQUIRE(IsClassTemplate(j, "D")); REQUIRE(IsFriend(j, "A", "B")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00012/.clang-uml b/tests/t00012/.clang-uml index a841c472..bb52415c 100644 --- a/tests/t00012/.clang-uml +++ b/tests/t00012/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00012_class: type: class diff --git a/tests/t00012/test_case.h b/tests/t00012/test_case.h index 0d3d4d59..dd108370 100644 --- a/tests/t00012/test_case.h +++ b/tests/t00012/test_case.h @@ -46,8 +46,7 @@ TEST_CASE("t00012", "[test-case][class]") "std::vector>>>,3,3," "3>"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -62,6 +61,11 @@ TEST_CASE("t00012", "[test-case][class]") "C>>>" ",3,3,3>")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00013/.clang-uml b/tests/t00013/.clang-uml index 0b71bf39..60c3939d 100644 --- a/tests/t00013/.clang-uml +++ b/tests/t00013/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00013_class: type: class diff --git a/tests/t00013/test_case.h b/tests/t00013/test_case.h index 14db1799..aa1868bf 100644 --- a/tests/t00013/test_case.h +++ b/tests/t00013/test_case.h @@ -62,8 +62,7 @@ TEST_CASE("t00013", "[test-case][class]") IsInstantiation( _A("G"), _A("G"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -83,6 +82,11 @@ TEST_CASE("t00013", "[test-case][class]") REQUIRE(IsDependency(j, "R", "E")); REQUIRE(IsInstantiation(j, "G", "G")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00014/.clang-uml b/tests/t00014/.clang-uml index 9c3c64e6..59ebf08d 100644 --- a/tests/t00014/.clang-uml +++ b/tests/t00014/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00014_class: type: class @@ -12,4 +12,7 @@ diagrams: - clanguml::t00014 plantuml: before: - - left to right direction \ No newline at end of file + - left to right direction + mermaid: + before: + - direction LR \ No newline at end of file diff --git a/tests/t00014/test_case.h b/tests/t00014/test_case.h index 2fb40c44..5a68b6ed 100644 --- a/tests/t00014/test_case.h +++ b/tests/t00014/test_case.h @@ -146,8 +146,7 @@ TEST_CASE("t00014", "[test-case][class]") puml, IsDependency(_A("R"), _A("A"))); #endif - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -168,6 +167,12 @@ TEST_CASE("t00014", "[test-case][class]") REQUIRE(json::IsClass(j, "A")); REQUIRE(json::IsClass(j, "A")); REQUIRE(json::IsClass(j, "B")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00015/.clang-uml b/tests/t00015/.clang-uml index 38a6ceb5..205cf0a3 100644 --- a/tests/t00015/.clang-uml +++ b/tests/t00015/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00015_class: type: class diff --git a/tests/t00015/test_case.h b/tests/t00015/test_case.h index 604c968c..5c087886 100644 --- a/tests/t00015/test_case.h +++ b/tests/t00015/test_case.h @@ -40,8 +40,7 @@ TEST_CASE("t00015", "[test-case][class]") REQUIRE_THAT(puml, IsClass(_A("ns3::ns1::ns2::Anon"))); REQUIRE_THAT(puml, IsClass(_A("ns3::B"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -54,6 +53,11 @@ TEST_CASE("t00015", "[test-case][class]") REQUIRE(IsClass(j, "ns3::ns1::ns2::Anon")); REQUIRE(IsClass(j, "ns3::B")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00016/.clang-uml b/tests/t00016/.clang-uml index 31881559..300fb4b6 100644 --- a/tests/t00016/.clang-uml +++ b/tests/t00016/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00016_class: type: class diff --git a/tests/t00016/test_case.h b/tests/t00016/test_case.h index e4ead1e0..7acf4419 100644 --- a/tests/t00016/test_case.h +++ b/tests/t00016/test_case.h @@ -52,8 +52,7 @@ TEST_CASE("t00016", "[test-case][class]") IsInstantiation( _A("is_numeric"), _A("is_numeric"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -66,6 +65,11 @@ TEST_CASE("t00016", "[test-case][class]") REQUIRE(IsClass(j, "is_numeric")); REQUIRE(IsClass(j, "is_numeric")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00017/.clang-uml b/tests/t00017/.clang-uml index e6942ec3..d0f1302b 100644 --- a/tests/t00017/.clang-uml +++ b/tests/t00017/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00017_class: type: class diff --git a/tests/t00017/test_case.h b/tests/t00017/test_case.h index 41db6e1e..af74548e 100644 --- a/tests/t00017/test_case.h +++ b/tests/t00017/test_case.h @@ -68,8 +68,7 @@ TEST_CASE("t00017", "[test-case][class]") REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("J"), "-j")); REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("K"), "-k")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -89,6 +88,11 @@ TEST_CASE("t00017", "[test-case][class]") REQUIRE(IsClass(j, "K")); REQUIRE(IsClass(j, "R")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00018/.clang-uml b/tests/t00018/.clang-uml index ed13b17f..ab7fa538 100644 --- a/tests/t00018/.clang-uml +++ b/tests/t00018/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00018_class: type: class diff --git a/tests/t00018/test_case.h b/tests/t00018/test_case.h index a35be404..e19d434e 100644 --- a/tests/t00018/test_case.h +++ b/tests/t00018/test_case.h @@ -42,8 +42,7 @@ TEST_CASE("t00018", "[test-case][class]") REQUIRE_THAT(puml, IsDependency(_A("impl::widget"), _A("widget"))); REQUIRE_THAT(puml, !IsDependency(_A("widget"), _A("widget"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -54,6 +53,11 @@ TEST_CASE("t00018", "[test-case][class]") REQUIRE(IsClass(j, "impl::widget")); REQUIRE(IsDependency(j, "impl::widget", "widget")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00019/.clang-uml b/tests/t00019/.clang-uml index 6a6df084..b4c73903 100644 --- a/tests/t00019/.clang-uml +++ b/tests/t00019/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00019_class: type: class diff --git a/tests/t00019/test_case.h b/tests/t00019/test_case.h index 8b0a4332..90636ddd 100644 --- a/tests/t00019/test_case.h +++ b/tests/t00019/test_case.h @@ -69,8 +69,7 @@ TEST_CASE("t00019", "[test-case][class]") REQUIRE_THAT(puml, !IsAggregation(_A("A"), _A("Base"), "+layers")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -82,6 +81,11 @@ TEST_CASE("t00019", "[test-case][class]") REQUIRE(IsClassTemplate(j, "Layer2")); REQUIRE(IsClassTemplate(j, "Layer3")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00020/.clang-uml b/tests/t00020/.clang-uml index b24214be..5bac46fb 100644 --- a/tests/t00020/.clang-uml +++ b/tests/t00020/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00020_class: type: class diff --git a/tests/t00020/test_case.h b/tests/t00020/test_case.h index e712d770..4a67463b 100644 --- a/tests/t00020/test_case.h +++ b/tests/t00020/test_case.h @@ -44,8 +44,7 @@ TEST_CASE("t00020", "[test-case][class]") REQUIRE_THAT(puml, IsClass(_A("Factory1"))); REQUIRE_THAT(puml, IsClass(_A("Factory2"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -58,6 +57,11 @@ TEST_CASE("t00020", "[test-case][class]") REQUIRE(IsClass(j, "ProductB2")); REQUIRE(IsAbstractClass(j, "AbstractFactory")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00021/.clang-uml b/tests/t00021/.clang-uml index 0f7c063a..f221d426 100644 --- a/tests/t00021/.clang-uml +++ b/tests/t00021/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00021_class: type: class diff --git a/tests/t00021/test_case.h b/tests/t00021/test_case.h index 953f22a4..f951d5dc 100644 --- a/tests/t00021/test_case.h +++ b/tests/t00021/test_case.h @@ -42,8 +42,7 @@ TEST_CASE("t00021", "[test-case][class]") REQUIRE_THAT(puml, IsClass(_A("Visitor2"))); REQUIRE_THAT(puml, IsClass(_A("Visitor3"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -54,6 +53,11 @@ TEST_CASE("t00021", "[test-case][class]") REQUIRE(IsClass(j, "Visitor2")); REQUIRE(IsAbstractClass(j, "Item")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00022/.clang-uml b/tests/t00022/.clang-uml index 6cebb830..08421149 100644 --- a/tests/t00022/.clang-uml +++ b/tests/t00022/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00022_class: type: class diff --git a/tests/t00022/test_case.h b/tests/t00022/test_case.h index 6c258ab7..0d536a20 100644 --- a/tests/t00022/test_case.h +++ b/tests/t00022/test_case.h @@ -38,8 +38,7 @@ TEST_CASE("t00022", "[test-case][class]") REQUIRE_THAT(puml, IsClass(_A("A1"))); REQUIRE_THAT(puml, IsClass(_A("A2"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -50,6 +49,11 @@ TEST_CASE("t00022", "[test-case][class]") REQUIRE(IsClass(j, "A2")); REQUIRE(IsAbstractClass(j, "A")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } diff --git a/tests/t00023/.clang-uml b/tests/t00023/.clang-uml index 90645897..145dd839 100644 --- a/tests/t00023/.clang-uml +++ b/tests/t00023/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00023_class: type: class diff --git a/tests/t00023/test_case.h b/tests/t00023/test_case.h index ba772ce6..245065fa 100644 --- a/tests/t00023/test_case.h +++ b/tests/t00023/test_case.h @@ -38,8 +38,7 @@ TEST_CASE("t00023", "[test-case][class]") REQUIRE_THAT(puml, IsClass(_A("StrategyA"))); REQUIRE_THAT(puml, IsClass(_A("StrategyB"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -50,6 +49,11 @@ TEST_CASE("t00023", "[test-case][class]") REQUIRE(IsClass(j, "StrategyB")); REQUIRE(IsAbstractClass(j, "Strategy")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00024/.clang-uml b/tests/t00024/.clang-uml index f8750c86..79c516f6 100644 --- a/tests/t00024/.clang-uml +++ b/tests/t00024/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00024_class: type: class diff --git a/tests/t00024/test_case.h b/tests/t00024/test_case.h index efd14550..d6f568de 100644 --- a/tests/t00024/test_case.h +++ b/tests/t00024/test_case.h @@ -42,8 +42,7 @@ TEST_CASE("t00024", "[test-case][class]") REQUIRE_THAT(puml, IsBaseClass(_A("Target"), _A("Target2"))); REQUIRE_THAT(puml, IsBaseClass(_A("Target"), _A("Proxy"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -57,6 +56,11 @@ TEST_CASE("t00024", "[test-case][class]") REQUIRE(IsBaseClass(j, "Target", "Target2")); REQUIRE(IsBaseClass(j, "Target", "Proxy")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00025/.clang-uml b/tests/t00025/.clang-uml index 4a32003c..1dd15940 100644 --- a/tests/t00025/.clang-uml +++ b/tests/t00025/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00025_class: type: class diff --git a/tests/t00025/test_case.h b/tests/t00025/test_case.h index ebf745b5..e4ee2950 100644 --- a/tests/t00025/test_case.h +++ b/tests/t00025/test_case.h @@ -52,8 +52,7 @@ TEST_CASE("t00025", "[test-case][class]") REQUIRE_THAT(puml, IsDependency(_A("Proxy"), _A("Target1"))); REQUIRE_THAT(puml, IsDependency(_A("Proxy"), _A("Target2"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -66,6 +65,11 @@ TEST_CASE("t00025", "[test-case][class]") REQUIRE(IsDependency(j, "Proxy", "Target1")); REQUIRE(IsDependency(j, "Proxy", "Target2")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00026/.clang-uml b/tests/t00026/.clang-uml index 33224cee..d406ef09 100644 --- a/tests/t00026/.clang-uml +++ b/tests/t00026/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00026_class: type: class diff --git a/tests/t00026/test_case.h b/tests/t00026/test_case.h index f2ea212c..070789ff 100644 --- a/tests/t00026/test_case.h +++ b/tests/t00026/test_case.h @@ -43,8 +43,7 @@ TEST_CASE("t00026", "[test-case][class]") REQUIRE_THAT(puml, IsInstantiation(_A("Caretaker"), _A("Caretaker"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -55,6 +54,11 @@ TEST_CASE("t00026", "[test-case][class]") REQUIRE(IsClassTemplate(j, "Originator")); REQUIRE(IsInstantiation(j, "Originator", "Originator")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00027/.clang-uml b/tests/t00027/.clang-uml index 27103b8e..64dc709e 100644 --- a/tests/t00027/.clang-uml +++ b/tests/t00027/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00027_class: type: class diff --git a/tests/t00027/test_case.h b/tests/t00027/test_case.h index 376ab6ab..02fa5290 100644 --- a/tests/t00027/test_case.h +++ b/tests/t00027/test_case.h @@ -56,8 +56,7 @@ TEST_CASE("t00027", "[test-case][class]") REQUIRE_THAT(puml, IsAggregation(_A("Window"), _A("Text"), "+description")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -75,6 +74,11 @@ TEST_CASE("t00027", "[test-case][class]") REQUIRE(IsAggregation( j, "Window", "Text", "description")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00028/.clang-uml b/tests/t00028/.clang-uml index 3588d932..ac0f8f09 100644 --- a/tests/t00028/.clang-uml +++ b/tests/t00028/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00028_class: type: class diff --git a/tests/t00028/test_case.h b/tests/t00028/test_case.h index 642d424a..1e0cf880 100644 --- a/tests/t00028/test_case.h +++ b/tests/t00028/test_case.h @@ -63,14 +63,18 @@ note.)"; REQUIRE_THAT( puml, HasMemberNote(_A("R"), "ccc", "left", "Reference to C.")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); using namespace json; - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00029/.clang-uml b/tests/t00029/.clang-uml index 9c673a31..b856a2cd 100644 --- a/tests/t00029/.clang-uml +++ b/tests/t00029/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00029_class: type: class diff --git a/tests/t00029/test_case.h b/tests/t00029/test_case.h index bafe9330..e7481ffa 100644 --- a/tests/t00029/test_case.h +++ b/tests/t00029/test_case.h @@ -53,8 +53,7 @@ TEST_CASE("t00029", "[test-case][class]") REQUIRE_THAT(puml, !IsAggregation(_A("R"), _A("G3"), "+g3")); REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("G4"), "+g4")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -63,6 +62,11 @@ TEST_CASE("t00029", "[test-case][class]") REQUIRE(IsAggregation(j, "R", "G1", "g1")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00030/.clang-uml b/tests/t00030/.clang-uml index 1795565b..8c9e6b2c 100644 --- a/tests/t00030/.clang-uml +++ b/tests/t00030/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00030_class: type: class diff --git a/tests/t00030/test_case.h b/tests/t00030/test_case.h index 282943a7..42195fd4 100644 --- a/tests/t00030/test_case.h +++ b/tests/t00030/test_case.h @@ -48,8 +48,7 @@ TEST_CASE("t00030", "[test-case][class]") REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("D"), "+ddd", "", "1")); REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("E"), "+eee", "", "1")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -58,6 +57,11 @@ TEST_CASE("t00030", "[test-case][class]") REQUIRE(IsAggregation(j, "R", "C", "ccc")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00031/.clang-uml b/tests/t00031/.clang-uml index f06027c1..affa76b5 100644 --- a/tests/t00031/.clang-uml +++ b/tests/t00031/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00031_class: type: class diff --git a/tests/t00031/test_case.h b/tests/t00031/test_case.h index f86f88a0..b5d573ee 100644 --- a/tests/t00031/test_case.h +++ b/tests/t00031/test_case.h @@ -54,8 +54,7 @@ TEST_CASE("t00031", "[test-case][class]") IsAssociationWithStyle( _A("R"), _A("D"), "+ddd", "#blue,plain,thickness=16")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -65,6 +64,11 @@ TEST_CASE("t00031", "[test-case][class]") REQUIRE(IsClass(j, "A")); REQUIRE(IsClassTemplate(j, "C")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00032/.clang-uml b/tests/t00032/.clang-uml index 58018aa0..0c5d4e93 100644 --- a/tests/t00032/.clang-uml +++ b/tests/t00032/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00032_class: type: class diff --git a/tests/t00032/test_case.h b/tests/t00032/test_case.h index 587fd72f..52b69bef 100644 --- a/tests/t00032/test_case.h +++ b/tests/t00032/test_case.h @@ -62,8 +62,7 @@ TEST_CASE("t00032", "[test-case][class]") REQUIRE_THAT( puml, !IsDependency(_A("Overload"), _A("C"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -74,6 +73,11 @@ TEST_CASE("t00032", "[test-case][class]") "Overload")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00033/.clang-uml b/tests/t00033/.clang-uml index 5b474474..74d0bd30 100644 --- a/tests/t00033/.clang-uml +++ b/tests/t00033/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00033_class: type: class diff --git a/tests/t00033/test_case.h b/tests/t00033/test_case.h index f6a1e6da..e5d6d658 100644 --- a/tests/t00033/test_case.h +++ b/tests/t00033/test_case.h @@ -54,8 +54,7 @@ TEST_CASE("t00033", "[test-case][class]") REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A>>>"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -70,6 +69,11 @@ TEST_CASE("t00033", "[test-case][class]") "clanguml::t00033::D>>>>", "B>>")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00034/.clang-uml b/tests/t00034/.clang-uml index 64c130fc..b8198a99 100644 --- a/tests/t00034/.clang-uml +++ b/tests/t00034/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00034_class: type: class diff --git a/tests/t00034/test_case.h b/tests/t00034/test_case.h index 03cc52f1..84766a52 100644 --- a/tests/t00034/test_case.h +++ b/tests/t00034/test_case.h @@ -46,8 +46,7 @@ TEST_CASE("t00034", "[test-case][class]") REQUIRE_THAT( puml, IsInstantiation(_A("drop_void"), _A("drop_void"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -57,6 +56,11 @@ TEST_CASE("t00034", "[test-case][class]") REQUIRE(IsClass(j, "A")); REQUIRE(IsClassTemplate(j, "lift_void")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00035/.clang-uml b/tests/t00035/.clang-uml index e2ab858d..ac19e302 100644 --- a/tests/t00035/.clang-uml +++ b/tests/t00035/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00035_class: type: class diff --git a/tests/t00035/test_case.h b/tests/t00035/test_case.h index 2da5cb57..e280e3bf 100644 --- a/tests/t00035/test_case.h +++ b/tests/t00035/test_case.h @@ -46,8 +46,7 @@ TEST_CASE("t00035", "[test-case][class]") REQUIRE_THAT(puml, IsLayoutHint(_A("Center"), "right", _A("Right"))); REQUIRE_THAT(puml, IsLayoutHint(_A("Center"), "down", _A("Bottom"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -60,6 +59,11 @@ TEST_CASE("t00035", "[test-case][class]") REQUIRE(IsClass(j, "Left")); REQUIRE(IsClass(j, "Right")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00036/.clang-uml b/tests/t00036/.clang-uml index 0c09a1c0..87ac943a 100644 --- a/tests/t00036/.clang-uml +++ b/tests/t00036/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00036_class: type: class diff --git a/tests/t00036/test_case.h b/tests/t00036/test_case.h index fe307bcb..8018919a 100644 --- a/tests/t00036/test_case.h +++ b/tests/t00036/test_case.h @@ -49,8 +49,7 @@ TEST_CASE("t00036", "[test-case][class]") REQUIRE_THAT(puml, IsAggregation(_A("B"), _A("A"), "+a_int")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -67,6 +66,11 @@ TEST_CASE("t00036", "[test-case][class]") REQUIRE(IsPackage(j, "ns1::ns11::ns111")); REQUIRE(IsPackage(j, "ns2")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00037/.clang-uml b/tests/t00037/.clang-uml index 9a8cd532..f2616bd8 100644 --- a/tests/t00037/.clang-uml +++ b/tests/t00037/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00037_class: type: class diff --git a/tests/t00037/test_case.h b/tests/t00037/test_case.h index e3b20bd8..c622a63c 100644 --- a/tests/t00037/test_case.h +++ b/tests/t00037/test_case.h @@ -45,8 +45,7 @@ TEST_CASE("t00037", "[test-case][class]") REQUIRE_THAT( puml, IsAggregation(_A("ST"), _A("ST::(units)"), "-units")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -59,6 +58,11 @@ TEST_CASE("t00037", "[test-case][class]") REQUIRE(IsClass(j, "ST::(dimensions)")); REQUIRE(IsAggregation(j, "ST", "ST::(dimensions)", "dimensions")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00038/.clang-uml b/tests/t00038/.clang-uml index a0f321ac..ab17a394 100644 --- a/tests/t00038/.clang-uml +++ b/tests/t00038/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00038_class: type: class diff --git a/tests/t00038/test_case.h b/tests/t00038/test_case.h index b253ef73..cae0a9a2 100644 --- a/tests/t00038/test_case.h +++ b/tests/t00038/test_case.h @@ -96,8 +96,7 @@ TEST_CASE("t00038", "[test-case][class]") _A("map>"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -108,6 +107,11 @@ TEST_CASE("t00038", "[test-case][class]") REQUIRE(IsClass(j, "B")); REQUIRE(IsClass(j, "C")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00039/.clang-uml b/tests/t00039/.clang-uml index 4ba5bdca..31a1d55c 100644 --- a/tests/t00039/.clang-uml +++ b/tests/t00039/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00039_class: type: class diff --git a/tests/t00039/test_case.h b/tests/t00039/test_case.h index e3871e20..358af15c 100644 --- a/tests/t00039/test_case.h +++ b/tests/t00039/test_case.h @@ -63,8 +63,7 @@ TEST_CASE("t00039", "[test-case][class]") REQUIRE_THAT(puml, IsClassTemplate("ns3::FE", "T,M")); REQUIRE_THAT(puml, IsClassTemplate("ns3::FFF", "T,M,N")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -84,6 +83,11 @@ TEST_CASE("t00039", "[test-case][class]") REQUIRE(IsClassTemplate(j, "ns3::F")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } diff --git a/tests/t00040/.clang-uml b/tests/t00040/.clang-uml index 20744d33..ea120d19 100644 --- a/tests/t00040/.clang-uml +++ b/tests/t00040/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00040_class: type: class diff --git a/tests/t00040/test_case.h b/tests/t00040/test_case.h index 7d58e4b6..c2e48012 100644 --- a/tests/t00040/test_case.h +++ b/tests/t00040/test_case.h @@ -45,8 +45,7 @@ TEST_CASE("t00040", "[test-case][class]") REQUIRE_THAT(puml, !IsDependency(_A("R"), _A("A"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -57,6 +56,11 @@ TEST_CASE("t00040", "[test-case][class]") REQUIRE(IsClass(j, "AA")); REQUIRE(IsClass(j, "AAA")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00041/.clang-uml b/tests/t00041/.clang-uml index 502eba3f..191ba681 100644 --- a/tests/t00041/.clang-uml +++ b/tests/t00041/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00041_class: type: class diff --git a/tests/t00041/test_case.h b/tests/t00041/test_case.h index 9d1e634e..f84812d1 100644 --- a/tests/t00041/test_case.h +++ b/tests/t00041/test_case.h @@ -65,8 +65,7 @@ TEST_CASE("t00041", "[test-case][class]") REQUIRE_THAT(puml, IsBaseClass(_A("ns1::N"), _A("ns1::NN"))); REQUIRE_THAT(puml, IsBaseClass(_A("ns1::N"), _A("ns1::NM"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -83,6 +82,11 @@ TEST_CASE("t00041", "[test-case][class]") REQUIRE(IsAssociation(j, "D", "RR", "rr")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00042/.clang-uml b/tests/t00042/.clang-uml index c15333de..cdd55719 100644 --- a/tests/t00042/.clang-uml +++ b/tests/t00042/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00042_class: type: class diff --git a/tests/t00042/test_case.h b/tests/t00042/test_case.h index 3b662d5c..3de29443 100644 --- a/tests/t00042/test_case.h +++ b/tests/t00042/test_case.h @@ -40,8 +40,7 @@ TEST_CASE("t00042", "[test-case][class]") REQUIRE_THAT(puml, IsClassTemplate("B", "T,K")); REQUIRE_THAT(puml, !IsClassTemplate("C", "T")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -51,6 +50,11 @@ TEST_CASE("t00042", "[test-case][class]") REQUIRE(IsClassTemplate(j, "A")); REQUIRE(IsClassTemplate(j, "B")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00043/.clang-uml b/tests/t00043/.clang-uml index 404fc413..6ca42b14 100644 --- a/tests/t00043/.clang-uml +++ b/tests/t00043/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00043_class: type: class diff --git a/tests/t00043/test_case.h b/tests/t00043/test_case.h index 58f1ca9f..b2fadaa2 100644 --- a/tests/t00043/test_case.h +++ b/tests/t00043/test_case.h @@ -63,8 +63,7 @@ TEST_CASE("t00043", "[test-case][class]") REQUIRE_THAT(puml, IsDependency(_A("I"), _A("H"))); REQUIRE_THAT(puml, IsDependency(_A("J"), _A("I"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -85,6 +84,11 @@ TEST_CASE("t00043", "[test-case][class]") REQUIRE(IsDependency(j, "dependencies::J", "dependencies::I")); REQUIRE(IsDependency(j, "dependencies::H", "dependencies::G")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00044/.clang-uml b/tests/t00044/.clang-uml index 69dab8ac..b0e819d2 100644 --- a/tests/t00044/.clang-uml +++ b/tests/t00044/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00044_class: type: class diff --git a/tests/t00044/test_case.h b/tests/t00044/test_case.h index ef2010e3..831a0d34 100644 --- a/tests/t00044/test_case.h +++ b/tests/t00044/test_case.h @@ -64,8 +64,7 @@ TEST_CASE("t00044", "[test-case][class]") IsInstantiation(_A("signal_handler"), _A("signal_handler"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -80,6 +79,11 @@ TEST_CASE("t00044", "[test-case][class]") j, "sink>")); REQUIRE(IsClass(j, "R")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00045/.clang-uml b/tests/t00045/.clang-uml index 84b35cfc..51184d16 100644 --- a/tests/t00045/.clang-uml +++ b/tests/t00045/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00045_class: type: class diff --git a/tests/t00045/test_case.h b/tests/t00045/test_case.h index c198c0e2..35965dd2 100644 --- a/tests/t00045/test_case.h +++ b/tests/t00045/test_case.h @@ -66,8 +66,7 @@ TEST_CASE("t00045", "[test-case][class]") // REQUIRE_THAT(puml, IsFriend(_A("ns1::ns2::R"), // _A("AAAA"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -85,6 +84,11 @@ TEST_CASE("t00045", "[test-case][class]") REQUIRE(IsBaseClass(j, "ns1::ns2::A", "ns1::ns2::B")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00046/.clang-uml b/tests/t00046/.clang-uml index cea73ccf..9a3b0f50 100644 --- a/tests/t00046/.clang-uml +++ b/tests/t00046/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00046_class: type: class diff --git a/tests/t00046/test_case.h b/tests/t00046/test_case.h index bae8a3c1..d79a5ee4 100644 --- a/tests/t00046/test_case.h +++ b/tests/t00046/test_case.h @@ -43,8 +43,7 @@ TEST_CASE("t00046", "[test-case][class]") REQUIRE_THAT(puml, IsField("i", "std::vector")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -56,6 +55,11 @@ TEST_CASE("t00046", "[test-case][class]") REQUIRE(get_element(j, "ns1::A").value()["type"] == "class"); REQUIRE(get_element(j, "ns1::ns2::D").value()["type"] == "class"); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } -} + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } +} \ No newline at end of file diff --git a/tests/t00047/.clang-uml b/tests/t00047/.clang-uml index 9ea39aed..0072a2cc 100644 --- a/tests/t00047/.clang-uml +++ b/tests/t00047/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00047_class: type: class diff --git a/tests/t00047/test_case.h b/tests/t00047/test_case.h index 4a83feb2..3398fe1e 100644 --- a/tests/t00047/test_case.h +++ b/tests/t00047/test_case.h @@ -43,8 +43,7 @@ TEST_CASE("t00047", "[test-case][class]") REQUIRE_THAT(puml, IsClassTemplate("conditional_t", "std::false_type,Result,Tail...")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -56,6 +55,11 @@ TEST_CASE("t00047", "[test-case][class]") REQUIRE(IsClass(j, "conditional_t")); REQUIRE(IsClass(j, "conditional_t")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00048/.clang-uml b/tests/t00048/.clang-uml index e3e44fbc..ecbc732a 100644 --- a/tests/t00048/.clang-uml +++ b/tests/t00048/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00048_class: type: class diff --git a/tests/t00048/test_case.h b/tests/t00048/test_case.h index 3cd4616f..7c19e9e5 100644 --- a/tests/t00048/test_case.h +++ b/tests/t00048/test_case.h @@ -49,8 +49,7 @@ TEST_CASE("t00048", "[test-case][class]") REQUIRE_THAT(puml, IsBaseClass(_A("Base"), _A("A"))); REQUIRE_THAT(puml, IsBaseClass(_A("Base"), _A("B"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -64,6 +63,11 @@ TEST_CASE("t00048", "[test-case][class]") REQUIRE(IsBaseClass(j, "Base", "A")); REQUIRE(IsBaseClass(j, "Base", "B")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00049/.clang-uml b/tests/t00049/.clang-uml index b8653678..13eb1cea 100644 --- a/tests/t00049/.clang-uml +++ b/tests/t00049/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00049_class: type: class diff --git a/tests/t00049/test_case.h b/tests/t00049/test_case.h index 1b94a090..1fb001eb 100644 --- a/tests/t00049/test_case.h +++ b/tests/t00049/test_case.h @@ -57,8 +57,7 @@ TEST_CASE("t00049", "[test-case][class]") REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -69,6 +68,11 @@ TEST_CASE("t00049", "[test-case][class]") REQUIRE(IsClassTemplate(j, "A")); REQUIRE(IsInstantiation(j, "A", "A")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00050/.clang-uml b/tests/t00050/.clang-uml index bf7ef914..2b06a49d 100644 --- a/tests/t00050/.clang-uml +++ b/tests/t00050/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00050_class: type: class diff --git a/tests/t00050/test_case.h b/tests/t00050/test_case.h index 5f4ae9f0..5e5d5bf6 100644 --- a/tests/t00050/test_case.h +++ b/tests/t00050/test_case.h @@ -54,8 +54,7 @@ TEST_CASE("t00050", "[test-case][class]") REQUIRE_THAT(puml, HasNote(_A("G"), "bottom")); REQUIRE_THAT(puml, HasNote(_A("G"), "right")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -68,6 +67,11 @@ TEST_CASE("t00050", "[test-case][class]") REQUIRE(IsClass(j, "utils::D")); REQUIRE(IsEnum(j, "E")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00051/.clang-uml b/tests/t00051/.clang-uml index 4cb46059..1e6daa3a 100644 --- a/tests/t00051/.clang-uml +++ b/tests/t00051/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00051_class: type: class diff --git a/tests/t00051/test_case.h b/tests/t00051/test_case.h index a90f27b9..dece426e 100644 --- a/tests/t00051/test_case.h +++ b/tests/t00051/test_case.h @@ -73,10 +73,8 @@ TEST_CASE("t00051", "[test-case][class]") _A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " "at ../../tests/t00051/t00051.cc:43:27)>"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } - { auto j = generate_class_json(diagram, *model); @@ -86,6 +84,11 @@ TEST_CASE("t00051", "[test-case][class]") REQUIRE(IsInnerClass(j, "A", "A::custom_thread1")); REQUIRE(IsInnerClass(j, "A", "A::custom_thread2")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00052/.clang-uml b/tests/t00052/.clang-uml index c02dbe15..aa5a68c0 100644 --- a/tests/t00052/.clang-uml +++ b/tests/t00052/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00052_class: type: class diff --git a/tests/t00052/test_case.h b/tests/t00052/test_case.h index b15b080a..0971db6a 100644 --- a/tests/t00052/test_case.h +++ b/tests/t00052/test_case.h @@ -48,8 +48,7 @@ TEST_CASE("t00052", "[test-case][class]") REQUIRE_THAT(puml, (IsMethod("b", "T", "T t"))); REQUIRE_THAT(puml, (IsMethod("bb", "T", "F && f, T t"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -59,6 +58,11 @@ TEST_CASE("t00052", "[test-case][class]") REQUIRE(IsClass(j, "A")); REQUIRE(IsClassTemplate(j, "B")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00053/.clang-uml b/tests/t00053/.clang-uml index 45e67c0b..628a1237 100644 --- a/tests/t00053/.clang-uml +++ b/tests/t00053/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00053_class: type: class diff --git a/tests/t00053/test_case.h b/tests/t00053/test_case.h index 71edfe48..fe4923c4 100644 --- a/tests/t00053/test_case.h +++ b/tests/t00053/test_case.h @@ -52,8 +52,7 @@ TEST_CASE("t00053", "[test-case][class]") REQUIRE_THAT(puml, IsClass(_A("F"))); REQUIRE_THAT(puml, IsClass(_A("G"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -77,6 +76,11 @@ TEST_CASE("t00053", "[test-case][class]") REQUIRE(IsClass(j, "F")); REQUIRE(IsClass(j, "G")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00054/.clang-uml b/tests/t00054/.clang-uml index 3bd9b035..6000cf79 100644 --- a/tests/t00054/.clang-uml +++ b/tests/t00054/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00054_class: type: class diff --git a/tests/t00054/test_case.h b/tests/t00054/test_case.h index b7cdecd9..b844e394 100644 --- a/tests/t00054/test_case.h +++ b/tests/t00054/test_case.h @@ -56,8 +56,7 @@ TEST_CASE("t00054", "[test-case][class]") REQUIRE_THAT(puml, IsEnum(_A("h"))); REQUIRE_THAT(puml, IsEnum(_A("j"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -85,6 +84,11 @@ TEST_CASE("t00054", "[test-case][class]") REQUIRE(IsEnum(j, "detail4::h")); REQUIRE(IsEnum(j, "detail4::j")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00055/.clang-uml b/tests/t00055/.clang-uml index f7bcd5b2..88c6a6f2 100644 --- a/tests/t00055/.clang-uml +++ b/tests/t00055/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00055_class: type: class diff --git a/tests/t00055/test_case.h b/tests/t00055/test_case.h index 44247877..391555a5 100644 --- a/tests/t00055/test_case.h +++ b/tests/t00055/test_case.h @@ -57,8 +57,7 @@ TEST_CASE("t00055", "[test-case][class]") REQUIRE_THAT(puml, IsLayoutHint(_A("F"), "down", _A("H"))); REQUIRE_THAT(puml, IsLayoutHint(_A("H"), "down", _A("J"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -77,6 +76,11 @@ TEST_CASE("t00055", "[test-case][class]") REQUIRE(IsClass(j, "I")); REQUIRE(IsClass(j, "J")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00056/.clang-uml b/tests/t00056/.clang-uml index 64345fc7..58b5f2af 100644 --- a/tests/t00056/.clang-uml +++ b/tests/t00056/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00056_class: type: class diff --git a/tests/t00056/test_case.h b/tests/t00056/test_case.h index ae8a6a3b..2852bd3a 100644 --- a/tests/t00056/test_case.h +++ b/tests/t00056/test_case.h @@ -116,8 +116,7 @@ TEST_CASE("t00056", "[test-case][class]") IsConstraint( _A("F"), _A("greater_than_simple"), "T1,T3")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_class_json(diagram, *model); @@ -133,6 +132,11 @@ TEST_CASE("t00056", "[test-case][class]") REQUIRE(IsConcept(j, "iterable_with_value_type")); REQUIRE(IsConcept(j, "iterable_or_small_value_type")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00057/.clang-uml b/tests/t00057/.clang-uml index 6ce6b2aa..1bd80828 100644 --- a/tests/t00057/.clang-uml +++ b/tests/t00057/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00057_class: type: class diff --git a/tests/t00057/test_case.h b/tests/t00057/test_case.h index 1d5eddc5..7783304f 100644 --- a/tests/t00057/test_case.h +++ b/tests/t00057/test_case.h @@ -59,8 +59,7 @@ TEST_CASE("t00057", "[test-case][class]") REQUIRE_THAT(puml, IsAggregation(_A("t00057_E"), _A("t00057_E::(height)"), "+height")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -77,6 +76,11 @@ TEST_CASE("t00057", "[test-case][class]") REQUIRE(get_element(j, "t00057_G").value()["type"] == "class"); REQUIRE(get_element(j, "t00057_R").value()["type"] == "class"); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00058/.clang-uml b/tests/t00058/.clang-uml index dfc6afb4..2732bc62 100644 --- a/tests/t00058/.clang-uml +++ b/tests/t00058/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00058_class: type: class diff --git a/tests/t00058/test_case.h b/tests/t00058/test_case.h index 198f9aba..1ac074ab 100644 --- a/tests/t00058/test_case.h +++ b/tests/t00058/test_case.h @@ -66,8 +66,7 @@ TEST_CASE("t00058", "[test-case][class]") IsDependency(_A("same_as_first_type"), _A("first_type"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -79,6 +78,11 @@ TEST_CASE("t00058", "[test-case][class]") REQUIRE(IsClass( j, "B>")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00059/.clang-uml b/tests/t00059/.clang-uml index 94adde8e..aea07570 100644 --- a/tests/t00059/.clang-uml +++ b/tests/t00059/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00059_class: type: class diff --git a/tests/t00059/test_case.h b/tests/t00059/test_case.h index 0ec40ec7..54211c31 100644 --- a/tests/t00059/test_case.h +++ b/tests/t00059/test_case.h @@ -86,8 +86,7 @@ TEST_CASE("t00059", "[test-case][class]") IsInstantiation(_A("fruit_factory"), _A("fruit_factory"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -99,6 +98,11 @@ TEST_CASE("t00059", "[test-case][class]") REQUIRE(IsConcept(j, "apple_c")); REQUIRE(IsConcept(j, "orange_c")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00060/.clang-uml b/tests/t00060/.clang-uml index 8e127f89..a3e0feb5 100644 --- a/tests/t00060/.clang-uml +++ b/tests/t00060/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00060_class: type: class diff --git a/tests/t00060/test_case.h b/tests/t00060/test_case.h index c280890c..c38b6490 100644 --- a/tests/t00060/test_case.h +++ b/tests/t00060/test_case.h @@ -47,8 +47,7 @@ TEST_CASE("t00060", "[test-case][class]") REQUIRE_THAT(puml, IsClassTemplate("G", "T")); REQUIRE_THAT(puml, IsClassTemplate("H", "T,P")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -63,6 +62,11 @@ TEST_CASE("t00060", "[test-case][class]") REQUIRE(!IsClass(j, "E")); REQUIRE(!IsClass(j, "F")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00061/.clang-uml b/tests/t00061/.clang-uml index c7c9ca95..7746905a 100644 --- a/tests/t00061/.clang-uml +++ b/tests/t00061/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00061_class: type: class diff --git a/tests/t00061/test_case.h b/tests/t00061/test_case.h index 38903fc8..57748bf9 100644 --- a/tests/t00061/test_case.h +++ b/tests/t00061/test_case.h @@ -40,8 +40,7 @@ TEST_CASE("t00061", "[test-case][class]") REQUIRE_THAT(puml, !IsClass(_A("B"))); REQUIRE_THAT(puml, !IsClass(_A("C"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -53,6 +52,11 @@ TEST_CASE("t00061", "[test-case][class]") REQUIRE(!IsClass(j, "B")); REQUIRE(!IsClass(j, "C")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00062/.clang-uml b/tests/t00062/.clang-uml index 50736f34..23540c84 100644 --- a/tests/t00062/.clang-uml +++ b/tests/t00062/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00062_class: type: class diff --git a/tests/t00062/test_case.h b/tests/t00062/test_case.h index 054419d5..31ab4eff 100644 --- a/tests/t00062/test_case.h +++ b/tests/t00062/test_case.h @@ -83,8 +83,7 @@ TEST_CASE("t00062", "[test-case][class]") REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A>"))); REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A>"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -92,6 +91,11 @@ TEST_CASE("t00062", "[test-case][class]") using namespace json; - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00063/.clang-uml b/tests/t00063/.clang-uml index e3704069..46e5bb1a 100644 --- a/tests/t00063/.clang-uml +++ b/tests/t00063/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00063_class: type: class diff --git a/tests/t00063/test_case.h b/tests/t00063/test_case.h index 258f89b9..965874c7 100644 --- a/tests/t00063/test_case.h +++ b/tests/t00063/test_case.h @@ -39,8 +39,7 @@ TEST_CASE("t00063", "[test-case][class]") REQUIRE_THAT(puml, !IsEnum(_A("B"))); REQUIRE_THAT(puml, !IsEnum(_A("C"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -52,6 +51,11 @@ TEST_CASE("t00063", "[test-case][class]") REQUIRE(!IsEnum(j, "B")); REQUIRE(!IsEnum(j, "C")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00064/.clang-uml b/tests/t00064/.clang-uml index 7a15ca17..313c0bac 100644 --- a/tests/t00064/.clang-uml +++ b/tests/t00064/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00064_class: type: class diff --git a/tests/t00064/test_case.h b/tests/t00064/test_case.h index d10e290e..22d39c17 100644 --- a/tests/t00064/test_case.h +++ b/tests/t00064/test_case.h @@ -78,8 +78,7 @@ TEST_CASE("t00064", "[test-case][class]") "find", "unsigned int", "const value_type & v"))); #endif - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -87,6 +86,11 @@ TEST_CASE("t00064", "[test-case][class]") using namespace json; - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00065/.clang-uml b/tests/t00065/.clang-uml index 4c7143fb..f77d743c 100644 --- a/tests/t00065/.clang-uml +++ b/tests/t00065/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00065_class: type: class diff --git a/tests/t00065/test_case.h b/tests/t00065/test_case.h index d8004889..75dc215a 100644 --- a/tests/t00065/test_case.h +++ b/tests/t00065/test_case.h @@ -47,8 +47,7 @@ TEST_CASE("t00065", "[test-case][class]") REQUIRE_THAT(puml, IsPackage("submodule1a")); REQUIRE_THAT(puml, IsPackage("concepts")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -56,6 +55,11 @@ TEST_CASE("t00065", "[test-case][class]") using namespace json; - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00066/.clang-uml b/tests/t00066/.clang-uml index f2066018..abab698f 100644 --- a/tests/t00066/.clang-uml +++ b/tests/t00066/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00066_class: type: class diff --git a/tests/t00066/test_case.h b/tests/t00066/test_case.h index 3619b55c..4336d03b 100644 --- a/tests/t00066/test_case.h +++ b/tests/t00066/test_case.h @@ -69,8 +69,7 @@ TEST_CASE("t00066", "[test-case][class]") REQUIRE_THAT(puml, (IsField("b_", "int"))); REQUIRE_THAT(puml, (IsField("c_", "int"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -78,6 +77,11 @@ TEST_CASE("t00066", "[test-case][class]") using namespace json; - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00067/.clang-uml b/tests/t00067/.clang-uml index d2b5cc5b..b2a26a0e 100644 --- a/tests/t00067/.clang-uml +++ b/tests/t00067/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t00067_class: type: class diff --git a/tests/t00067/test_case.h b/tests/t00067/test_case.h index e9fb3cc5..03d3dc0a 100644 --- a/tests/t00067/test_case.h +++ b/tests/t00067/test_case.h @@ -44,8 +44,7 @@ TEST_CASE("t00067", "[test-case][class]") REQUIRE_THAT(puml, !(IsMethod("~A"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -53,6 +52,11 @@ TEST_CASE("t00067", "[test-case][class]") using namespace json; - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); + } + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t20001/.clang-uml b/tests/t20001/.clang-uml index 8cf49fdc..8ed2b5b8 100644 --- a/tests/t20001/.clang-uml +++ b/tests/t20001/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20001_sequence: type: sequence diff --git a/tests/t20001/test_case.h b/tests/t20001/test_case.h index 8713f443..2b02bab1 100644 --- a/tests/t20001/test_case.h +++ b/tests/t20001/test_case.h @@ -43,8 +43,7 @@ TEST_CASE("t20001", "[test-case][sequence]") REQUIRE_THAT(puml, HasComment("t20001 test diagram of type sequence")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { auto j = generate_sequence_json(diagram, *model); @@ -65,6 +64,6 @@ TEST_CASE("t20001", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t20002/.clang-uml b/tests/t20002/.clang-uml index 8dfb0825..437d25a6 100644 --- a/tests/t20002/.clang-uml +++ b/tests/t20002/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20002_sequence: type: sequence diff --git a/tests/t20002/test_case.h b/tests/t20002/test_case.h index 092e514e..8b281240 100644 --- a/tests/t20002/test_case.h +++ b/tests/t20002/test_case.h @@ -39,8 +39,7 @@ TEST_CASE("t20002", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("m2()"), _A("m3()"), "")); REQUIRE_THAT(puml, HasCall(_A("m3()"), _A("m4()"), "")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -59,6 +58,6 @@ TEST_CASE("t20002", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t20003/.clang-uml b/tests/t20003/.clang-uml index aee8374b..40cb7eee 100644 --- a/tests/t20003/.clang-uml +++ b/tests/t20003/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20003_sequence: type: sequence diff --git a/tests/t20003/test_case.h b/tests/t20003/test_case.h index 669a388e..d5bbbbc4 100644 --- a/tests/t20003/test_case.h +++ b/tests/t20003/test_case.h @@ -39,8 +39,7 @@ TEST_CASE("t20003", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("m2(T)"), _A("m3(T)"), "")); REQUIRE_THAT(puml, HasCall(_A("m3(T)"), _A("m4(T)"), "")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -54,6 +53,6 @@ TEST_CASE("t20003", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t20004/.clang-uml b/tests/t20004/.clang-uml index 0e1618e9..00ef7901 100644 --- a/tests/t20004/.clang-uml +++ b/tests/t20004/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20004_sequence: type: sequence diff --git a/tests/t20004/test_case.h b/tests/t20004/test_case.h index 8de05566..82f483c5 100644 --- a/tests/t20004/test_case.h +++ b/tests/t20004/test_case.h @@ -57,8 +57,7 @@ TEST_CASE("t20004", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("m3(int)"), _A("m4(int)"), "")); REQUIRE_THAT(puml, EndsWith("@enduml\n")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -81,6 +80,6 @@ TEST_CASE("t20004", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20005/.clang-uml b/tests/t20005/.clang-uml index 5b298510..7c497c16 100644 --- a/tests/t20005/.clang-uml +++ b/tests/t20005/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20005_sequence: type: sequence diff --git a/tests/t20005/test_case.h b/tests/t20005/test_case.h index 79172e7c..e9436077 100644 --- a/tests/t20005/test_case.h +++ b/tests/t20005/test_case.h @@ -41,8 +41,7 @@ TEST_CASE("t20005", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a(T)")); REQUIRE_THAT(puml, HasExitpoint(_A("C"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -55,6 +54,6 @@ TEST_CASE("t20005", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20006/.clang-uml b/tests/t20006/.clang-uml index 47360f32..a99a842e 100644 --- a/tests/t20006/.clang-uml +++ b/tests/t20006/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20006_sequence: type: sequence diff --git a/tests/t20006/test_case.h b/tests/t20006/test_case.h index 6d1cb553..625341ae 100644 --- a/tests/t20006/test_case.h +++ b/tests/t20006/test_case.h @@ -75,8 +75,7 @@ TEST_CASE("t20006", "[test-case][sequence]") REQUIRE_THAT( puml, HasCall(_A("BB"), _A("AA"), "aa2(int)")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -95,6 +94,6 @@ TEST_CASE("t20006", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20007/.clang-uml b/tests/t20007/.clang-uml index e0324ed3..953db3ed 100644 --- a/tests/t20007/.clang-uml +++ b/tests/t20007/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20007_sequence: type: sequence diff --git a/tests/t20007/test_case.h b/tests/t20007/test_case.h index 39585d6d..c995b9f5 100644 --- a/tests/t20007/test_case.h +++ b/tests/t20007/test_case.h @@ -46,8 +46,7 @@ TEST_CASE("t20007", "[test-case][sequence]") _A("Adder"), "add(std::string &&,std::string &&,std::string &&)")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -65,6 +64,6 @@ TEST_CASE("t20007", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20008/.clang-uml b/tests/t20008/.clang-uml index 5aa1c79d..adecc8e0 100644 --- a/tests/t20008/.clang-uml +++ b/tests/t20008/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20008_sequence: type: sequence diff --git a/tests/t20008/test_case.h b/tests/t20008/test_case.h index 05fff42f..57779662 100644 --- a/tests/t20008/test_case.h +++ b/tests/t20008/test_case.h @@ -54,8 +54,7 @@ TEST_CASE("t20008", "[test-case][sequence]") HasCall( _A("B"), _A("A"), "a3(std::string)")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -75,6 +74,6 @@ TEST_CASE("t20008", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20009/.clang-uml b/tests/t20009/.clang-uml index 3bc94e92..a316f367 100644 --- a/tests/t20009/.clang-uml +++ b/tests/t20009/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20009_sequence: type: sequence diff --git a/tests/t20009/test_case.h b/tests/t20009/test_case.h index 1994e2c5..e36f41fe 100644 --- a/tests/t20009/test_case.h +++ b/tests/t20009/test_case.h @@ -47,8 +47,7 @@ TEST_CASE("t20009", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b(float)")); REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a(float)")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -67,6 +66,6 @@ TEST_CASE("t20009", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20010/.clang-uml b/tests/t20010/.clang-uml index 0af678b5..1b708ad2 100644 --- a/tests/t20010/.clang-uml +++ b/tests/t20010/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20010_sequence: type: sequence diff --git a/tests/t20010/test_case.h b/tests/t20010/test_case.h index 9e3082c7..5a5cc9f0 100644 --- a/tests/t20010/test_case.h +++ b/tests/t20010/test_case.h @@ -48,8 +48,7 @@ TEST_CASE("t20010", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b4()")); REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a4()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -69,6 +68,6 @@ TEST_CASE("t20010", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20011/.clang-uml b/tests/t20011/.clang-uml index 8b1586e5..9c59bd5b 100644 --- a/tests/t20011/.clang-uml +++ b/tests/t20011/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20011_sequence: type: sequence diff --git a/tests/t20011/test_case.h b/tests/t20011/test_case.h index 917fd6f1..8d44803c 100644 --- a/tests/t20011/test_case.h +++ b/tests/t20011/test_case.h @@ -43,8 +43,7 @@ TEST_CASE("t20011", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "d(int)")); REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "b(int)")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -62,6 +61,6 @@ TEST_CASE("t20011", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20012/.clang-uml b/tests/t20012/.clang-uml index a4d1882c..318c2e6b 100644 --- a/tests/t20012/.clang-uml +++ b/tests/t20012/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20012_sequence: type: sequence diff --git a/tests/t20012/test_case.h b/tests/t20012/test_case.h index e71c2385..fe1b70c6 100644 --- a/tests/t20012/test_case.h +++ b/tests/t20012/test_case.h @@ -77,8 +77,7 @@ TEST_CASE("t20012", "[test-case][sequence]") // @todo #168 // REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("D"), "add5(int)")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -120,6 +119,6 @@ TEST_CASE("t20012", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t20013/.clang-uml b/tests/t20013/.clang-uml index 650e6e87..a8620c1a 100644 --- a/tests/t20013/.clang-uml +++ b/tests/t20013/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20013_sequence: type: sequence diff --git a/tests/t20013/test_case.h b/tests/t20013/test_case.h index dc005e7a..e3b826a7 100644 --- a/tests/t20013/test_case.h +++ b/tests/t20013/test_case.h @@ -47,8 +47,7 @@ TEST_CASE("t20013", "[test-case][sequence]") HasCall(_A("tmain(int,char **)"), _A("B"), "b(const char *)")); REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a3(const char *)")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -66,6 +65,6 @@ TEST_CASE("t20013", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20014/.clang-uml b/tests/t20014/.clang-uml index 464dba5d..26cb0913 100644 --- a/tests/t20014/.clang-uml +++ b/tests/t20014/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20014_sequence: type: sequence diff --git a/tests/t20014/test_case.h b/tests/t20014/test_case.h index 91f6d7de..00d194a4 100644 --- a/tests/t20014/test_case.h +++ b/tests/t20014/test_case.h @@ -45,8 +45,7 @@ TEST_CASE("t20014", "[test-case][sequence]") puml, HasCall(_A("tmain()"), _A("C"), "c1(int,int)")); REQUIRE_THAT(puml, HasCall(_A("C"), _A("B"), "b1(int,int)")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -65,6 +64,6 @@ TEST_CASE("t20014", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20015/.clang-uml b/tests/t20015/.clang-uml index d858dba3..4f550ad4 100644 --- a/tests/t20015/.clang-uml +++ b/tests/t20015/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20015_sequence: type: sequence diff --git a/tests/t20015/test_case.h b/tests/t20015/test_case.h index 29116c7a..0a05b4a6 100644 --- a/tests/t20015/test_case.h +++ b/tests/t20015/test_case.h @@ -46,8 +46,7 @@ TEST_CASE("t20015", "[test-case][sequence]") REQUIRE_THAT(puml, !HasCall(_A("B"), _A("B"), "set_y(int)")); REQUIRE_THAT(puml, !HasCall(_A("B"), _A("B"), "set_z(int)")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -60,6 +59,6 @@ TEST_CASE("t20015", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20016/.clang-uml b/tests/t20016/.clang-uml index ef2b94d6..d1bb343b 100644 --- a/tests/t20016/.clang-uml +++ b/tests/t20016/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20016_sequence: type: sequence diff --git a/tests/t20016/test_case.h b/tests/t20016/test_case.h index 4bc099f3..15e35993 100644 --- a/tests/t20016/test_case.h +++ b/tests/t20016/test_case.h @@ -41,8 +41,7 @@ TEST_CASE("t20016", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b2(long)")); REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a2(const long &)")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -58,6 +57,6 @@ TEST_CASE("t20016", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20017/.clang-uml b/tests/t20017/.clang-uml index 23fc3539..30a4154d 100644 --- a/tests/t20017/.clang-uml +++ b/tests/t20017/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20017_sequence: type: sequence diff --git a/tests/t20017/test_case.h b/tests/t20017/test_case.h index fe94fd45..8f5e26fb 100644 --- a/tests/t20017/test_case.h +++ b/tests/t20017/test_case.h @@ -49,8 +49,7 @@ TEST_CASE("t20017", "[test-case][sequence]") _A("t20017.cc"), _A("include/t20017_b.h"), "b2(int,int)")); REQUIRE_THAT(puml, HasExitpoint(_A("t20017.cc"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -72,6 +71,6 @@ TEST_CASE("t20017", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20018/.clang-uml b/tests/t20018/.clang-uml index 0babfeb5..6168917d 100644 --- a/tests/t20018/.clang-uml +++ b/tests/t20018/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20018_sequence: type: sequence diff --git a/tests/t20018/test_case.h b/tests/t20018/test_case.h index fb11d96d..1eea53f7 100644 --- a/tests/t20018/test_case.h +++ b/tests/t20018/test_case.h @@ -53,8 +53,7 @@ TEST_CASE("t20018", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("Factorial<1>"), _A("Factorial<0>"), "__print(int)__")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -75,6 +74,6 @@ TEST_CASE("t20018", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20019/.clang-uml b/tests/t20019/.clang-uml index 3804e9cc..de0bffa3 100644 --- a/tests/t20019/.clang-uml +++ b/tests/t20019/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20019_sequence: type: sequence diff --git a/tests/t20019/test_case.h b/tests/t20019/test_case.h index e9394fc0..903efeda 100644 --- a/tests/t20019/test_case.h +++ b/tests/t20019/test_case.h @@ -41,8 +41,7 @@ TEST_CASE("t20019", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("Base"), "name()")); REQUIRE_THAT(puml, HasCall(_A("Base"), _A("D2"), "impl()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -58,6 +57,6 @@ TEST_CASE("t20019", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20020/.clang-uml b/tests/t20020/.clang-uml index a7679e65..891d3df2 100644 --- a/tests/t20020/.clang-uml +++ b/tests/t20020/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20020_sequence: type: sequence diff --git a/tests/t20020/test_case.h b/tests/t20020/test_case.h index 1dcfe826..5314b9ef 100644 --- a/tests/t20020/test_case.h +++ b/tests/t20020/test_case.h @@ -53,8 +53,7 @@ TEST_CASE("t20020", "[test-case][sequence]") REQUIRE_THAT( puml, HasCallInControlCondition(_A("tmain()"), _A("C"), "c3(int)")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -78,6 +77,6 @@ TEST_CASE("t20020", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20021/.clang-uml b/tests/t20021/.clang-uml index 938b7a7e..8fdf0132 100644 --- a/tests/t20021/.clang-uml +++ b/tests/t20021/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20021_sequence: type: sequence diff --git a/tests/t20021/test_case.h b/tests/t20021/test_case.h index 130bd08a..f2a98000 100644 --- a/tests/t20021/test_case.h +++ b/tests/t20021/test_case.h @@ -58,8 +58,7 @@ TEST_CASE("t20021", "[test-case][sequence]") REQUIRE_THAT(puml, HasCallInControlCondition(_A("tmain()"), _A("C"), "contents()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -84,6 +83,6 @@ TEST_CASE("t20021", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20022/.clang-uml b/tests/t20022/.clang-uml index 08f05219..6fe768b8 100644 --- a/tests/t20022/.clang-uml +++ b/tests/t20022/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20022_sequence: type: sequence diff --git a/tests/t20022/test_case.h b/tests/t20022/test_case.h index 2c462ae2..026930a4 100644 --- a/tests/t20022/test_case.h +++ b/tests/t20022/test_case.h @@ -38,8 +38,7 @@ TEST_CASE("t20022", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); REQUIRE_THAT(puml, HasCall(_A("A"), _A("B"), "b()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -52,6 +51,6 @@ TEST_CASE("t20022", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20023/.clang-uml b/tests/t20023/.clang-uml index 086afe9d..49f82a99 100644 --- a/tests/t20023/.clang-uml +++ b/tests/t20023/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20023_sequence: type: sequence diff --git a/tests/t20023/test_case.h b/tests/t20023/test_case.h index d1b23027..4f17bd6b 100644 --- a/tests/t20023/test_case.h +++ b/tests/t20023/test_case.h @@ -41,8 +41,7 @@ TEST_CASE("t20023", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a3()")); REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a4()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -56,6 +55,6 @@ TEST_CASE("t20023", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20024/.clang-uml b/tests/t20024/.clang-uml index 1420bf1f..52b29956 100644 --- a/tests/t20024/.clang-uml +++ b/tests/t20024/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20024_sequence: type: sequence diff --git a/tests/t20024/test_case.h b/tests/t20024/test_case.h index 84551392..57d13c91 100644 --- a/tests/t20024/test_case.h +++ b/tests/t20024/test_case.h @@ -46,8 +46,7 @@ TEST_CASE("t20024", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("B"), _A("B"), "orange()")); REQUIRE_THAT(puml, HasCall(_A("B"), _A("B"), "green()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -62,6 +61,6 @@ TEST_CASE("t20024", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20025/.clang-uml b/tests/t20025/.clang-uml index 14e8ed22..0e72c357 100644 --- a/tests/t20025/.clang-uml +++ b/tests/t20025/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20025_sequence: type: sequence diff --git a/tests/t20025/test_case.h b/tests/t20025/test_case.h index a309e768..b468ad25 100644 --- a/tests/t20025/test_case.h +++ b/tests/t20025/test_case.h @@ -41,8 +41,7 @@ TEST_CASE("t20025", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("add(int,int)"), "")); REQUIRE_THAT(puml, !HasCall(_A("tmain()"), _A("add2(int,int)"), "")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -56,6 +55,6 @@ TEST_CASE("t20025", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20026/.clang-uml b/tests/t20026/.clang-uml index fc5e972e..0ade1944 100644 --- a/tests/t20026/.clang-uml +++ b/tests/t20026/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20026_sequence: type: sequence diff --git a/tests/t20026/test_case.h b/tests/t20026/test_case.h index 93949707..cdd56156 100644 --- a/tests/t20026/test_case.h +++ b/tests/t20026/test_case.h @@ -37,8 +37,7 @@ TEST_CASE("t20026", "[test-case][sequence]") // Check if all calls exist REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -50,6 +49,6 @@ TEST_CASE("t20026", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20027/.clang-uml b/tests/t20027/.clang-uml index 10737381..32752095 100644 --- a/tests/t20027/.clang-uml +++ b/tests/t20027/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20027_sequence: type: sequence diff --git a/tests/t20027/test_case.h b/tests/t20027/test_case.h index fca26ac9..4562a71d 100644 --- a/tests/t20027/test_case.h +++ b/tests/t20027/test_case.h @@ -39,8 +39,7 @@ TEST_CASE("t20027", "[test-case][sequence]") REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "aa()")); REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "aaa()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -52,6 +51,6 @@ TEST_CASE("t20027", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20028/.clang-uml b/tests/t20028/.clang-uml index 24d8ee97..cf295f8b 100644 --- a/tests/t20028/.clang-uml +++ b/tests/t20028/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20028_sequence: type: sequence diff --git a/tests/t20028/test_case.h b/tests/t20028/test_case.h index 89e49668..b596fa7d 100644 --- a/tests/t20028/test_case.h +++ b/tests/t20028/test_case.h @@ -42,8 +42,7 @@ TEST_CASE("t20028", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "d()")); REQUIRE_THAT(puml, !HasCall(_A("tmain()"), _A("B"), "e()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -58,6 +57,6 @@ TEST_CASE("t20028", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20029/.clang-uml b/tests/t20029/.clang-uml index ca543ed2..cc1ccd3a 100644 --- a/tests/t20029/.clang-uml +++ b/tests/t20029/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20029_sequence: type: sequence diff --git a/tests/t20029/test_case.h b/tests/t20029/test_case.h index 7a0c6ac7..6438d32f 100644 --- a/tests/t20029/test_case.h +++ b/tests/t20029/test_case.h @@ -59,8 +59,7 @@ TEST_CASE("t20029", "[test-case][sequence]") !HasCall( _A("ConnectionPool"), _A("ConnectionPool"), "connect_impl()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -82,6 +81,6 @@ TEST_CASE("t20029", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20030/.clang-uml b/tests/t20030/.clang-uml index a4d9f94a..a54e474d 100644 --- a/tests/t20030/.clang-uml +++ b/tests/t20030/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20030_sequence: type: sequence diff --git a/tests/t20030/test_case.h b/tests/t20030/test_case.h index 6e7da9f1..aced9127 100644 --- a/tests/t20030/test_case.h +++ b/tests/t20030/test_case.h @@ -52,8 +52,7 @@ TEST_CASE("t20030", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "set(int)")); REQUIRE_THAT(puml, HasCall(_A("tmain(bool,int)"), _A("A"), "value()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -61,6 +60,6 @@ TEST_CASE("t20030", "[test-case][sequence]") using namespace json; - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20031/.clang-uml b/tests/t20031/.clang-uml index da8b7038..3907966f 100644 --- a/tests/t20031/.clang-uml +++ b/tests/t20031/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20031_sequence: type: sequence diff --git a/tests/t20031/test_case.h b/tests/t20031/test_case.h index 25e82b48..707a9146 100644 --- a/tests/t20031/test_case.h +++ b/tests/t20031/test_case.h @@ -55,8 +55,7 @@ TEST_CASE("t20031", "[test-case][sequence]") "../../tests/t20031/t20031.cc:47:26)"), _A("zero()"), "")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -64,6 +63,6 @@ TEST_CASE("t20031", "[test-case][sequence]") using namespace json; - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20032/.clang-uml b/tests/t20032/.clang-uml index 5c88e05a..104141ab 100644 --- a/tests/t20032/.clang-uml +++ b/tests/t20032/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20032_sequence: type: sequence diff --git a/tests/t20032/test_case.h b/tests/t20032/test_case.h index d693533a..9f5d4242 100644 --- a/tests/t20032/test_case.h +++ b/tests/t20032/test_case.h @@ -55,8 +55,7 @@ TEST_CASE("t20032", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a3(const char *)")); REQUIRE_THAT(puml, HasResponse(_A("B"), _A("A"), "const char *")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -74,6 +73,6 @@ TEST_CASE("t20032", "[test-case][sequence]") REQUIRE(std::is_sorted(messages.begin(), messages.end())); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20033/.clang-uml b/tests/t20033/.clang-uml index f081bdbc..0f230c2b 100644 --- a/tests/t20033/.clang-uml +++ b/tests/t20033/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20033_sequence: type: sequence diff --git a/tests/t20033/test_case.h b/tests/t20033/test_case.h index 36929b23..22eaff7b 100644 --- a/tests/t20033/test_case.h +++ b/tests/t20033/test_case.h @@ -44,8 +44,7 @@ TEST_CASE("t20033", "[test-case][sequence]") REQUIRE_THAT( puml, HasCallInControlCondition(_A("tmain()"), _A("A"), "a4()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -53,6 +52,6 @@ TEST_CASE("t20033", "[test-case][sequence]") using namespace json; - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20034/.clang-uml b/tests/t20034/.clang-uml index 83d964c9..3e970e05 100644 --- a/tests/t20034/.clang-uml +++ b/tests/t20034/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20034_sequence: type: sequence diff --git a/tests/t20034/test_case.h b/tests/t20034/test_case.h index 1363fca0..d184d1ac 100644 --- a/tests/t20034/test_case.h +++ b/tests/t20034/test_case.h @@ -47,8 +47,7 @@ TEST_CASE("t20034", "[test-case][sequence]") REQUIRE_THAT(puml, !HasCall(_A("C"), _A("B"), "b3()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -72,6 +71,6 @@ TEST_CASE("t20034", "[test-case][sequence]") {{"D::d2()", "C::c2()", "void"}, {"C::c2()", "B::b2()", "void"}, {"B::b2()", "A::a2()", "void"}})); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20035/.clang-uml b/tests/t20035/.clang-uml index 7b1a708e..c7ee1c78 100644 --- a/tests/t20035/.clang-uml +++ b/tests/t20035/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20035_sequence: type: sequence diff --git a/tests/t20035/test_case.h b/tests/t20035/test_case.h index 50134794..67b3614f 100644 --- a/tests/t20035/test_case.h +++ b/tests/t20035/test_case.h @@ -39,8 +39,7 @@ TEST_CASE("t20035", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("a(int)"), _A("b1(int)"), "")); REQUIRE_THAT(puml, HasCall(_A("b1(int)"), _A("c(int)"), "")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -52,6 +51,6 @@ TEST_CASE("t20035", "[test-case][sequence]") {{"tmain(int,char **)", "a(int)", "int"}, {"a(int)", "b1(int)", "int"}, {"b1(int)", "c(int)", "int"}})); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t20036/.clang-uml b/tests/t20036/.clang-uml index f6bc00ff..9339d814 100644 --- a/tests/t20036/.clang-uml +++ b/tests/t20036/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t20036_sequence: type: sequence diff --git a/tests/t20036/test_case.h b/tests/t20036/test_case.h index 67381a9f..5f9ca877 100644 --- a/tests/t20036/test_case.h +++ b/tests/t20036/test_case.h @@ -47,8 +47,7 @@ TEST_CASE("t20036", "[test-case][sequence]") REQUIRE_THAT(puml, HasCall(_A("C"), _A("B"), "b1()")); REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a2()")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -68,6 +67,6 @@ TEST_CASE("t20036", "[test-case][sequence]") REQUIRE(HasMessageChain(j, {{"C::c1()", "B::b1()", "void"}, {"B::b1()", "A::a2()", "void"}})); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t30001/.clang-uml b/tests/t30001/.clang-uml index 0825068b..e5faba78 100644 --- a/tests/t30001/.clang-uml +++ b/tests/t30001/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30001_package: type: package diff --git a/tests/t30001/test_case.h b/tests/t30001/test_case.h index 1442e8d9..c6beef2e 100644 --- a/tests/t30001/test_case.h +++ b/tests/t30001/test_case.h @@ -61,8 +61,7 @@ TEST_CASE("t30001", "[test-case][package]") REQUIRE_THAT(puml, HasComment("t30001 test diagram of type package")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -81,6 +80,6 @@ TEST_CASE("t30001", "[test-case][package]") REQUIRE(IsPackage(j, "B::AA::BBB")); REQUIRE(IsPackage(j, "B::BB")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t30002/.clang-uml b/tests/t30002/.clang-uml index dbbd0717..c2111c65 100644 --- a/tests/t30002/.clang-uml +++ b/tests/t30002/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30002_package: type: package diff --git a/tests/t30002/test_case.h b/tests/t30002/test_case.h index b589496b..90b630b5 100644 --- a/tests/t30002/test_case.h +++ b/tests/t30002/test_case.h @@ -72,8 +72,7 @@ TEST_CASE("t30002", "[test-case][package]") REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A17"))); REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A18"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -120,6 +119,6 @@ TEST_CASE("t30002", "[test-case][package]") REQUIRE(IsDependency(j, "B::BB::BBB", "A::AA::A16")); REQUIRE(IsDependency(j, "B::BB::BBB", "A::AA::A17")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t30003/.clang-uml b/tests/t30003/.clang-uml index 74318921..b4322243 100644 --- a/tests/t30003/.clang-uml +++ b/tests/t30003/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30003_package: type: package diff --git a/tests/t30003/test_case.h b/tests/t30003/test_case.h index c9b9e200..a7ae58c7 100644 --- a/tests/t30003/test_case.h +++ b/tests/t30003/test_case.h @@ -43,8 +43,7 @@ TEST_CASE("t30003", "[test-case][package]") REQUIRE_THAT(puml, IsDeprecated(_A("ns2_v0_9_0"))); REQUIRE_THAT(puml, IsDeprecated(_A("ns3"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -62,6 +61,6 @@ TEST_CASE("t30003", "[test-case][package]") REQUIRE(IsDeprecated(j, "ns1::ns2_v0_9_0")); REQUIRE(IsDeprecated(j, "ns3")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t30004/.clang-uml b/tests/t30004/.clang-uml index ac7fcc9a..c273c5f6 100644 --- a/tests/t30004/.clang-uml +++ b/tests/t30004/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30004_package: type: package diff --git a/tests/t30004/test_case.h b/tests/t30004/test_case.h index ef97bd49..d4a2e2c8 100644 --- a/tests/t30004/test_case.h +++ b/tests/t30004/test_case.h @@ -41,8 +41,7 @@ TEST_CASE("t30004", "[test-case][package]") REQUIRE_THAT(puml, !IsPackage("DDD")); REQUIRE_THAT(puml, IsPackage("EEE")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -57,6 +56,6 @@ TEST_CASE("t30004", "[test-case][package]") REQUIRE(!IsPackage(j, "A::DDD")); REQUIRE(IsPackage(j, "A::EEE")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t30005/.clang-uml b/tests/t30005/.clang-uml index 1512c67f..bbfe0e64 100644 --- a/tests/t30005/.clang-uml +++ b/tests/t30005/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30005_package: type: package diff --git a/tests/t30005/test_case.h b/tests/t30005/test_case.h index 18665830..ac1ac61c 100644 --- a/tests/t30005/test_case.h +++ b/tests/t30005/test_case.h @@ -42,8 +42,7 @@ TEST_CASE("t30005", "[test-case][package]") REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("AAA"))); REQUIRE_THAT(puml, IsDependency(_A("CCC"), _A("AAA"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -64,6 +63,6 @@ TEST_CASE("t30005", "[test-case][package]") REQUIRE(IsDependency(j, "B::BB::BBB", "A::AA::AAA")); REQUIRE(IsDependency(j, "C::CC::CCC", "A::AA::AAA")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t30006/.clang-uml b/tests/t30006/.clang-uml index 7899d3cc..5f970f91 100644 --- a/tests/t30006/.clang-uml +++ b/tests/t30006/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30006_package: type: package diff --git a/tests/t30006/test_case.h b/tests/t30006/test_case.h index b238f55e..5a11b407 100644 --- a/tests/t30006/test_case.h +++ b/tests/t30006/test_case.h @@ -42,8 +42,7 @@ TEST_CASE("t30006", "[test-case][package]") REQUIRE_THAT(puml, IsDependency(_A("A"), _A("B"))); REQUIRE_THAT(puml, IsDependency(_A("A"), _A("C"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -58,6 +57,6 @@ TEST_CASE("t30006", "[test-case][package]") REQUIRE(IsDependency(j, "A", "B")); REQUIRE(IsDependency(j, "A", "C")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t30007/.clang-uml b/tests/t30007/.clang-uml index 96c875a0..4551c4da 100644 --- a/tests/t30007/.clang-uml +++ b/tests/t30007/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30007_package: type: package diff --git a/tests/t30007/test_case.h b/tests/t30007/test_case.h index 6262c0c5..9287c03d 100644 --- a/tests/t30007/test_case.h +++ b/tests/t30007/test_case.h @@ -45,8 +45,7 @@ TEST_CASE("t30007", "[test-case][package]") REQUIRE_THAT(puml, IsLayoutHint(_A("C"), "up", _A("AA"))); REQUIRE_THAT(puml, IsLayoutHint(_A("C"), "left", _A("B"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -62,6 +61,6 @@ TEST_CASE("t30007", "[test-case][package]") REQUIRE(IsDependency(j, "A::AA", "B")); REQUIRE(IsDependency(j, "A::AA", "C")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t30008/.clang-uml b/tests/t30008/.clang-uml index 60e4959d..9325c7af 100644 --- a/tests/t30008/.clang-uml +++ b/tests/t30008/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30008_package: type: package diff --git a/tests/t30008/test_case.h b/tests/t30008/test_case.h index a6bd9b7b..8ced1931 100644 --- a/tests/t30008/test_case.h +++ b/tests/t30008/test_case.h @@ -51,8 +51,7 @@ TEST_CASE("t30008", "[test-case][package]") REQUIRE_THAT(puml, IsDependency(_A("E"), _A("D"))); REQUIRE_THAT(puml, IsDependency(_A("F"), _A("E"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -76,6 +75,6 @@ TEST_CASE("t30008", "[test-case][package]") REQUIRE(IsDependency(j, "dependencies::E", "dependencies::D")); REQUIRE(IsDependency(j, "dependencies::F", "dependencies::E")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t30009/.clang-uml b/tests/t30009/.clang-uml index 9452c160..13e21029 100644 --- a/tests/t30009/.clang-uml +++ b/tests/t30009/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30009_package: type: package diff --git a/tests/t30009/test_case.h b/tests/t30009/test_case.h index 8ee85cfb..1d36c541 100644 --- a/tests/t30009/test_case.h +++ b/tests/t30009/test_case.h @@ -43,8 +43,7 @@ TEST_CASE("t30009", "[test-case][package]") REQUIRE_THAT(puml, IsPackage("C")); REQUIRE_THAT(puml, IsPackage("D")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -63,6 +62,6 @@ TEST_CASE("t30009", "[test-case][package]") REQUIRE(IsPackage(j, "Two::C")); REQUIRE(IsPackage(j, "Two::D")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t30010/.clang-uml b/tests/t30010/.clang-uml index 22f72ba3..9dc1339a 100644 --- a/tests/t30010/.clang-uml +++ b/tests/t30010/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30010_package: type: package diff --git a/tests/t30010/test_case.h b/tests/t30010/test_case.h index 943da222..21f2f277 100644 --- a/tests/t30010/test_case.h +++ b/tests/t30010/test_case.h @@ -47,8 +47,7 @@ TEST_CASE("t30010", "[test-case][package]") REQUIRE_THAT(puml, IsDependency(_A("app"), _A("lib3"))); REQUIRE_THAT(puml, IsDependency(_A("app"), _A("lib4"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -56,6 +55,6 @@ TEST_CASE("t30010", "[test-case][package]") using namespace json; - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t30011/.clang-uml b/tests/t30011/.clang-uml index 33463e69..a379b981 100644 --- a/tests/t30011/.clang-uml +++ b/tests/t30011/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t30011_package: type: package diff --git a/tests/t30011/test_case.h b/tests/t30011/test_case.h index b78c2c41..794934d8 100644 --- a/tests/t30011/test_case.h +++ b/tests/t30011/test_case.h @@ -47,8 +47,7 @@ TEST_CASE("t30011", "[test-case][package]") REQUIRE_THAT(puml, IsDependency(_A("app"), _A("lib3"))); REQUIRE_THAT(puml, IsDependency(_A("app"), _A("lib4"))); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -56,6 +55,6 @@ TEST_CASE("t30011", "[test-case][package]") using namespace json; - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } \ No newline at end of file diff --git a/tests/t40001/.clang-uml b/tests/t40001/.clang-uml index 208c7397..7400619d 100644 --- a/tests/t40001/.clang-uml +++ b/tests/t40001/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t40001_include: type: include diff --git a/tests/t40001/test_case.h b/tests/t40001/test_case.h index 70b5ec90..9f58a9e1 100644 --- a/tests/t40001/test_case.h +++ b/tests/t40001/test_case.h @@ -53,8 +53,7 @@ TEST_CASE("t40001", "[test-case][include]") REQUIRE_THAT(puml, HasComment("t40001 test diagram of type include")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -78,6 +77,6 @@ TEST_CASE("t40001", "[test-case][include]") j, "include/t40001_include1.h", "include/lib1/lib1.h")); REQUIRE(IsDependency(j, "include/t40001_include1.h", "string")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t40002/.clang-uml b/tests/t40002/.clang-uml index 84c790a2..21514d18 100644 --- a/tests/t40002/.clang-uml +++ b/tests/t40002/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t40002_include: type: include diff --git a/tests/t40002/test_case.h b/tests/t40002/test_case.h index 67bb22b2..c57831bb 100644 --- a/tests/t40002/test_case.h +++ b/tests/t40002/test_case.h @@ -80,8 +80,7 @@ TEST_CASE("t40002", "[test-case][include]") clanguml::util::get_git_commit()), "lib2.h")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -109,6 +108,6 @@ TEST_CASE("t40002", "[test-case][include]") REQUIRE(IsAssociation(j, "src/lib1/lib1.cc", "include/lib1/lib1.h")); REQUIRE(IsAssociation(j, "src/lib2/lib2.cc", "include/lib2/lib2.h")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t40003/.clang-uml b/tests/t40003/.clang-uml index be81eb3a..782b375a 100644 --- a/tests/t40003/.clang-uml +++ b/tests/t40003/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t40003_include: type: include diff --git a/tests/t40003/test_case.h b/tests/t40003/test_case.h index 966c7fdc..5a847234 100644 --- a/tests/t40003/test_case.h +++ b/tests/t40003/test_case.h @@ -47,8 +47,7 @@ TEST_CASE("t40003", "[test-case][include]") REQUIRE_THAT(puml, IsFile("t5.h")); REQUIRE_THAT(puml, !IsFile("t6.h")); - save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } { @@ -73,6 +72,6 @@ TEST_CASE("t40003", "[test-case][include]") REQUIRE(!IsFile(j, "include/dependencies/t4.h")); REQUIRE(IsFile(j, "src/dependencies/t2.cc")); - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/tests/t90000/.clang-uml b/tests/t90000/.clang-uml index 86079718..e09671a3 100644 --- a/tests/t90000/.clang-uml +++ b/tests/t90000/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: t90000_class: type: class diff --git a/tests/t90000/test_case.h b/tests/t90000/test_case.h index 5074f76e..dda3d671 100644 --- a/tests/t90000/test_case.h +++ b/tests/t90000/test_case.h @@ -35,5 +35,5 @@ TEST_CASE("t90000", "[test-case][config]") REQUIRE_THAT(puml, IsClass(_A("Foo"))); REQUIRE_THAT(puml, IsClass(_A("Boo"))); - save_puml(config.output_directory() + "/" + diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); } diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 64874fac..e49adbf0 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -235,36 +235,51 @@ std::string generate_class_mermaid( config, model); } -void save_puml(const std::string &path, const std::string &puml) +template +void save_diagram(const std::filesystem::path &path, const T &diagram) { - std::filesystem::path p{path}; - std::filesystem::create_directory(p.parent_path()); + static_assert( + std::same_as || std::same_as); + + std::filesystem::create_directories(path.parent_path()); std::ofstream ofs; - ofs.open(p, std::ofstream::out | std::ofstream::trunc); - ofs << puml; + ofs.open(path, std::ofstream::out | std::ofstream::trunc); + if constexpr (std::same_as) { + ofs << std::setw(2) << diagram; + } + else { + ofs << diagram; + } + ofs.close(); } -void save_json(const std::string &path, const nlohmann::json &j) +void save_puml(const std::string &path, const std::string &filename, + const std::string &puml) { std::filesystem::path p{path}; - std::filesystem::create_directory(p.parent_path()); - std::ofstream ofs; - ofs.open(p, std::ofstream::out | std::ofstream::trunc); - ofs << std::setw(2) << j; - ofs.close(); + p /= "puml"; + p /= filename; + save_diagram(p, puml); } -void save_mermaid(const std::string &path, const std::string &mmd) +void save_json(const std::string &path, const std::string &filename, + const nlohmann::json &j) { std::filesystem::path p{path}; - std::filesystem::create_directory(p.parent_path()); - std::ofstream ofs; - ofs.open(p, std::ofstream::out | std::ofstream::trunc); - ofs << mmd; - ofs.close(); + p /= "json"; + p /= filename; + save_diagram(p, j); } +void save_mermaid(const std::string &path, const std::string &filename, + const std::string &mmd) +{ + std::filesystem::path p{path}; + p /= "mermaid"; + p /= filename; + save_diagram(p, mmd); +} using namespace clanguml::test::matchers; diff --git a/tests/test_cases.h b/tests/test_cases.h index 8c9aa56d..9dc32df5 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -19,8 +19,8 @@ #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG -#include "class_diagram/generators/plantuml/class_diagram_generator.h" #include "class_diagram/generators/mermaid/class_diagram_generator.h" +#include "class_diagram/generators/plantuml/class_diagram_generator.h" #include "class_diagram/model/diagram.h" #include "class_diagram/visitor/translation_unit_visitor.h" #include "common/clang_utils.h" diff --git a/util/generate_mermaid.py b/util/generate_mermaid.py new file mode 100644 index 00000000..a7cccce0 --- /dev/null +++ b/util/generate_mermaid.py @@ -0,0 +1,47 @@ +#!/usr/bin/python3 + +## +## util/validate_json.py +## +## Copyright (c) 2021-2023 Bartek Kryza +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## +import sys +import subprocess + +from pathlib import Path + +def print_usage(): + print(f'Usage: ./generate_mermaid.py file1.mmd file2.mmd ...') + + +files = sys.argv[1:] + + +if not files: + print_usage() + sys.exit(1) + +ok = 0 + +for f in files: + try: + print(f'Generating Mermaid diagram from {f}') + f_svg = Path(f).with_suffix('.png') + subprocess.check_call(['mmdc', '-i', f, '-o', f_svg]) + except subprocess.CalledProcessError: + ok = 1 + print(f'ERROR: Generating Mermaid diagram from {f} failed') + +sys.exit(ok) diff --git a/util/generate_test_cases_docs.py b/util/generate_test_cases_docs.py index ea6018d1..644c5138 100755 --- a/util/generate_test_cases_docs.py +++ b/util/generate_test_cases_docs.py @@ -69,12 +69,18 @@ with open(r'tests/test_cases.yaml') as f: # Copy and link the diagram image config_dict = yaml.full_load(config) - tc.write("## Generated UML diagrams\n") + tc.write("## Generated PlantUML diagrams\n") for diagram_name, _ in config_dict['diagrams'].items(): - copyfile(f'debug/tests/puml/{diagram_name}.svg', + copyfile(f'debug/tests/diagrams/puml/{diagram_name}.svg', f'docs/test_cases/{diagram_name}.svg') tc.write(f'![{diagram_name}](./{diagram_name}.svg "{test_case["title"]}")\n') + tc.write("## Generated Mermaid diagrams\n") + for diagram_name, _ in config_dict['diagrams'].items(): + copyfile(f'debug/tests/diagrams/mermaid/{diagram_name}.svg', + f'docs/test_cases/{diagram_name}_mmd.svg') + tc.write(f'![{diagram_name}](./{diagram_name}_mmd.svg "{test_case["title"]}")\n') + tc.write("## Generated JSON models\n") for diagram_name, _ in config_dict['diagrams'].items(): if os.path.exists(f'debug/tests/puml/{diagram_name}.json'): diff --git a/util/templates/test_cases/.clang-uml b/util/templates/test_cases/.clang-uml index 63e89fab..8864bbd0 100644 --- a/util/templates/test_cases/.clang-uml +++ b/util/templates/test_cases/.clang-uml @@ -1,5 +1,5 @@ compilation_database_dir: .. -output_directory: puml +output_directory: diagrams diagrams: {{ name }}_{{ type }}: type: {{ type }} diff --git a/util/templates/test_cases/test_case.h b/util/templates/test_cases/test_case.h index 9289b364..5aba84d9 100644 --- a/util/templates/test_cases/test_case.h +++ b/util/templates/test_cases/test_case.h @@ -38,7 +38,7 @@ TEST_CASE("{{ name }}", "[test-case][{{ type }}]") {{ examples }} save_puml( - config.output_directory() + "/" + diagram->name + ".puml", puml); + config.output_directory(), diagram->name + ".puml", puml); } { @@ -46,7 +46,7 @@ TEST_CASE("{{ name }}", "[test-case][{{ type }}]") using namespace json; - save_json(config.output_directory() + "/" + diagram->name + ".json", j); + save_json(config.output_directory(), diagram->name + ".json", j); } } diff --git a/util/validate_json.py b/util/validate_json.py new file mode 100644 index 00000000..2ff691a6 --- /dev/null +++ b/util/validate_json.py @@ -0,0 +1,46 @@ +#!/usr/bin/python3 + +## +## util/validate_json.py +## +## Copyright (c) 2021-2023 Bartek Kryza +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## +import sys +import json + + +def print_usage(): + print(f'Usage: ./validate_json.py file1.json file2.json ...') + + +files = sys.argv[1:] + + +if not files: + print_usage() + sys.exit(1) + +ok = 0 + +for f in files: + with open(f, 'r') as file: + try: + json.load(file) + print(f'File {f} is valid') + except ValueError: + ok = 1 + print(f'File {f} is invalid') + +sys.exit(ok) \ No newline at end of file From 32fda888526a4cff5256af090bf0cb05e1fed25d Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Fri, 8 Sep 2023 00:30:02 +0200 Subject: [PATCH 03/24] Added initial support for MermaidJS sequence diagram --- .../mermaid/class_diagram_generator.cc | 14 +- .../mermaid/class_diagram_generator.h | 2 - src/common/generators/generators.h | 11 +- src/common/generators/mermaid/generator.cc | 16 +- src/common/generators/mermaid/generator.h | 2 + .../mermaid/sequence_diagram_generator.cc | 580 ++++++++++++++++++ .../mermaid/sequence_diagram_generator.h | 141 +++++ tests/t20001/test_case.h | 5 + tests/t20002/test_case.h | 6 + tests/t20003/test_case.h | 6 + tests/t20004/test_case.h | 6 + tests/t20005/test_case.h | 6 + tests/t20007/test_case.h | 6 + tests/t20008/test_case.h | 6 + tests/t20009/test_case.h | 6 + tests/t20010/test_case.h | 6 + tests/t20011/test_case.h | 6 + tests/t20013/test_case.h | 6 + tests/t20014/test_case.h | 6 + tests/t20015/test_case.h | 6 + tests/t20016/test_case.h | 6 + tests/t20017/test_case.h | 6 + tests/t20018/test_case.h | 6 + tests/t20019/test_case.h | 6 + tests/t20020/test_case.h | 6 + tests/t20021/test_case.h | 6 + tests/t20022/test_case.h | 6 + tests/t20023/test_case.h | 6 + tests/t20024/test_case.h | 6 + tests/t20025/test_case.h | 6 + tests/t20026/test_case.h | 6 + tests/t20027/test_case.h | 6 + tests/t20028/test_case.h | 6 + tests/t20029/test_case.h | 6 + tests/t20030/test_case.h | 6 + tests/t20031/test_case.h | 6 + tests/t20032/test_case.h | 6 + tests/t20033/test_case.h | 6 + tests/t20034/test_case.h | 6 + tests/t20035/test_case.h | 6 + tests/t20036/test_case.h | 6 + tests/test_cases.cc | 8 + util/generate_mermaid.py | 2 +- 43 files changed, 956 insertions(+), 23 deletions(-) create mode 100644 src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc create mode 100644 src/sequence_diagram/generators/mermaid/sequence_diagram_generator.h diff --git a/src/class_diagram/generators/mermaid/class_diagram_generator.cc b/src/class_diagram/generators/mermaid/class_diagram_generator.cc index 64fc15aa..5e92a975 100644 --- a/src/class_diagram/generators/mermaid/class_diagram_generator.cc +++ b/src/class_diagram/generators/mermaid/class_diagram_generator.cc @@ -25,6 +25,7 @@ namespace clanguml::class_diagram::generators::mermaid { using clanguml::common::generators::mermaid::indent; +using clanguml::common::generators::mermaid::render_name; generator::generator(diagram_config &config, diagram_model &model) : common_generator{config, model} @@ -32,19 +33,6 @@ generator::generator(diagram_config &config, diagram_model &model) { } -std::string generator::render_name(std::string name) const -{ - util::replace_all(name, "<", "<"); - util::replace_all(name, ">", ">"); - util::replace_all(name, "(", "("); - util::replace_all(name, ")", ")"); - util::replace_all(name, "##", "::"); - util::replace_all(name, "{", "{"); - util::replace_all(name, "}", "}"); - - return name; -} - void generator::generate_alias( const common::model::element &c, std::ostream &ostr) const { diff --git a/src/class_diagram/generators/mermaid/class_diagram_generator.h b/src/class_diagram/generators/mermaid/class_diagram_generator.h index 5da861a7..4a8bd118 100644 --- a/src/class_diagram/generators/mermaid/class_diagram_generator.h +++ b/src/class_diagram/generators/mermaid/class_diagram_generator.h @@ -246,8 +246,6 @@ private: const std::vector method_groups_{ "constructors", "assignment", "operators", "other"}; - std::string render_name(std::string name) const; - template void sort_class_elements(std::vector &elements) const { diff --git a/src/common/generators/generators.h b/src/common/generators/generators.h index 639a5fe6..8c3d29d1 100644 --- a/src/common/generators/generators.h +++ b/src/common/generators/generators.h @@ -31,6 +31,7 @@ #include "package_diagram/generators/json/package_diagram_generator.h" #include "package_diagram/generators/plantuml/package_diagram_generator.h" #include "sequence_diagram/generators/json/sequence_diagram_generator.h" +#include "sequence_diagram/generators/mermaid/sequence_diagram_generator.h" #include "sequence_diagram/generators/plantuml/sequence_diagram_generator.h" #include "util/util.h" #include "version.h" @@ -168,11 +169,11 @@ struct diagram_generator_t { using type = clanguml::class_diagram::generators::mermaid::generator; }; -// template <> -// struct diagram_generator_t { -// using type = clanguml::sequence_diagram::generators::mermaid::generator; -// }; +template <> +struct diagram_generator_t { + using type = clanguml::sequence_diagram::generators::mermaid::generator; +}; // template <> // struct diagram_generator_t { diff --git a/src/common/generators/mermaid/generator.cc b/src/common/generators/mermaid/generator.cc index 740ac3cb..9000cedd 100644 --- a/src/common/generators/mermaid/generator.cc +++ b/src/common/generators/mermaid/generator.cc @@ -64,9 +64,9 @@ std::string to_mermaid(message_t r) { switch (r) { case message_t::kCall: - return "->"; + return "->>"; case message_t::kReturn: - return "-->"; + return "-->>"; default: return ""; } @@ -78,4 +78,16 @@ std::string indent(const unsigned level) return std::string(level * kIndentWidth, ' '); } +std::string render_name(std::string name) +{ + util::replace_all(name, "<", "<"); + util::replace_all(name, ">", ">"); + util::replace_all(name, "(", "("); + util::replace_all(name, ")", ")"); + util::replace_all(name, "##", "::"); + util::replace_all(name, "{", "{"); + util::replace_all(name, "}", "}"); + + return name; +} } // namespace clanguml::common::generators::mermaid diff --git a/src/common/generators/mermaid/generator.h b/src/common/generators/mermaid/generator.h index 7eee83c2..bff4bfed 100644 --- a/src/common/generators/mermaid/generator.h +++ b/src/common/generators/mermaid/generator.h @@ -44,6 +44,8 @@ std::string to_mermaid(message_t r); std::string indent(const unsigned level); +std::string render_name(std::string name); + /** * @brief Base class for diagram generators * diff --git a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc new file mode 100644 index 00000000..de9e3308 --- /dev/null +++ b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc @@ -0,0 +1,580 @@ +/** + * @file src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "sequence_diagram_generator.h" + +namespace clanguml::sequence_diagram::generators::mermaid { + +using clanguml::common::model::message_t; +using clanguml::config::location_t; +using clanguml::sequence_diagram::model::activity; +using clanguml::sequence_diagram::model::message; +using namespace clanguml::util; + +using clanguml::common::generators::mermaid::indent; +using clanguml::common::generators::mermaid::render_name; + +std::string render_participant_name(std::string name) +{ + util::replace_all(name, "##", "::"); + + return name; +} + +std::string render_message_text(std::string text) +{ + util::replace_all(text, ";", "#59;"); + + return text; +} + +generator::generator( + clanguml::config::sequence_diagram &config, diagram_model &model) + : common_generator{config, model} +{ +} + +void generator::generate_call(const message &m, std::ostream &ostr) const +{ + const auto &from = model().get_participant(m.from()); + const auto &to = model().get_participant(m.to()); + + if (!from || !to) { + LOG_DBG("Skipping empty call from '{}' to '{}'", m.from(), m.to()); + return; + } + + generate_participant(ostr, m.from()); + generate_participant(ostr, m.to()); + + std::string message; + + model::function::message_render_mode render_mode = + select_method_arguments_render_mode(); + + if (to.value().type_name() == "method") { + const auto &f = dynamic_cast(to.value()); + const std::string_view style = f.is_static() ? "" : ""; + message = + fmt::format("{}{}{}", style, f.message_name(render_mode), style); + } + else if (config().combine_free_functions_into_file_participants()) { + if (to.value().type_name() == "function") { + message = dynamic_cast(to.value()) + .message_name(render_mode); + } + else if (to.value().type_name() == "function_template") { + message = dynamic_cast(to.value()) + .message_name(render_mode); + } + } + + const std::string from_alias = generate_alias(from.value()); + const std::string to_alias = generate_alias(to.value()); + + print_debug(m, ostr); + + ostr << indent(1) << from_alias << " " + << common::generators::mermaid::to_mermaid(message_t::kCall) << " "; + + ostr << indent(1) << to_alias; + + ostr << " : "; + + if (m.message_scope() == common::model::message_scope_t::kCondition) + ostr << "["; + + ostr << message; + + if (m.message_scope() == common::model::message_scope_t::kCondition) + ostr << "]"; + + ostr << '\n'; + + LOG_DBG("Generated call '{}' from {} [{}] to {} [{}]", message, from, + m.from(), to, m.to()); +} + +void generator::generate_return(const message &m, std::ostream &ostr) const +{ + // Add return activity only for messages between different actors and + // only if the return type is different than void + const auto &from = model().get_participant(m.from()); + const auto &to = model().get_participant(m.to()); + if ((m.from() != m.to()) && !to.value().is_void()) { + const std::string from_alias = generate_alias(from.value()); + + const std::string to_alias = generate_alias(to.value()); + + ostr << indent(1) << to_alias << " " + << common::generators::mermaid::to_mermaid(message_t::kReturn) + << " " << from_alias << " : "; + + if (config().generate_return_types()) { + ostr << m.return_type(); + } + + ostr << '\n'; + } +} + +void generator::generate_activity(const activity &a, std::ostream &ostr, + std::vector &visited) const +{ + for (const auto &m : a.messages()) { + if (m.type() == message_t::kCall) { + const auto &to = + model().get_participant(m.to()); + + visited.push_back(m.from()); + + LOG_DBG("Generating message [{}] --> [{}]", m.from(), m.to()); + + generate_call(m, ostr); + + std::string to_alias = generate_alias(to.value()); + + ostr << indent(1) << "activate " << to_alias << std::endl; + + if (model().sequences().find(m.to()) != model().sequences().end()) { + if (std::find(visited.begin(), visited.end(), m.to()) == + visited + .end()) { // break infinite recursion on recursive calls + LOG_DBG("Creating activity {} --> {} - missing sequence {}", + m.from(), m.to(), m.to()); + generate_activity( + model().get_activity(m.to()), ostr, visited); + } + } + else + LOG_DBG("Skipping activity {} --> {} - missing sequence {}", + m.from(), m.to(), m.to()); + + generate_return(m, ostr); + + ostr << indent(1) << "deactivate " << to_alias << std::endl; + + visited.pop_back(); + } + else if (m.type() == message_t::kIf) { + print_debug(m, ostr); + ostr << indent(1) << "alt"; + if (const auto &text = m.condition_text(); text.has_value()) + ostr << " " << render_message_text(text.value()); + ostr << '\n'; + } + else if (m.type() == message_t::kElseIf) { + print_debug(m, ostr); + ostr << indent(1) << "else"; + if (const auto &text = m.condition_text(); text.has_value()) + ostr << " " << render_message_text(text.value()); + ostr << '\n'; + } + else if (m.type() == message_t::kElse) { + print_debug(m, ostr); + ostr << indent(1) << "else\n"; + } + else if (m.type() == message_t::kIfEnd) { + ostr << indent(1) << "end\n"; + } + else if (m.type() == message_t::kWhile) { + print_debug(m, ostr); + ostr << indent(1) << "loop"; + if (const auto &text = m.condition_text(); text.has_value()) + ostr << " " << render_message_text(text.value()); + ostr << '\n'; + } + else if (m.type() == message_t::kWhileEnd) { + ostr << indent(1) << "end\n"; + } + else if (m.type() == message_t::kFor) { + print_debug(m, ostr); + ostr << indent(1) << "loop"; + if (const auto &text = m.condition_text(); text.has_value()) + ostr << " " << render_message_text(text.value()); + ostr << '\n'; + } + else if (m.type() == message_t::kForEnd) { + ostr << "end\n"; + } + else if (m.type() == message_t::kDo) { + print_debug(m, ostr); + ostr << indent(1) << "loop"; + if (const auto &text = m.condition_text(); text.has_value()) + ostr << " " << render_message_text(text.value()); + ostr << '\n'; + } + else if (m.type() == message_t::kDoEnd) { + ostr << indent(1) << "end\n"; + } + else if (m.type() == message_t::kTry) { + print_debug(m, ostr); + ostr << indent(1) << "critical\n"; + } + else if (m.type() == message_t::kCatch) { + print_debug(m, ostr); + ostr << indent(1) << "option " + << render_message_text(m.message_name()) << '\n'; + } + else if (m.type() == message_t::kTryEnd) { + print_debug(m, ostr); + ostr << indent(1) << "end\n"; + } + else if (m.type() == message_t::kSwitch) { + print_debug(m, ostr); + ostr << indent(1) << "alt\n"; + } + else if (m.type() == message_t::kCase) { + print_debug(m, ostr); + ostr << indent(1) << "else " + << render_message_text(m.message_name()) << '\n'; + } + else if (m.type() == message_t::kSwitchEnd) { + ostr << indent(1) << "end\n"; + } + else if (m.type() == message_t::kConditional) { + print_debug(m, ostr); + ostr << indent(1) << "alt"; + if (const auto &text = m.condition_text(); text.has_value()) + ostr << " " << render_message_text(text.value()); + ostr << '\n'; + } + else if (m.type() == message_t::kConditionalElse) { + print_debug(m, ostr); + ostr << indent(1) << "else\n"; + } + else if (m.type() == message_t::kConditionalEnd) { + ostr << indent(1) << "end\n"; + } + } +} + +void generator::generate_participant( + std::ostream &ostr, const std::string &name) const +{ + auto p = model().get(name); + + if (!p.has_value()) { + LOG_WARN("Cannot find participant {} from `participants_order` option", + name); + return; + } + + generate_participant(ostr, p.value().id(), true); +} + +void generator::generate_participant( + std::ostream &ostr, common::id_t id, bool force) const +{ + common::id_t participant_id{0}; + + if (!force) { + for (const auto pid : model().active_participants()) { + if (pid == id) { + participant_id = pid; + break; + } + } + } + else + participant_id = id; + + if (participant_id == 0) + return; + + if (is_participant_generated(participant_id)) + return; + + const auto &participant = + model().get_participant(participant_id).value(); + + if (participant.type_name() == "method") { + const auto class_id = + model() + .get_participant(participant_id) + .value() + .class_id(); + + if (is_participant_generated(class_id)) + return; + + const auto &class_participant = + model().get_participant(class_id).value(); + + print_debug(class_participant, ostr); + + ostr << indent(1) << "participant " << class_participant.alias() + << " as " + << render_participant_name(config().using_namespace().relative( + class_participant.full_name(false))); + + ostr << '\n'; + + generated_participants_.emplace(class_id); + } + else if ((participant.type_name() == "function" || + participant.type_name() == "function_template") && + config().combine_free_functions_into_file_participants()) { + // Create a single participant for all functions declared in a + // single file + const auto &file_path = + model() + .get_participant(participant_id) + .value() + .file(); + + assert(!file_path.empty()); + + const auto file_id = common::to_id(file_path); + + if (is_participant_generated(file_id)) + return; + + auto participant_name = util::path_to_url(std::filesystem::relative( + std::filesystem::path{file_path}, config().root_directory()) + .string()); + + ostr << indent(1) << "participant " << fmt::format("C_{:022}", file_id) + << " as " << render_participant_name(participant_name); + ostr << '\n'; + + generated_participants_.emplace(file_id); + } + else { + print_debug(participant, ostr); + + ostr << indent(1) << "participant " << participant.alias() << " as " + << config().using_namespace().relative( + participant.full_name(false)); + ostr << '\n'; + + generated_participants_.emplace(participant_id); + } +} + +bool generator::is_participant_generated(common::id_t id) const +{ + return std::find(generated_participants_.begin(), + generated_participants_.end(), + id) != generated_participants_.end(); +} + +std::string generator::generate_alias( + const model::participant &participant) const +{ + if ((participant.type_name() == "function" || + participant.type_name() == "function_template") && + config().combine_free_functions_into_file_participants()) { + const auto file_id = common::to_id(participant.file()); + + return fmt::format("C_{:022}", file_id); + } + + return participant.alias(); +} + +void generator::generate_diagram(std::ostream &ostr) const +{ + model().print(); + + ostr << "sequenceDiagram\n"; + + if (config().participants_order.has_value) { + for (const auto &p : config().participants_order()) { + LOG_DBG("Pregenerating participant {}", p); + generate_participant(ostr, p); + } + } + + bool star_participant_generated{false}; + + for (const auto &ft : config().from_to()) { + // First, find the sequence of activities from 'from' location + // to 'to' location + assert(ft.size() == 2); + + const auto &from_location = ft.front(); + const auto &to_location = ft.back(); + + auto from_activity_id = model().get_from_activity_id(from_location); + auto to_activity_id = model().get_to_activity_id(to_location); + + if (from_activity_id == 0 || to_activity_id == 0) + continue; + + auto message_chains_unique = model().get_all_from_to_message_chains( + from_activity_id, to_activity_id); + + for (const auto &mc : message_chains_unique) { + const auto &from = + model().get_participant(from_activity_id); + + if (from.value().type_name() == "method" || + config().combine_free_functions_into_file_participants()) { + if (!star_participant_generated) { + ostr << indent(1) << "participant *\n"; + star_participant_generated = true; + } + generate_participant(ostr, from_activity_id); + ostr << indent(1) << "* " + << common::generators::mermaid::to_mermaid( + message_t::kCall) + << " " << generate_alias(from.value()) << " : " + << from.value().message_name( + select_method_arguments_render_mode()) + << std::endl; + } + + for (const auto &m : mc) { + generate_call(m, ostr); + } + } + } + + for (const auto &to_location : config().to()) { + auto to_activity_id = model().get_to_activity_id(to_location); + + if (to_activity_id == 0) + continue; + + auto message_chains_unique = + model().get_all_from_to_message_chains(0, to_activity_id); + + for (const auto &mc : message_chains_unique) { + const auto from_activity_id = mc.front().from(); + + const auto &from = + model().get_participant(from_activity_id); + + if (from.value().type_name() == "method" || + config().combine_free_functions_into_file_participants()) { + generate_participant(ostr, from_activity_id); + ostr << indent(1) << "* " + << common::generators::mermaid::to_mermaid( + message_t::kCall) + << " " << generate_alias(from.value()) << " : " + << from.value().message_name( + select_method_arguments_render_mode()) + << std::endl; + } + + for (const auto &m : mc) { + generate_call(m, ostr); + } + } + } + + for (const auto &sf : config().from()) { + if (sf.location_type == location_t::function) { + common::model::diagram_element::id_t start_from{0}; + for (const auto &[k, v] : model().sequences()) { + const auto &caller = *model().participants().at(v.from()); + std::string vfrom = caller.full_name(false); + if (vfrom == sf.location) { + LOG_DBG("Found sequence diagram start point: {}", k); + start_from = k; + break; + } + } + + if (start_from == 0) { + LOG_WARN("Failed to find participant with {} for start_from " + "condition", + sf.location); + continue; + } + + // Use this to break out of recurrent loops + std::vector + visited_participants; + + const auto &from = + model().get_participant(start_from); + + if (!from.has_value()) { + LOG_WARN("Failed to find participant {} for start_from " + "condition", + sf.location); + continue; + } + + generate_participant(ostr, start_from); + + std::string from_alias = generate_alias(from.value()); + + model::function::message_render_mode render_mode = + select_method_arguments_render_mode(); + + // For methods or functions in diagrams where they are combined into + // file participants, we need to add an 'entry' point call to know + // which method relates to the first activity for this 'start_from' + // condition + if (from.value().type_name() == "method" || + config().combine_free_functions_into_file_participants()) { + ostr << indent(1) << "* " + << common::generators::mermaid::to_mermaid( + message_t::kCall) + << " " << from_alias << " : " + << from.value().message_name(render_mode) << std::endl; + } + + ostr << indent(1) << "activate " << from_alias << std::endl; + + generate_activity( + model().get_activity(start_from), ostr, visited_participants); + + if (from.value().type_name() == "method" || + config().combine_free_functions_into_file_participants()) { + + if (!from.value().is_void()) { + ostr << indent(1) << from_alias << " " + << common::generators::mermaid::to_mermaid( + message_t::kReturn) + << " *" + << " : "; + + if (config().generate_return_types()) + ostr << from.value().return_type(); + + ostr << '\n'; + } + } + + ostr << indent(1) << "deactivate " << from_alias << std::endl; + } + else { + // TODO: Add support for other sequence start location types + continue; + } + } +} + +model::function::message_render_mode +generator::select_method_arguments_render_mode() const +{ + if (config().generate_method_arguments() == + config::method_arguments::abbreviated) + return model::function::message_render_mode::abbreviated; + + if (config().generate_method_arguments() == config::method_arguments::none) + return model::function::message_render_mode::no_arguments; + + return model::function::message_render_mode::full; +} + +} // namespace clanguml::sequence_diagram::generators::mermaid diff --git a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.h b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.h new file mode 100644 index 00000000..823f729f --- /dev/null +++ b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.h @@ -0,0 +1,141 @@ +/** + * @file src/sequence_diagram/generators/mermaid/sequence_diagram_generator.h + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "common/generators/mermaid/generator.h" +#include "config/config.h" +#include "sequence_diagram/model/diagram.h" +#include "sequence_diagram/visitor/translation_unit_visitor.h" +#include "util/util.h" + +#include + +#include +#include +#include +#include + +namespace clanguml { +namespace sequence_diagram { +namespace generators { +namespace mermaid { + +using diagram_config = clanguml::config::sequence_diagram; +using diagram_model = clanguml::sequence_diagram::model::diagram; + +template +using common_generator = clanguml::common::generators::mermaid::generator; + +/** + * @brief Sequence diagram MermaidJS generator + */ +class generator : public common_generator { +public: + generator(diagram_config &config, diagram_model &model); + + using common_generator::generate; + + /** + * @brief Main generator method. + * + * This method is called first and coordinates the entire diagram + * generation. + * + * @param ostr Output stream. + */ + void generate_diagram(std::ostream &ostr) const override; + + /** + * @brief Generate sequence diagram message. + * + * @param m Message model + * @param ostr Output stream + */ + void generate_call(const clanguml::sequence_diagram::model::message &m, + std::ostream &ostr) const; + + /** + * @brief Generate sequence diagram return message + * + * @param m Message model + * @param ostr Output stream + */ + void generate_return(const clanguml::sequence_diagram::model::message &m, + std::ostream &ostr) const; + + /** + * @brief Generate sequence diagram participant + * + * @param ostr Output stream + * @param id Participant id + * @param force If true, generate the participant even if its not in + * the set of active participants + * @return Id of the generated participant + */ + void generate_participant( + std::ostream &ostr, common::id_t id, bool force = false) const; + + /** + * @brief Generate sequence diagram participant by name + * + * This is convenience wrapper over `generate_participant()` by id. + * + * @param ostr Output stream + * @param name Full participant name + */ + void generate_participant( + std::ostream &ostr, const std::string &name) const; + + /** + * @brief Generate sequence diagram activity. + * + * @param a Activity model + * @param ostr Output stream + * @param visited List of already visited participants, this is necessary + * for breaking infinite recursion on recursive calls + */ + void generate_activity(const clanguml::sequence_diagram::model::activity &a, + std::ostream &ostr, + std::vector &visited) const; + +private: + /** + * @brief Check if specified participant has already been generated. + * + * @param id Participant id. + * @return True, if participant has already been generated. + */ + bool is_participant_generated(common::id_t id) const; + + /** + * @brief Generate MermaidJS alias for participant + * + * @param participant Sequence diagram participant model + * @return Particpant alias + */ + std::string generate_alias(const model::participant &participant) const; + + mutable std::set generated_participants_; + model::function::message_render_mode + select_method_arguments_render_mode() const; +}; + +} // namespace mermaid +} // namespace generators +} // namespace sequence_diagram +} // namespace clanguml diff --git a/tests/t20001/test_case.h b/tests/t20001/test_case.h index 2b02bab1..f8706b2d 100644 --- a/tests/t20001/test_case.h +++ b/tests/t20001/test_case.h @@ -66,4 +66,9 @@ TEST_CASE("t20001", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t20002/test_case.h b/tests/t20002/test_case.h index 8b281240..fdfd4081 100644 --- a/tests/t20002/test_case.h +++ b/tests/t20002/test_case.h @@ -60,4 +60,10 @@ TEST_CASE("t20002", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t20003/test_case.h b/tests/t20003/test_case.h index d5bbbbc4..f27ced2e 100644 --- a/tests/t20003/test_case.h +++ b/tests/t20003/test_case.h @@ -55,4 +55,10 @@ TEST_CASE("t20003", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t20004/test_case.h b/tests/t20004/test_case.h index 82f483c5..eb6ac747 100644 --- a/tests/t20004/test_case.h +++ b/tests/t20004/test_case.h @@ -82,4 +82,10 @@ TEST_CASE("t20004", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20005/test_case.h b/tests/t20005/test_case.h index e9436077..49f0babe 100644 --- a/tests/t20005/test_case.h +++ b/tests/t20005/test_case.h @@ -56,4 +56,10 @@ TEST_CASE("t20005", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20007/test_case.h b/tests/t20007/test_case.h index c995b9f5..c16b95d6 100644 --- a/tests/t20007/test_case.h +++ b/tests/t20007/test_case.h @@ -66,4 +66,10 @@ TEST_CASE("t20007", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20008/test_case.h b/tests/t20008/test_case.h index 57779662..47f8a529 100644 --- a/tests/t20008/test_case.h +++ b/tests/t20008/test_case.h @@ -76,4 +76,10 @@ TEST_CASE("t20008", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20009/test_case.h b/tests/t20009/test_case.h index e36f41fe..b11a4597 100644 --- a/tests/t20009/test_case.h +++ b/tests/t20009/test_case.h @@ -68,4 +68,10 @@ TEST_CASE("t20009", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20010/test_case.h b/tests/t20010/test_case.h index 5a5cc9f0..600784b0 100644 --- a/tests/t20010/test_case.h +++ b/tests/t20010/test_case.h @@ -70,4 +70,10 @@ TEST_CASE("t20010", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20011/test_case.h b/tests/t20011/test_case.h index 8d44803c..26cea6ef 100644 --- a/tests/t20011/test_case.h +++ b/tests/t20011/test_case.h @@ -63,4 +63,10 @@ TEST_CASE("t20011", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20013/test_case.h b/tests/t20013/test_case.h index e3b826a7..b885fe88 100644 --- a/tests/t20013/test_case.h +++ b/tests/t20013/test_case.h @@ -67,4 +67,10 @@ TEST_CASE("t20013", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20014/test_case.h b/tests/t20014/test_case.h index 00d194a4..e5910ec7 100644 --- a/tests/t20014/test_case.h +++ b/tests/t20014/test_case.h @@ -66,4 +66,10 @@ TEST_CASE("t20014", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20015/test_case.h b/tests/t20015/test_case.h index 0a05b4a6..c56f2499 100644 --- a/tests/t20015/test_case.h +++ b/tests/t20015/test_case.h @@ -61,4 +61,10 @@ TEST_CASE("t20015", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20016/test_case.h b/tests/t20016/test_case.h index 15e35993..92ef295f 100644 --- a/tests/t20016/test_case.h +++ b/tests/t20016/test_case.h @@ -59,4 +59,10 @@ TEST_CASE("t20016", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20017/test_case.h b/tests/t20017/test_case.h index 8f5e26fb..e617b4a8 100644 --- a/tests/t20017/test_case.h +++ b/tests/t20017/test_case.h @@ -73,4 +73,10 @@ TEST_CASE("t20017", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20018/test_case.h b/tests/t20018/test_case.h index 1eea53f7..cb3d8d69 100644 --- a/tests/t20018/test_case.h +++ b/tests/t20018/test_case.h @@ -76,4 +76,10 @@ TEST_CASE("t20018", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20019/test_case.h b/tests/t20019/test_case.h index 903efeda..68de2fbd 100644 --- a/tests/t20019/test_case.h +++ b/tests/t20019/test_case.h @@ -59,4 +59,10 @@ TEST_CASE("t20019", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20020/test_case.h b/tests/t20020/test_case.h index 5314b9ef..63538cbf 100644 --- a/tests/t20020/test_case.h +++ b/tests/t20020/test_case.h @@ -79,4 +79,10 @@ TEST_CASE("t20020", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20021/test_case.h b/tests/t20021/test_case.h index f2a98000..c4016afb 100644 --- a/tests/t20021/test_case.h +++ b/tests/t20021/test_case.h @@ -85,4 +85,10 @@ TEST_CASE("t20021", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20022/test_case.h b/tests/t20022/test_case.h index 026930a4..a3a2bbf0 100644 --- a/tests/t20022/test_case.h +++ b/tests/t20022/test_case.h @@ -53,4 +53,10 @@ TEST_CASE("t20022", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20023/test_case.h b/tests/t20023/test_case.h index 4f17bd6b..087e2b93 100644 --- a/tests/t20023/test_case.h +++ b/tests/t20023/test_case.h @@ -57,4 +57,10 @@ TEST_CASE("t20023", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20024/test_case.h b/tests/t20024/test_case.h index 57d13c91..9f5768b0 100644 --- a/tests/t20024/test_case.h +++ b/tests/t20024/test_case.h @@ -63,4 +63,10 @@ TEST_CASE("t20024", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20025/test_case.h b/tests/t20025/test_case.h index b468ad25..b46e0245 100644 --- a/tests/t20025/test_case.h +++ b/tests/t20025/test_case.h @@ -57,4 +57,10 @@ TEST_CASE("t20025", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20026/test_case.h b/tests/t20026/test_case.h index cdd56156..da5dd601 100644 --- a/tests/t20026/test_case.h +++ b/tests/t20026/test_case.h @@ -51,4 +51,10 @@ TEST_CASE("t20026", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20027/test_case.h b/tests/t20027/test_case.h index 4562a71d..5476d0fe 100644 --- a/tests/t20027/test_case.h +++ b/tests/t20027/test_case.h @@ -53,4 +53,10 @@ TEST_CASE("t20027", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20028/test_case.h b/tests/t20028/test_case.h index b596fa7d..01174a4d 100644 --- a/tests/t20028/test_case.h +++ b/tests/t20028/test_case.h @@ -59,4 +59,10 @@ TEST_CASE("t20028", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20029/test_case.h b/tests/t20029/test_case.h index 6438d32f..17900066 100644 --- a/tests/t20029/test_case.h +++ b/tests/t20029/test_case.h @@ -83,4 +83,10 @@ TEST_CASE("t20029", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20030/test_case.h b/tests/t20030/test_case.h index aced9127..167e5ebb 100644 --- a/tests/t20030/test_case.h +++ b/tests/t20030/test_case.h @@ -62,4 +62,10 @@ TEST_CASE("t20030", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20031/test_case.h b/tests/t20031/test_case.h index 707a9146..01a08bee 100644 --- a/tests/t20031/test_case.h +++ b/tests/t20031/test_case.h @@ -65,4 +65,10 @@ TEST_CASE("t20031", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20032/test_case.h b/tests/t20032/test_case.h index 9f5d4242..6003423a 100644 --- a/tests/t20032/test_case.h +++ b/tests/t20032/test_case.h @@ -75,4 +75,10 @@ TEST_CASE("t20032", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20033/test_case.h b/tests/t20033/test_case.h index 22eaff7b..41703b18 100644 --- a/tests/t20033/test_case.h +++ b/tests/t20033/test_case.h @@ -54,4 +54,10 @@ TEST_CASE("t20033", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20034/test_case.h b/tests/t20034/test_case.h index d184d1ac..3ad62327 100644 --- a/tests/t20034/test_case.h +++ b/tests/t20034/test_case.h @@ -73,4 +73,10 @@ TEST_CASE("t20034", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20035/test_case.h b/tests/t20035/test_case.h index 67b3614f..b73c22f1 100644 --- a/tests/t20035/test_case.h +++ b/tests/t20035/test_case.h @@ -53,4 +53,10 @@ TEST_CASE("t20035", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20036/test_case.h b/tests/t20036/test_case.h index 5f9ca877..e3e6c548 100644 --- a/tests/t20036/test_case.h +++ b/tests/t20036/test_case.h @@ -69,4 +69,10 @@ TEST_CASE("t20036", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index e49adbf0..e760bbab 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -235,6 +235,14 @@ std::string generate_class_mermaid( config, model); } +std::string generate_sequence_mermaid( + std::shared_ptr config, + clanguml::sequence_diagram::model::diagram &model) +{ + return detail::generate_diagram_mermaid( + config, model); +} + template void save_diagram(const std::filesystem::path &path, const T &diagram) { diff --git a/util/generate_mermaid.py b/util/generate_mermaid.py index a7cccce0..51fa120b 100644 --- a/util/generate_mermaid.py +++ b/util/generate_mermaid.py @@ -38,7 +38,7 @@ ok = 0 for f in files: try: print(f'Generating Mermaid diagram from {f}') - f_svg = Path(f).with_suffix('.png') + f_svg = Path(f).with_suffix('.svg') subprocess.check_call(['mmdc', '-i', f, '-o', f_svg]) except subprocess.CalledProcessError: ok = 1 From ee998e7a38a92af221b5b49aaebeed737c6fbb8c Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 9 Sep 2023 00:18:03 +0200 Subject: [PATCH 04/24] Added initial support for MermaidJS package diagrams --- src/common/generators/generators.h | 11 +- src/common/generators/mermaid/generator.h | 2 +- .../mermaid/package_diagram_generator.cc | 169 ++++++++++++++++++ .../mermaid/package_diagram_generator.h | 110 ++++++++++++ tests/t30001/test_case.h | 6 + tests/t30002/test_case.h | 6 + tests/t30003/test_case.h | 6 + tests/t30004/test_case.h | 6 + tests/t30005/test_case.h | 6 + tests/t30006/test_case.h | 6 + tests/t30007/test_case.h | 6 + tests/t30008/test_case.h | 6 + tests/t30009/test_case.h | 6 + tests/t30010/test_case.h | 6 + tests/t30011/test_case.h | 6 + tests/test_cases.cc | 8 + 16 files changed, 360 insertions(+), 6 deletions(-) create mode 100644 src/package_diagram/generators/mermaid/package_diagram_generator.cc create mode 100644 src/package_diagram/generators/mermaid/package_diagram_generator.h diff --git a/src/common/generators/generators.h b/src/common/generators/generators.h index 8c3d29d1..f315c124 100644 --- a/src/common/generators/generators.h +++ b/src/common/generators/generators.h @@ -29,6 +29,7 @@ #include "include_diagram/generators/plantuml/include_diagram_generator.h" #include "indicators/indicators.hpp" #include "package_diagram/generators/json/package_diagram_generator.h" +#include "package_diagram/generators/mermaid/package_diagram_generator.h" #include "package_diagram/generators/plantuml/package_diagram_generator.h" #include "sequence_diagram/generators/json/sequence_diagram_generator.h" #include "sequence_diagram/generators/mermaid/sequence_diagram_generator.h" @@ -174,11 +175,11 @@ struct diagram_generator_t { using type = clanguml::sequence_diagram::generators::mermaid::generator; }; -// template <> -// struct diagram_generator_t { -// using type = clanguml::package_diagram::generators::mermaid::generator; -// }; +template <> +struct diagram_generator_t { + using type = clanguml::package_diagram::generators::mermaid::generator; +}; // template <> // struct diagram_generator_t { diff --git a/src/common/generators/mermaid/generator.h b/src/common/generators/mermaid/generator.h index bff4bfed..1485c6a7 100644 --- a/src/common/generators/mermaid/generator.h +++ b/src/common/generators/mermaid/generator.h @@ -126,7 +126,7 @@ public: * @param ostr Output stream * @param element Element to which the note should be attached */ - void generate_notes( + virtual void generate_notes( std::ostream &ostr, const model::element &element) const; /** diff --git a/src/package_diagram/generators/mermaid/package_diagram_generator.cc b/src/package_diagram/generators/mermaid/package_diagram_generator.cc new file mode 100644 index 00000000..58808244 --- /dev/null +++ b/src/package_diagram/generators/mermaid/package_diagram_generator.cc @@ -0,0 +1,169 @@ +/** + * @file src/package_diagram/generators/mermaid/package_diagram_generator.cc + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "package_diagram_generator.h" + +#include "util/error.h" + +namespace clanguml::package_diagram::generators::mermaid { + +using clanguml::common::generators::mermaid::indent; + +generator::generator(diagram_config &config, diagram_model &model) + : common_generator{config, model} + , together_group_stack_{false} +{ +} + +void generator::generate_relationships( + const package &p, std::ostream &ostr) const +{ + LOG_DBG("Generating relationships for package {}", p.full_name(true)); + + // Generate this packages relationship + if (model().should_include(relationship_t::kDependency)) { + for (const auto &r : p.relationships()) { + std::stringstream relstr; + try { + auto destination = model().to_alias(r.destination()); + if (!destination.empty()) { + relstr << p.alias() << " -.-> " << destination << '\n'; + ostr << indent(1) << relstr.str(); + } + } + catch (error::uml_alias_missing &e) { + LOG_DBG("=== Skipping dependency relation from {} to {} due " + "to: {}", + p.full_name(false), r.destination(), e.what()); + } + } + } + + // Process it's subpackages relationships + for (const auto &subpackage : p) { + generate_relationships( + dynamic_cast(*subpackage), ostr); + } +} + +void generator::generate(const package &p, std::ostream &ostr) const +{ + LOG_DBG("Generating package {}", p.name()); + + together_group_stack_.enter(); + + const auto &uns = config().using_namespace(); + + // Don't generate packages from namespaces filtered out by + // using_namespace + if (!uns.starts_with({p.full_name(false)})) { + ostr << indent(1) << "subgraph " << p.alias() << "[" << p.name() + << "]\n"; + + if (p.is_deprecated()) + ostr << indent(1) << "%% <>"; + } + + for (const auto &subpackage : p) { + auto &pkg = dynamic_cast(*subpackage); + if (model().should_include(pkg)) { + auto together_group = + config().get_together_group(pkg.full_name(false)); + if (together_group) { + together_group_stack_.group_together( + together_group.value(), &pkg); + } + else { + generate(pkg, ostr); + } + } + } + + generate_groups(ostr); + + if (!uns.starts_with({p.full_name(false)})) { + ostr << indent(1) << "end" << '\n'; + } + + generate_notes(ostr, p); + + together_group_stack_.leave(); +} + +void generator::generate_groups(std::ostream &ostr) const +{ + for (const auto &[group_name, group_elements] : + together_group_stack_.get_current_groups()) { + ostr << indent(1) << "%% together group - not rendered in MermaidJS \n"; + + for (auto *pkg : group_elements) { + generate(*pkg, ostr); + } + + ostr << indent(1) << "%% end together group\n"; + } +} + +void generator::generate_notes( + std::ostream &ostr, const common::model::element &element) const +{ + const auto &config = + common_generator::config(); + + for (const auto &decorator : element.decorators()) { + auto note = std::dynamic_pointer_cast(decorator); + if (note && note->applies_to_diagram(config.name)) { + auto note_id_str = fmt::format("N_{}", note_id_++); + + ostr << indent(1) << note_id_str << "(" << note->text << ")\n"; + + ostr << indent(1) << note_id_str << "-.-" << element.alias() + << '\n'; + } + } +} + +void generator::generate_diagram(std::ostream &ostr) const +{ + ostr << "flowchart\n"; + + for (const auto &p : model()) { + auto &pkg = dynamic_cast(*p); + if (model().should_include(pkg)) { + auto together_group = + config().get_together_group(pkg.full_name(false)); + if (together_group) { + together_group_stack_.group_together( + together_group.value(), &pkg); + } + else { + generate(pkg, ostr); + } + } + } + + generate_groups(ostr); + + // Process package relationships + for (const auto &p : model()) { + if (model().should_include(dynamic_cast(*p))) + generate_relationships(dynamic_cast(*p), ostr); + } +} + +} // namespace clanguml::package_diagram::generators::mermaid diff --git a/src/package_diagram/generators/mermaid/package_diagram_generator.h b/src/package_diagram/generators/mermaid/package_diagram_generator.h new file mode 100644 index 00000000..4b186990 --- /dev/null +++ b/src/package_diagram/generators/mermaid/package_diagram_generator.h @@ -0,0 +1,110 @@ +/** + * @file src/package_diagram/generators/mermaid/package_diagram_generator.h + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "common/generators/mermaid/generator.h" +#include "common/generators/nested_element_stack.h" +#include "common/model/package.h" +#include "common/model/relationship.h" +#include "config/config.h" +#include "package_diagram/model/diagram.h" +#include "package_diagram/visitor/translation_unit_visitor.h" +#include "util/util.h" + +#include +#include +#include +#include + +namespace clanguml { +namespace package_diagram { +namespace generators { +namespace mermaid { + +using diagram_config = clanguml::config::package_diagram; +using diagram_model = clanguml::package_diagram::model::diagram; + +template +using common_generator = clanguml::common::generators::mermaid::generator; + +using clanguml::common::model::access_t; +using clanguml::common::model::package; +using clanguml::common::model::relationship_t; +using namespace clanguml::util; + +/** + * @brief Package diagram MermaidJS generator + */ +class generator : public common_generator { +public: + generator(diagram_config &config, diagram_model &model); + + using common_generator::generate; + + /** + * @brief Main generator method. + * + * This method is called first and coordinates the entire diagram + * generation. + * + * @param ostr Output stream. + */ + void generate_diagram(std::ostream &ostr) const override; + + /** + * @brief Generate relationships originating from package `p` + * + * @param p Diagram element + * @param parent Output stream + */ + void generate_relationships(const package &p, std::ostream &ostr) const; + + /** + * @brief Generate diagram package element + * + * @param p Package diagram element + * @param parent Output stream + */ + void generate(const package &e, std::ostream &ostr) const; + + /** + * @brief Generate package elements grouped using `together` MermaidJS tag + * + * @param ostr Output stream + */ + void generate_groups(std::ostream &ostr) const; + + /** + * @brief Generate notes attached to packages + * + * @param ostr Output stream + * @param element Element with a note + */ + void generate_notes(std::ostream &ostr, + const common::model::element &element) const override; + +private: + mutable unsigned long note_id_{0UL}; + mutable common::generators::nested_element_stack + together_group_stack_; +}; + +} // namespace mermaid +} // namespace generators +} // namespace package_diagram +} // namespace clanguml diff --git a/tests/t30001/test_case.h b/tests/t30001/test_case.h index c6beef2e..50faf08b 100644 --- a/tests/t30001/test_case.h +++ b/tests/t30001/test_case.h @@ -82,4 +82,10 @@ TEST_CASE("t30001", "[test-case][package]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_package_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t30002/test_case.h b/tests/t30002/test_case.h index 90b630b5..1ebcd105 100644 --- a/tests/t30002/test_case.h +++ b/tests/t30002/test_case.h @@ -121,4 +121,10 @@ TEST_CASE("t30002", "[test-case][package]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_package_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t30003/test_case.h b/tests/t30003/test_case.h index a7ae58c7..f001ca5e 100644 --- a/tests/t30003/test_case.h +++ b/tests/t30003/test_case.h @@ -63,4 +63,10 @@ TEST_CASE("t30003", "[test-case][package]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_package_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t30004/test_case.h b/tests/t30004/test_case.h index d4a2e2c8..61c5cd81 100644 --- a/tests/t30004/test_case.h +++ b/tests/t30004/test_case.h @@ -58,4 +58,10 @@ TEST_CASE("t30004", "[test-case][package]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_package_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t30005/test_case.h b/tests/t30005/test_case.h index ac1ac61c..3c297da7 100644 --- a/tests/t30005/test_case.h +++ b/tests/t30005/test_case.h @@ -65,4 +65,10 @@ TEST_CASE("t30005", "[test-case][package]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_package_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t30006/test_case.h b/tests/t30006/test_case.h index 5a11b407..618a393a 100644 --- a/tests/t30006/test_case.h +++ b/tests/t30006/test_case.h @@ -59,4 +59,10 @@ TEST_CASE("t30006", "[test-case][package]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_package_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t30007/test_case.h b/tests/t30007/test_case.h index 9287c03d..249f9a22 100644 --- a/tests/t30007/test_case.h +++ b/tests/t30007/test_case.h @@ -63,4 +63,10 @@ TEST_CASE("t30007", "[test-case][package]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_package_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t30008/test_case.h b/tests/t30008/test_case.h index 8ced1931..c737f815 100644 --- a/tests/t30008/test_case.h +++ b/tests/t30008/test_case.h @@ -77,4 +77,10 @@ TEST_CASE("t30008", "[test-case][package]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_package_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t30009/test_case.h b/tests/t30009/test_case.h index 1d36c541..41e2575c 100644 --- a/tests/t30009/test_case.h +++ b/tests/t30009/test_case.h @@ -64,4 +64,10 @@ TEST_CASE("t30009", "[test-case][package]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_package_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t30010/test_case.h b/tests/t30010/test_case.h index 21f2f277..b2bd5dca 100644 --- a/tests/t30010/test_case.h +++ b/tests/t30010/test_case.h @@ -57,4 +57,10 @@ TEST_CASE("t30010", "[test-case][package]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_package_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t30011/test_case.h b/tests/t30011/test_case.h index 794934d8..3af06b7a 100644 --- a/tests/t30011/test_case.h +++ b/tests/t30011/test_case.h @@ -57,4 +57,10 @@ TEST_CASE("t30011", "[test-case][package]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_package_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/test_cases.cc b/tests/test_cases.cc index e760bbab..8fbf3350 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -243,6 +243,14 @@ std::string generate_sequence_mermaid( config, model); } +std::string generate_package_mermaid( + std::shared_ptr config, + clanguml::package_diagram::model::diagram &model) +{ + return detail::generate_diagram_mermaid( + config, model); +} + template void save_diagram(const std::filesystem::path &path, const T &diagram) { From cfc0a4232054101609893be16c15de871b5eaef6 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 9 Sep 2023 01:46:08 +0200 Subject: [PATCH 05/24] Added initial support for MermaidJS include diagrams --- src/common/generators/generators.h | 11 +- .../mermaid/include_diagram_generator.cc | 132 ++++++++++++++++++ .../mermaid/include_diagram_generator.h | 96 +++++++++++++ tests/t40001/.clang-uml | 6 +- tests/t40001/test_case.h | 6 + tests/t40002/test_case.h | 6 + tests/t40003/test_case.h | 6 + tests/test_cases.cc | 8 ++ 8 files changed, 265 insertions(+), 6 deletions(-) create mode 100644 src/include_diagram/generators/mermaid/include_diagram_generator.cc create mode 100644 src/include_diagram/generators/mermaid/include_diagram_generator.h diff --git a/src/common/generators/generators.h b/src/common/generators/generators.h index f315c124..151da4be 100644 --- a/src/common/generators/generators.h +++ b/src/common/generators/generators.h @@ -26,6 +26,7 @@ #include "common/model/diagram_filter.h" #include "config/config.h" #include "include_diagram/generators/json/include_diagram_generator.h" +#include "include_diagram/generators/mermaid/include_diagram_generator.h" #include "include_diagram/generators/plantuml/include_diagram_generator.h" #include "indicators/indicators.hpp" #include "package_diagram/generators/json/package_diagram_generator.h" @@ -180,11 +181,11 @@ struct diagram_generator_t { using type = clanguml::package_diagram::generators::mermaid::generator; }; -// template <> -// struct diagram_generator_t { -// using type = clanguml::include_diagram::generators::mermaid::generator; -// }; +template <> +struct diagram_generator_t { + using type = clanguml::include_diagram::generators::mermaid::generator; +}; /** @} */ /** diff --git a/src/include_diagram/generators/mermaid/include_diagram_generator.cc b/src/include_diagram/generators/mermaid/include_diagram_generator.cc new file mode 100644 index 00000000..1bce4e14 --- /dev/null +++ b/src/include_diagram/generators/mermaid/include_diagram_generator.cc @@ -0,0 +1,132 @@ +/** + * @file src/include_diagram/generators/mermaid/include_diagram_generator.cc + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "include_diagram_generator.h" + +#include "util/error.h" + +namespace clanguml::include_diagram::generators::mermaid { + +using clanguml::common::generators::mermaid::indent; + +generator::generator(diagram_config &config, diagram_model &model) + : common_generator{config, model} +{ +} + +void generator::generate_relationships( + const source_file &f, std::ostream &ostr) const +{ + if (!util::contains(m_generated_aliases, f.alias())) + return; + + LOG_DBG("Generating relationships for file {}", f.full_name(true)); + + namespace mermaid_common = clanguml::common::generators::mermaid; + + if (f.type() == common::model::source_file_t::kDirectory) { + util::for_each(f, [this, &ostr](const auto &file) { + generate_relationships( + dynamic_cast(*file), ostr); + }); + } + else { + util::for_each_if( + f.relationships(), + [this](const auto &r) { + return model().should_include(r.type()) && + util::contains(m_generated_aliases, + model().get(r.destination()).value().alias()); + }, + [&f, &ostr, this](const auto &r) { + ostr << indent(1) << f.alias() << " " + << (r.type() == common::model::relationship_t::kDependency + ? "-.->" + : "-->") + << " " << model().get(r.destination()).value().alias() + << '\n'; + }); + } +} + +void generator::generate(const source_file &f, std::ostream &ostr) const +{ + if (f.type() == common::model::source_file_t::kDirectory) { + LOG_DBG("Generating directory {}", f.name()); + + ostr << indent(1) << "subgraph " << f.alias() << "[" << f.name() + << "]\n"; + + util::for_each(f, [this, &ostr](const auto &file) { + generate(dynamic_cast(*file), ostr); + }); + + ostr << indent(1) << "end" << '\n'; + + m_generated_aliases.emplace(f.alias()); + } + else { + LOG_DBG("Generating file {}", f.name()); + + if (model().should_include(f)) { + ostr << indent(1) << f.alias() << "[" << f.name() << "]\n"; + + m_generated_aliases.emplace(f.alias()); + } + } +} + +void generator::generate_notes( + std::ostream &ostr, const common::model::source_file &element) const +{ + const auto &config = + common_generator::config(); + + for (const auto &decorator : element.decorators()) { + auto note = std::dynamic_pointer_cast(decorator); + if (note && note->applies_to_diagram(config.name)) { + auto note_id_str = fmt::format("N_{}", note_id_++); + + ostr << indent(1) << note_id_str << "(" << note->text << ")\n"; + + ostr << indent(1) << note_id_str << "-.-" << element.alias() + << '\n'; + } + } +} + +void generator::generate_diagram(std::ostream &ostr) const +{ + ostr << "flowchart\n"; + + // Generate files and folders + util::for_each(model(), [this, &ostr](const auto &f) { + generate(dynamic_cast(*f), ostr); + }); + + // Process file include relationships + util::for_each(model(), [this, &ostr](const auto &f) { + generate_relationships(dynamic_cast(*f), ostr); + }); + + // Process file notes + util::for_each(model(), [this, &ostr](const auto &f) { + generate_notes(ostr, dynamic_cast(*f)); + }); +} +} // namespace clanguml::include_diagram::generators::plantuml diff --git a/src/include_diagram/generators/mermaid/include_diagram_generator.h b/src/include_diagram/generators/mermaid/include_diagram_generator.h new file mode 100644 index 00000000..aa30a471 --- /dev/null +++ b/src/include_diagram/generators/mermaid/include_diagram_generator.h @@ -0,0 +1,96 @@ +/** + * @file src/include_diagram/generators/mermaid/include_diagram_generator.h + * + * Copyright (c) 2021-2023 Bartek Kryza + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "common/generators/mermaid/generator.h" +#include "common/model/package.h" +#include "common/model/relationship.h" +#include "common/model/source_file.h" +#include "config/config.h" +#include "include_diagram/model/diagram.h" +#include "include_diagram/visitor/translation_unit_visitor.h" +#include "util/util.h" + +#include +#include +#include +#include + +namespace clanguml::include_diagram::generators::mermaid { + +using diagram_config = clanguml::config::include_diagram; +using diagram_model = clanguml::include_diagram::model::diagram; + +template +using common_generator = clanguml::common::generators::mermaid::generator; + +using clanguml::common::model::access_t; +using clanguml::common::model::package; +using clanguml::common::model::relationship_t; +using clanguml::common::model::source_file; +using namespace clanguml::util; + +/** + * @brief Include diagram MermaidJS generator + */ +class generator : public common_generator { +public: + generator(diagram_config &config, diagram_model &model); + + using common_generator::generate; + + /** + * @brief Main generator method. + * + * This method is called first and coordinates the entire diagram + * generation. + * + * @param ostr Output stream. + */ + void generate_diagram(std::ostream &ostr) const override; + + /** + * @brief Generate relationships originating from source_file `f` + * + * @param p Diagram element + * @param parent Output stream + */ + void generate_relationships(const source_file &p, std::ostream &ostr) const; + + /** + * @brief Generate notes attached to files + * + * @param ostr Output stream + * @param element Element with a note + */ + void generate_notes( + std::ostream &ostr, const common::model::source_file &element) const; + + /** + * @brief Generate diagram element + * + * @param e Source file diagram element + * @param parent Output stream + */ + void generate(const source_file &e, std::ostream &ostr) const; + +private: + mutable unsigned long note_id_{0UL}; +}; + +} // namespace clanguml::include_diagram::generators::mermaid diff --git a/tests/t40001/.clang-uml b/tests/t40001/.clang-uml index 7400619d..eee88bce 100644 --- a/tests/t40001/.clang-uml +++ b/tests/t40001/.clang-uml @@ -20,4 +20,8 @@ diagrams: - "' t40001 test diagram of type {{ diagram.type }}" after: - 'note right of {{ alias("include/lib1") }}: This is a lib1 include dir' - - 'note right of {{ alias("include/t40001_include1.h") }}: This is a t40001_include1.h include file' \ No newline at end of file + - 'note right of {{ alias("include/t40001_include1.h") }}: This is a t40001_include1.h include file' + mermaid: + after: + - 'N_00001(This is a lib1 include dir)-.-{{ alias("include/lib1") }}' + - 'N_00002(This is a lib1 include dir)-.-{{ alias("include/t40001_include1.h") }}' \ No newline at end of file diff --git a/tests/t40001/test_case.h b/tests/t40001/test_case.h index 9f58a9e1..3905c6f9 100644 --- a/tests/t40001/test_case.h +++ b/tests/t40001/test_case.h @@ -79,4 +79,10 @@ TEST_CASE("t40001", "[test-case][include]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_include_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t40002/test_case.h b/tests/t40002/test_case.h index c57831bb..7f70d770 100644 --- a/tests/t40002/test_case.h +++ b/tests/t40002/test_case.h @@ -110,4 +110,10 @@ TEST_CASE("t40002", "[test-case][include]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_include_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t40003/test_case.h b/tests/t40003/test_case.h index 5a847234..bcadef1a 100644 --- a/tests/t40003/test_case.h +++ b/tests/t40003/test_case.h @@ -74,4 +74,10 @@ TEST_CASE("t40003", "[test-case][include]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_include_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 8fbf3350..c5714ad7 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -251,6 +251,14 @@ std::string generate_package_mermaid( config, model); } +std::string generate_include_mermaid( + std::shared_ptr config, + clanguml::include_diagram::model::diagram &model) +{ + return detail::generate_diagram_mermaid( + config, model); +} + template void save_diagram(const std::filesystem::path &path, const T &diagram) { From 0a542a954b258d41a4af7336750b3a00f8931cf7 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 9 Sep 2023 18:41:31 +0200 Subject: [PATCH 06/24] Added link generation in mermaid diagram generator --- .../mermaid/class_diagram_generator.cc | 12 +++ src/common/generators/mermaid/generator.h | 78 +++++++++++-------- .../mermaid/include_diagram_generator.cc | 4 + .../mermaid/package_diagram_generator.cc | 4 + 4 files changed, 65 insertions(+), 33 deletions(-) diff --git a/src/class_diagram/generators/mermaid/class_diagram_generator.cc b/src/class_diagram/generators/mermaid/class_diagram_generator.cc index 5e92a975..15c66af6 100644 --- a/src/class_diagram/generators/mermaid/class_diagram_generator.cc +++ b/src/class_diagram/generators/mermaid/class_diagram_generator.cc @@ -121,6 +121,10 @@ void generator::generate(const class_ &c, std::ostream &ostr) const ostr << indent(1) << "}" << '\n'; + if (config().generate_links) { + common_generator::generate_link(ostr, c); + } + generate_notes(ostr, c); for (const auto &member : c.members()) @@ -279,6 +283,10 @@ void generator::generate(const concept_ &c, std::ostream &ostr) const } ostr << indent(1) << "}" << '\n'; + + if (config().generate_links) { + common_generator::generate_link(ostr, c); + } } void generator::generate_member_notes(std::ostream &ostr, @@ -584,6 +592,10 @@ void generator::generate(const enum_ &e, std::ostream &ostr) const ostr << indent(1) << "}" << '\n'; + if (config().generate_links) { + common_generator::generate_link(ostr, e); + } + generate_notes(ostr, e); } diff --git a/src/common/generators/mermaid/generator.h b/src/common/generators/mermaid/generator.h index 1485c6a7..4361f01e 100644 --- a/src/common/generators/mermaid/generator.h +++ b/src/common/generators/mermaid/generator.h @@ -94,16 +94,6 @@ public: */ virtual void generate_diagram(std::ostream &ostr) const = 0; - /** - * @brief Generate diagram layout hints - * - * This method adds to the diagram any layout hints that were provided - * in the configuration file. - * - * @param ostr Output stream - */ - void generate_config_layout_hints(std::ostream &ostr) const; - /** * @brief Generate MermaidJS directives from config file. * @@ -250,34 +240,56 @@ void generator::generate(std::ostream &ostr) const } template -void generator::generate_config_layout_hints(std::ostream &ostr) const +template +void generator::generate_link(std::ostream &ostr, const E &e) const { - using namespace clanguml::util; - const auto &config = generators::generator::config(); - // Generate layout hints - for (const auto &[entity_name, hints] : config.layout()) { - for (const auto &hint : hints) { - try { - if (hint.hint == config::hint_t::together) { - // 'together' layout hint is handled separately - } - else if (hint.hint == config::hint_t::row || - hint.hint == config::hint_t::column) { - generate_row_column_hints(ostr, entity_name, hint); - } - else { - generate_position_hints(ostr, entity_name, hint); - } - } - catch (clanguml::error::uml_alias_missing &e) { - LOG_DBG("=== Skipping layout hint '{}' from {} due " - "to: {}", - to_string(hint.hint), entity_name, e.what()); - } + if (e.file().empty()) + return; + + if (config.generate_links().link.empty() && + config.generate_links().tooltip.empty()) + return; + + ostr << indent(1) << "click " << e.alias() << " href \""; + try { + if (!config.generate_links().link.empty()) { + ostr << env().render(std::string_view{config.generate_links().link}, + element_context(e)); } } + catch (const inja::json::parse_error &e) { + LOG_ERROR( + "Failed to parse Jinja template: {}", config.generate_links().link); + } + catch (const inja::json::exception &e) { + LOG_ERROR("Failed to render PlantUML directive: \n{}\n due to: {}", + config.generate_links().link, e.what()); + } + ostr << "\""; + + if (!config.generate_links().tooltip.empty()) { + ostr << " \""; + try { + auto tooltip_text = + env().render(std::string_view{config.generate_links().tooltip}, + element_context(e)); + util::replace_all(tooltip_text, "\"", "„"); + ostr << tooltip_text; + } + catch (const inja::json::parse_error &e) { + LOG_ERROR("Failed to parse Jinja template: {}", + config.generate_links().link); + } + catch (const inja::json::exception &e) { + LOG_ERROR("Failed to render PlantUML directive: \n{}\n due to: {}", + config.generate_links().link, e.what()); + } + + ostr << "\""; + } + ostr << "\n"; } template diff --git a/src/include_diagram/generators/mermaid/include_diagram_generator.cc b/src/include_diagram/generators/mermaid/include_diagram_generator.cc index 1bce4e14..de4acfd4 100644 --- a/src/include_diagram/generators/mermaid/include_diagram_generator.cc +++ b/src/include_diagram/generators/mermaid/include_diagram_generator.cc @@ -89,6 +89,10 @@ void generator::generate(const source_file &f, std::ostream &ostr) const m_generated_aliases.emplace(f.alias()); } } + + if (config().generate_links) { + common_generator::generate_link(ostr, f); + } } void generator::generate_notes( diff --git a/src/package_diagram/generators/mermaid/package_diagram_generator.cc b/src/package_diagram/generators/mermaid/package_diagram_generator.cc index 58808244..82a58373 100644 --- a/src/package_diagram/generators/mermaid/package_diagram_generator.cc +++ b/src/package_diagram/generators/mermaid/package_diagram_generator.cc @@ -100,6 +100,10 @@ void generator::generate(const package &p, std::ostream &ostr) const ostr << indent(1) << "end" << '\n'; } + if (config().generate_links) { + common_generator::generate_link(ostr, p); + } + generate_notes(ostr, p); together_group_stack_.leave(); From ae40a3b18433a4ebf0abf1ee543ecd3947ec22d5 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 9 Sep 2023 19:00:21 +0200 Subject: [PATCH 07/24] Added mermaid generator cli option --- src/cli/cli_handler.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli/cli_handler.cc b/src/cli/cli_handler.cc index 1079aeba..12b902e3 100644 --- a/src/cli/cli_handler.cc +++ b/src/cli/cli_handler.cc @@ -72,7 +72,8 @@ cli_flow_t cli_handler::parse(int argc, const char **argv) static const std::map generator_type_names{ {"plantuml", clanguml::common::generator_type_t::plantuml}, - {"json", clanguml::common::generator_type_t::json}}; + {"json", clanguml::common::generator_type_t::json}, + {"mermaid", clanguml::common::generator_type_t::mermaid}}; app.add_option("-c,--config", config_path, "Location of configuration file, when '-' read from stdin"); From 2cc70bcd7e5e11f8029e65c1bec30ee48aafe194 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 9 Sep 2023 20:46:29 +0200 Subject: [PATCH 08/24] Fixed clang-tidy warnings --- src/common/generators/mermaid/generator.cc | 2 +- src/common/generators/mermaid/generator.h | 6 +++--- .../generators/mermaid/include_diagram_generator.cc | 6 ++---- .../generators/mermaid/include_diagram_generator.h | 6 +++--- .../generators/mermaid/package_diagram_generator.cc | 2 +- .../generators/mermaid/package_diagram_generator.h | 4 ++-- .../generators/mermaid/sequence_diagram_generator.cc | 5 +---- 7 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/common/generators/mermaid/generator.cc b/src/common/generators/mermaid/generator.cc index 9000cedd..d0ba2d08 100644 --- a/src/common/generators/mermaid/generator.cc +++ b/src/common/generators/mermaid/generator.cc @@ -19,7 +19,7 @@ namespace clanguml::common::generators::mermaid { -std::string to_mermaid(relationship_t r, const std::string &style) +std::string to_mermaid(relationship_t r, const std::string & /*style*/) { switch (r) { case relationship_t::kOwnership: diff --git a/src/common/generators/mermaid/generator.h b/src/common/generators/mermaid/generator.h index 4361f01e..e52c4ede 100644 --- a/src/common/generators/mermaid/generator.h +++ b/src/common/generators/mermaid/generator.h @@ -42,7 +42,7 @@ std::string to_mermaid(relationship_t r, const std::string &style); std::string to_mermaid(access_t scope); std::string to_mermaid(message_t r); -std::string indent(const unsigned level); +std::string indent(unsigned level); std::string render_name(std::string name); @@ -117,7 +117,7 @@ public: * @param element Element to which the note should be attached */ virtual void generate_notes( - std::ostream &ostr, const model::element &element) const; + std::ostream &ostr, const model::diagram_element &element) const; /** * @brief Generate comment with diagram metadata @@ -300,7 +300,7 @@ void generator::generate_mermaid_directives( template void generator::generate_notes( - std::ostream &ostr, const model::element &e) const + std::ostream &ostr, const model::diagram_element &e) const { const auto &config = generators::generator::config(); diff --git a/src/include_diagram/generators/mermaid/include_diagram_generator.cc b/src/include_diagram/generators/mermaid/include_diagram_generator.cc index de4acfd4..4c06e1ce 100644 --- a/src/include_diagram/generators/mermaid/include_diagram_generator.cc +++ b/src/include_diagram/generators/mermaid/include_diagram_generator.cc @@ -37,8 +37,6 @@ void generator::generate_relationships( LOG_DBG("Generating relationships for file {}", f.full_name(true)); - namespace mermaid_common = clanguml::common::generators::mermaid; - if (f.type() == common::model::source_file_t::kDirectory) { util::for_each(f, [this, &ostr](const auto &file) { generate_relationships( @@ -96,7 +94,7 @@ void generator::generate(const source_file &f, std::ostream &ostr) const } void generator::generate_notes( - std::ostream &ostr, const common::model::source_file &element) const + std::ostream &ostr, const common::model::diagram_element &element) const { const auto &config = common_generator::config(); @@ -133,4 +131,4 @@ void generator::generate_diagram(std::ostream &ostr) const generate_notes(ostr, dynamic_cast(*f)); }); } -} // namespace clanguml::include_diagram::generators::plantuml +} // namespace clanguml::include_diagram::generators::mermaid diff --git a/src/include_diagram/generators/mermaid/include_diagram_generator.h b/src/include_diagram/generators/mermaid/include_diagram_generator.h index aa30a471..12afe076 100644 --- a/src/include_diagram/generators/mermaid/include_diagram_generator.h +++ b/src/include_diagram/generators/mermaid/include_diagram_generator.h @@ -78,8 +78,8 @@ public: * @param ostr Output stream * @param element Element with a note */ - void generate_notes( - std::ostream &ostr, const common::model::source_file &element) const; + void generate_notes(std::ostream &ostr, + const common::model::diagram_element &element) const override; /** * @brief Generate diagram element @@ -90,7 +90,7 @@ public: void generate(const source_file &e, std::ostream &ostr) const; private: - mutable unsigned long note_id_{0UL}; + mutable uint64_t note_id_{0UL}; }; } // namespace clanguml::include_diagram::generators::mermaid diff --git a/src/package_diagram/generators/mermaid/package_diagram_generator.cc b/src/package_diagram/generators/mermaid/package_diagram_generator.cc index 82a58373..8843ce64 100644 --- a/src/package_diagram/generators/mermaid/package_diagram_generator.cc +++ b/src/package_diagram/generators/mermaid/package_diagram_generator.cc @@ -124,7 +124,7 @@ void generator::generate_groups(std::ostream &ostr) const } void generator::generate_notes( - std::ostream &ostr, const common::model::element &element) const + std::ostream &ostr, const common::model::diagram_element &element) const { const auto &config = common_generator::config(); diff --git a/src/package_diagram/generators/mermaid/package_diagram_generator.h b/src/package_diagram/generators/mermaid/package_diagram_generator.h index 4b186990..c7d07e68 100644 --- a/src/package_diagram/generators/mermaid/package_diagram_generator.h +++ b/src/package_diagram/generators/mermaid/package_diagram_generator.h @@ -96,10 +96,10 @@ public: * @param element Element with a note */ void generate_notes(std::ostream &ostr, - const common::model::element &element) const override; + const common::model::diagram_element &element) const override; private: - mutable unsigned long note_id_{0UL}; + mutable uint64_t note_id_{0UL}; mutable common::generators::nested_element_stack together_group_stack_; }; diff --git a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc index de9e3308..229b3b54 100644 --- a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc @@ -27,7 +27,6 @@ using clanguml::sequence_diagram::model::message; using namespace clanguml::util; using clanguml::common::generators::mermaid::indent; -using clanguml::common::generators::mermaid::render_name; std::string render_participant_name(std::string name) { @@ -69,9 +68,7 @@ void generator::generate_call(const message &m, std::ostream &ostr) const if (to.value().type_name() == "method") { const auto &f = dynamic_cast(to.value()); - const std::string_view style = f.is_static() ? "" : ""; - message = - fmt::format("{}{}{}", style, f.message_name(render_mode), style); + message = f.message_name(render_mode); } else if (config().combine_free_functions_into_file_participants()) { if (to.value().type_name() == "function") { From 9a6def801ce8d2aaa59294727d2fd74c05e18d1b Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sun, 10 Sep 2023 00:03:47 +0200 Subject: [PATCH 09/24] Updated docs generation scripts --- Makefile | 12 ++++++++---- src/common/generators/generators.cc | 4 ++++ src/common/generators/mermaid/generator.h | 12 ++++++++++-- uml/include/include.yml | 2 +- util/generate_mermaid.py | 7 +++++-- util/generate_test_cases_docs.py | 11 ++++++----- 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index ae3c0b04..a712db46 100644 --- a/Makefile +++ b/Makefile @@ -103,10 +103,14 @@ document_test_cases: test_diagrams python3 util/format_svg.py docs/test_cases/*.svg clanguml_diagrams: debug - mkdir -p docs/diagrams - debug/src/clang-uml -g plantuml -g json -p - plantuml -tsvg -nometadata docs/diagrams/*.puml - python3 util/format_svg.py docs/diagrams/*.svg + mkdir -p docs/diagrams/plantuml + mkdir -p docs/diagrams/mermaid + debug/src/clang-uml -g plantuml -g json -g mermaid -p + # Convert .puml files to svg images + plantuml -tsvg -nometadata -o plantuml docs/diagrams/*.puml + # Convert .mmd files to svg images + python3 util/generate_mermaid.py docs/diagrams/*.mmd + python3 util/format_svg.py docs/diagrams/plantuml/*.svg .PHONY: submodules submodules: diff --git a/src/common/generators/generators.cc b/src/common/generators/generators.cc index d417f113..9ae2f2e7 100644 --- a/src/common/generators/generators.cc +++ b/src/common/generators/generators.cc @@ -124,6 +124,10 @@ void generate_diagram_impl(const std::string &od, const std::string &name, generate_diagram_select_generator(od, name, diagram, model); } + else if (generator_type == generator_type_t::mermaid) { + generate_diagram_select_generator(od, name, diagram, model); + } } } } // namespace detail diff --git a/src/common/generators/mermaid/generator.h b/src/common/generators/mermaid/generator.h index e52c4ede..55776f67 100644 --- a/src/common/generators/mermaid/generator.h +++ b/src/common/generators/mermaid/generator.h @@ -254,18 +254,24 @@ void generator::generate_link(std::ostream &ostr, const E &e) const ostr << indent(1) << "click " << e.alias() << " href \""; try { + std::string link{}; if (!config.generate_links().link.empty()) { - ostr << env().render(std::string_view{config.generate_links().link}, + link = env().render(std::string_view{config.generate_links().link}, element_context(e)); } + if (link.empty()) + link = " "; + ostr << link; } catch (const inja::json::parse_error &e) { LOG_ERROR( "Failed to parse Jinja template: {}", config.generate_links().link); + ostr << " "; } catch (const inja::json::exception &e) { - LOG_ERROR("Failed to render PlantUML directive: \n{}\n due to: {}", + LOG_ERROR("Failed to render comment directive: \n{}\n due to: {}", config.generate_links().link, e.what()); + ostr << " "; } ostr << "\""; @@ -281,10 +287,12 @@ void generator::generate_link(std::ostream &ostr, const E &e) const catch (const inja::json::parse_error &e) { LOG_ERROR("Failed to parse Jinja template: {}", config.generate_links().link); + ostr << " "; } catch (const inja::json::exception &e) { LOG_ERROR("Failed to render PlantUML directive: \n{}\n due to: {}", config.generate_links().link, e.what()); + ostr << " "; } ostr << "\""; diff --git a/uml/include/include.yml b/uml/include/include.yml index 22efca35..419a8691 100644 --- a/uml/include/include.yml +++ b/uml/include/include.yml @@ -1,6 +1,6 @@ type: include glob: - - src/**/*.cc + - src/config/*.cc relative_to: . include: paths: diff --git a/util/generate_mermaid.py b/util/generate_mermaid.py index 51fa120b..a7843dd3 100644 --- a/util/generate_mermaid.py +++ b/util/generate_mermaid.py @@ -38,8 +38,11 @@ ok = 0 for f in files: try: print(f'Generating Mermaid diagram from {f}') - f_svg = Path(f).with_suffix('.svg') - subprocess.check_call(['mmdc', '-i', f, '-o', f_svg]) + f_svg = Path(f).with_suffix('.svg').name + target = Path(f).parent.absolute() + target = target.joinpath('mermaid') + target = target.joinpath(f_svg) + subprocess.check_call(['mmdc', '-i', f, '-o', target]) except subprocess.CalledProcessError: ok = 1 print(f'ERROR: Generating Mermaid diagram from {f} failed') diff --git a/util/generate_test_cases_docs.py b/util/generate_test_cases_docs.py index 644c5138..9504a0f9 100755 --- a/util/generate_test_cases_docs.py +++ b/util/generate_test_cases_docs.py @@ -71,20 +71,21 @@ with open(r'tests/test_cases.yaml') as f: config_dict = yaml.full_load(config) tc.write("## Generated PlantUML diagrams\n") for diagram_name, _ in config_dict['diagrams'].items(): - copyfile(f'debug/tests/diagrams/puml/{diagram_name}.svg', + copyfile(f'debug/tests/diagrams/plantuml/{diagram_name}.svg', f'docs/test_cases/{diagram_name}.svg') tc.write(f'![{diagram_name}](./{diagram_name}.svg "{test_case["title"]}")\n') tc.write("## Generated Mermaid diagrams\n") for diagram_name, _ in config_dict['diagrams'].items(): copyfile(f'debug/tests/diagrams/mermaid/{diagram_name}.svg', - f'docs/test_cases/{diagram_name}_mmd.svg') - tc.write(f'![{diagram_name}](./{diagram_name}_mmd.svg "{test_case["title"]}")\n') + f'docs/test_cases/{diagram_name}_mermaid.svg') + tc.write(f'![{diagram_name}](./{diagram_name}_mermaid.svg "{test_case["title"]}")\n') tc.write("## Generated JSON models\n") for diagram_name, _ in config_dict['diagrams'].items(): - if os.path.exists(f'debug/tests/puml/{diagram_name}.json'): - with open(f'debug/tests/puml/{diagram_name}.json') as f: + jd = f'debug/tests/diagrams/{diagram_name}.json' + if os.path.exists(jd): + with open(jd) as f: contents = f.read() tc.write("```json\n") tc.write(contents) From 4a19c8ba23e5755737ee01c705889152287c82bd Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sun, 10 Sep 2023 12:14:11 +0200 Subject: [PATCH 10/24] Fixed mermaid verbatim directives handling --- .../mermaid/class_diagram_generator.cc | 7 +- .../mermaid/class_diagram_generator.h | 7 ++ src/common/generators/mermaid/generator.h | 71 ++++++++++++++++++- src/config/yaml_decoders.cc | 15 ++++ .../mermaid/include_diagram_generator.cc | 7 +- .../mermaid/include_diagram_generator.h | 7 ++ .../mermaid/package_diagram_generator.cc | 7 +- .../mermaid/package_diagram_generator.h | 7 ++ .../mermaid/sequence_diagram_generator.cc | 7 +- .../mermaid/sequence_diagram_generator.h | 7 ++ tests/t20006/test_case.h | 6 ++ tests/t20012/test_case.h | 6 ++ tests/t90000/.clang-uml | 12 ++++ tests/t90000/test_case.h | 30 ++++++-- tests/test_cases.cc | 3 - 15 files changed, 178 insertions(+), 21 deletions(-) diff --git a/src/class_diagram/generators/mermaid/class_diagram_generator.cc b/src/class_diagram/generators/mermaid/class_diagram_generator.cc index 15c66af6..59b69050 100644 --- a/src/class_diagram/generators/mermaid/class_diagram_generator.cc +++ b/src/class_diagram/generators/mermaid/class_diagram_generator.cc @@ -33,6 +33,11 @@ generator::generator(diagram_config &config, diagram_model &model) { } +void generator::generate_diagram_type(std::ostream &ostr) const +{ + ostr << "classDiagram\n"; +} + void generator::generate_alias( const common::model::element &c, std::ostream &ostr) const { @@ -696,8 +701,6 @@ void generator::generate_relationships( void generator::generate_diagram(std::ostream &ostr) const { - ostr << "classDiagram\n"; - generate_top_level_elements(ostr); generate_groups(ostr); diff --git a/src/class_diagram/generators/mermaid/class_diagram_generator.h b/src/class_diagram/generators/mermaid/class_diagram_generator.h index 4a8bd118..0ec125af 100644 --- a/src/class_diagram/generators/mermaid/class_diagram_generator.h +++ b/src/class_diagram/generators/mermaid/class_diagram_generator.h @@ -79,6 +79,13 @@ public: */ void generate_diagram(std::ostream &ostr) const override; + /** + * @brief Generate the diagram type + * + * @param ostr Output stream + */ + void generate_diagram_type(std::ostream &ostr) const override; + /** * @brief In a nested diagram, generate the top level elements. * diff --git a/src/common/generators/mermaid/generator.h b/src/common/generators/mermaid/generator.h index 55776f67..6917b968 100644 --- a/src/common/generators/mermaid/generator.h +++ b/src/common/generators/mermaid/generator.h @@ -107,6 +107,16 @@ public: void generate_mermaid_directives( std::ostream &ostr, const std::vector &directives) const; + /** + * @brief Generate the diagram type + * + * This method must be overriden for each diagram type (e.g. it renders + * a single line `classDiagram` for Mermaid class diagrams. + * + * @param ostr Output stream + */ + virtual void generate_diagram_type(std::ostream &ostr) const = 0; + /** * @brief Generate diagram notes * @@ -228,13 +238,13 @@ void generator::generate(std::ostream &ostr) const update_context(); - // generate_mermaid_diagram_type(ostr, config); + generate_diagram_type(ostr); - generate_mermaid_directives(ostr, config.puml().before); + generate_mermaid_directives(ostr, config.mermaid().before); generate_diagram(ostr); - generate_mermaid_directives(ostr, config.puml().after); + generate_mermaid_directives(ostr, config.mermaid().after); generate_metadata(ostr); } @@ -304,6 +314,61 @@ template void generator::generate_mermaid_directives( std::ostream &ostr, const std::vector &directives) const { + + const auto &config = generators::generator::config(); + const auto &model = generators::generator::model(); + + using common::model::namespace_; + + for (const auto &d : directives) { + try { + // Render the directive with template engine first + std::string directive{env().render(std::string_view{d}, context())}; + + // Now search for alias `@A()` directives in the text + // (this is deprecated) + std::tuple alias_match; + while (util::find_element_alias(directive, alias_match)) { + const auto full_name = + config.using_namespace() | std::get<0>(alias_match); + auto element_opt = model.get(full_name.to_string()); + + if (element_opt) + directive.replace(std::get<1>(alias_match), + std::get<2>(alias_match), element_opt.value().alias()); + else { + LOG_ERROR("Cannot find clang-uml alias for element {}", + full_name.to_string()); + directive.replace(std::get<1>(alias_match), + std::get<2>(alias_match), "UNKNOWN_ALIAS"); + } + } + + ostr << indent(1) << directive << '\n'; + } + catch (const clanguml::error::uml_alias_missing &e) { + LOG_ERROR( + "Failed to render MermaidJS directive due to unresolvable " + "alias: {}", + e.what()); + } + catch (const inja::json::parse_error &e) { + LOG_ERROR("Failed to parse Jinja template: {}", d); + } + catch (const inja::json::exception &e) { + LOG_ERROR("Failed to render MermaidJS directive: \n{}\n due to: {}", + d, e.what()); + } + catch (const std::regex_error &e) { + LOG_ERROR("Failed to render MermaidJS directive: \n{}\n due to " + "std::regex_error: {}", + d, e.what()); + } + catch (const std::exception &e) { + LOG_ERROR("Failed to render PlantUML directive: \n{}\n due to: {}", + d, e.what()); + } + } } template diff --git a/src/config/yaml_decoders.cc b/src/config/yaml_decoders.cc index 1c0a9f45..c281f02b 100644 --- a/src/config/yaml_decoders.cc +++ b/src/config/yaml_decoders.cc @@ -42,6 +42,7 @@ using clanguml::config::include_diagram; using clanguml::config::layout_hint; using clanguml::config::location_t; using clanguml::config::member_order_t; +using clanguml::config::mermaid; using clanguml::config::method_arguments; using clanguml::config::method_type; using clanguml::config::package_diagram; @@ -389,6 +390,18 @@ template <> struct convert { } }; +template <> struct convert { + static bool decode(const Node &node, mermaid &rhs) + { + if (node["before"]) + rhs.before = node["before"].as(); + + if (node["after"]) + rhs.after = node["after"].as(); + return true; + } +}; + template <> struct convert { static bool decode(const Node &node, string_or_regex &rhs) { @@ -531,6 +544,7 @@ template bool decode_diagram(const Node &node, T &rhs) get_option(node, rhs.include); get_option(node, rhs.exclude); get_option(node, rhs.puml); + get_option(node, rhs.mermaid); get_option(node, rhs.git); get_option(node, rhs.generate_links); get_option(node, rhs.type_aliases); @@ -762,6 +776,7 @@ template <> struct convert { get_option(node, rhs.remove_compile_flags); get_option(node, rhs.include_relations_also_as_members); get_option(node, rhs.puml); + get_option(node, rhs.mermaid); get_option(node, rhs.generate_method_arguments); get_option(node, rhs.generate_packages); get_option(node, rhs.package_type); diff --git a/src/include_diagram/generators/mermaid/include_diagram_generator.cc b/src/include_diagram/generators/mermaid/include_diagram_generator.cc index 4c06e1ce..48cf3472 100644 --- a/src/include_diagram/generators/mermaid/include_diagram_generator.cc +++ b/src/include_diagram/generators/mermaid/include_diagram_generator.cc @@ -29,6 +29,11 @@ generator::generator(diagram_config &config, diagram_model &model) { } +void generator::generate_diagram_type(std::ostream &ostr) const +{ + ostr << "flowchart\n"; +} + void generator::generate_relationships( const source_file &f, std::ostream &ostr) const { @@ -114,8 +119,6 @@ void generator::generate_notes( void generator::generate_diagram(std::ostream &ostr) const { - ostr << "flowchart\n"; - // Generate files and folders util::for_each(model(), [this, &ostr](const auto &f) { generate(dynamic_cast(*f), ostr); diff --git a/src/include_diagram/generators/mermaid/include_diagram_generator.h b/src/include_diagram/generators/mermaid/include_diagram_generator.h index 12afe076..4efaf94e 100644 --- a/src/include_diagram/generators/mermaid/include_diagram_generator.h +++ b/src/include_diagram/generators/mermaid/include_diagram_generator.h @@ -64,6 +64,13 @@ public: */ void generate_diagram(std::ostream &ostr) const override; + /** + * @brief Generate the diagram type + * + * @param ostr Output stream + */ + void generate_diagram_type(std::ostream &ostr) const override; + /** * @brief Generate relationships originating from source_file `f` * diff --git a/src/package_diagram/generators/mermaid/package_diagram_generator.cc b/src/package_diagram/generators/mermaid/package_diagram_generator.cc index 8843ce64..1b68d131 100644 --- a/src/package_diagram/generators/mermaid/package_diagram_generator.cc +++ b/src/package_diagram/generators/mermaid/package_diagram_generator.cc @@ -30,6 +30,11 @@ generator::generator(diagram_config &config, diagram_model &model) { } +void generator::generate_diagram_type(std::ostream &ostr) const +{ + ostr << "flowchart\n"; +} + void generator::generate_relationships( const package &p, std::ostream &ostr) const { @@ -144,8 +149,6 @@ void generator::generate_notes( void generator::generate_diagram(std::ostream &ostr) const { - ostr << "flowchart\n"; - for (const auto &p : model()) { auto &pkg = dynamic_cast(*p); if (model().should_include(pkg)) { diff --git a/src/package_diagram/generators/mermaid/package_diagram_generator.h b/src/package_diagram/generators/mermaid/package_diagram_generator.h index c7d07e68..e17ca55c 100644 --- a/src/package_diagram/generators/mermaid/package_diagram_generator.h +++ b/src/package_diagram/generators/mermaid/package_diagram_generator.h @@ -66,6 +66,13 @@ public: */ void generate_diagram(std::ostream &ostr) const override; + /** + * @brief Generate the diagram type + * + * @param ostr Output stream + */ + void generate_diagram_type(std::ostream &ostr) const override; + /** * @brief Generate relationships originating from package `p` * diff --git a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc index 229b3b54..65870510 100644 --- a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc @@ -48,6 +48,11 @@ generator::generator( { } +void generator::generate_diagram_type(std::ostream &ostr) const +{ + ostr << "sequenceDiagram\n"; +} + void generator::generate_call(const message &m, std::ostream &ostr) const { const auto &from = model().get_participant(m.from()); @@ -389,8 +394,6 @@ void generator::generate_diagram(std::ostream &ostr) const { model().print(); - ostr << "sequenceDiagram\n"; - if (config().participants_order.has_value) { for (const auto &p : config().participants_order()) { LOG_DBG("Pregenerating participant {}", p); diff --git a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.h b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.h index 823f729f..c6bbd33d 100644 --- a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.h +++ b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.h @@ -60,6 +60,13 @@ public: */ void generate_diagram(std::ostream &ostr) const override; + /** + * @brief Generate the diagram type + * + * @param ostr Output stream + */ + void generate_diagram_type(std::ostream &ostr) const override; + /** * @brief Generate sequence diagram message. * diff --git a/tests/t20006/test_case.h b/tests/t20006/test_case.h index 625341ae..d2913f07 100644 --- a/tests/t20006/test_case.h +++ b/tests/t20006/test_case.h @@ -96,4 +96,10 @@ TEST_CASE("t20006", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } \ No newline at end of file diff --git a/tests/t20012/test_case.h b/tests/t20012/test_case.h index fe1b70c6..2b9f099f 100644 --- a/tests/t20012/test_case.h +++ b/tests/t20012/test_case.h @@ -121,4 +121,10 @@ TEST_CASE("t20012", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } + + { + auto mmd = generate_sequence_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/t90000/.clang-uml b/tests/t90000/.clang-uml index e09671a3..7f12a85b 100644 --- a/tests/t90000/.clang-uml +++ b/tests/t90000/.clang-uml @@ -18,3 +18,15 @@ diagrams: - 'class "Boo" as C_002' - 'class C_002 {' - '}' + mermaid: + before: + - 'class C_001["Foo"]' + - 'class C_001 {' + - ' +int value' + - '}' + - 'C_001 <|-- ArrayList' + - 'note for C_001 "This is a very important class."' + - 'note "This is a\nfloating note"' + - 'class C_002["Boo"]' + - 'class C_002 {' + - '}' diff --git a/tests/t90000/test_case.h b/tests/t90000/test_case.h index dda3d671..84d50e58 100644 --- a/tests/t90000/test_case.h +++ b/tests/t90000/test_case.h @@ -26,14 +26,30 @@ TEST_CASE("t90000", "[test-case][config]") REQUIRE(model->name() == "t90000_class"); - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + { + auto puml = generate_class_puml(diagram, *model); + AliasMatcher _A(puml); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(puml, StartsWith("@startuml")); + REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("Foo"))); - REQUIRE_THAT(puml, IsClass(_A("Boo"))); + REQUIRE_THAT(puml, IsClass(_A("Foo"))); + REQUIRE_THAT(puml, IsClass(_A("Boo"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", puml); + } + + { + auto j = generate_class_json(diagram, *model); + + using namespace json; + + save_json(config.output_directory(), diagram->name + ".json", j); + } + + { + auto mmd = generate_class_mermaid(diagram, *model); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + } } diff --git a/tests/test_cases.cc b/tests/test_cases.cc index c5714ad7..b2e6222a 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -282,7 +282,6 @@ void save_puml(const std::string &path, const std::string &filename, const std::string &puml) { std::filesystem::path p{path}; - p /= "puml"; p /= filename; save_diagram(p, puml); } @@ -291,7 +290,6 @@ void save_json(const std::string &path, const std::string &filename, const nlohmann::json &j) { std::filesystem::path p{path}; - p /= "json"; p /= filename; save_diagram(p, j); } @@ -300,7 +298,6 @@ void save_mermaid(const std::string &path, const std::string &filename, const std::string &mmd) { std::filesystem::path p{path}; - p /= "mermaid"; p /= filename; save_diagram(p, mmd); } From bf29ceb2dffd1129dce05a109a68601c2cb53917 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sun, 10 Sep 2023 12:22:27 +0200 Subject: [PATCH 11/24] Updated test cases documentation --- Makefile | 12 +- docs/test_cases/t00002.md | 8 +- docs/test_cases/t00002_class.svg | 68 +- docs/test_cases/t00002_class_mermaid.svg | 289 +++++++ docs/test_cases/t00003.md | 24 +- docs/test_cases/t00003_class.svg | 126 +-- docs/test_cases/t00003_class_mermaid.svg | 232 ++++++ docs/test_cases/t00004.md | 8 +- docs/test_cases/t00004_class.svg | 86 +- docs/test_cases/t00004_class_mermaid.svg | 598 ++++++++++++++ docs/test_cases/t00005.md | 30 +- docs/test_cases/t00005_class.svg | 110 +-- docs/test_cases/t00005_class_mermaid.svg | 495 +++++++++++ docs/test_cases/t00006.md | 14 +- docs/test_cases/t00006_class.svg | 134 +-- docs/test_cases/t00006_class_mermaid.svg | 703 ++++++++++++++++ docs/test_cases/t00007.md | 8 +- docs/test_cases/t00007_class.svg | 30 +- docs/test_cases/t00007_class_mermaid.svg | 187 +++++ docs/test_cases/t00008.md | 20 +- docs/test_cases/t00008_class.svg | 154 ++-- docs/test_cases/t00008_class_mermaid.svg | 333 ++++++++ docs/test_cases/t00009.md | 8 +- docs/test_cases/t00009_class.svg | 38 +- docs/test_cases/t00009_class_mermaid.svg | 241 ++++++ docs/test_cases/t00010.md | 8 +- docs/test_cases/t00010_class.svg | 38 +- docs/test_cases/t00010_class_mermaid.svg | 219 +++++ docs/test_cases/t00011.md | 10 +- docs/test_cases/t00011_class.svg | 30 +- docs/test_cases/t00011_class_mermaid.svg | 161 ++++ docs/test_cases/t00012.md | 8 +- docs/test_cases/t00012_class.svg | 76 +- docs/test_cases/t00012_class_mermaid.svg | 386 +++++++++ docs/test_cases/t00013.md | 22 +- docs/test_cases/t00013_class.svg | 130 +-- docs/test_cases/t00013_class_mermaid.svg | 552 +++++++++++++ docs/test_cases/t00014.md | 61 +- docs/test_cases/t00014_class.svg | 616 +++++++------- docs/test_cases/t00014_class_mermaid.svg | 859 ++++++++++++++++++++ docs/test_cases/t00015.md | 8 +- docs/test_cases/t00015_class.svg | 22 +- docs/test_cases/t00015_class_mermaid.svg | 185 +++++ docs/test_cases/t00016.md | 8 +- docs/test_cases/t00016_class.svg | 26 +- docs/test_cases/t00016_class_mermaid.svg | 254 ++++++ docs/test_cases/t00017.md | 38 +- docs/test_cases/t00017_class.svg | 70 +- docs/test_cases/t00017_class_mermaid.svg | 445 ++++++++++ docs/test_cases/t00018.md | 20 +- docs/test_cases/t00018_class.svg | 66 +- docs/test_cases/t00018_class_mermaid.svg | 190 +++++ docs/test_cases/t00019.md | 12 +- docs/test_cases/t00019_class.svg | 90 +- docs/test_cases/t00019_class_mermaid.svg | 354 ++++++++ docs/test_cases/t00020.md | 8 +- docs/test_cases/t00020_class.svg | 94 +-- docs/test_cases/t00020_class_mermaid.svg | 421 ++++++++++ docs/test_cases/t00021.md | 30 +- docs/test_cases/t00021_class.svg | 82 +- docs/test_cases/t00021_class_mermaid.svg | 418 ++++++++++ docs/test_cases/t00022.md | 8 +- docs/test_cases/t00022_class.svg | 42 +- docs/test_cases/t00022_class_mermaid.svg | 172 ++++ docs/test_cases/t00023.md | 8 +- docs/test_cases/t00023_class.svg | 54 +- docs/test_cases/t00023_class_mermaid.svg | 237 ++++++ docs/test_cases/t00024.md | 8 +- docs/test_cases/t00024_class.svg | 62 +- docs/test_cases/t00024_class_mermaid.svg | 233 ++++++ docs/test_cases/t00025.md | 12 +- docs/test_cases/t00025_class.svg | 66 +- docs/test_cases/t00025_class_mermaid.svg | 288 +++++++ docs/test_cases/t00026.md | 8 +- docs/test_cases/t00026_class.svg | 82 +- docs/test_cases/t00026_class_mermaid.svg | 310 +++++++ docs/test_cases/t00027.md | 8 +- docs/test_cases/t00027_class.svg | 98 +-- docs/test_cases/t00027_class_mermaid.svg | 490 +++++++++++ docs/test_cases/t00028.md | 18 +- docs/test_cases/t00028_class.svg | 88 +- docs/test_cases/t00028_class_mermaid.svg | 536 ++++++++++++ docs/test_cases/t00029.md | 12 +- docs/test_cases/t00029_class.svg | 50 +- docs/test_cases/t00029_class_mermaid.svg | 271 ++++++ docs/test_cases/t00030.md | 14 +- docs/test_cases/t00030_class.svg | 46 +- docs/test_cases/t00030_class_mermaid.svg | 309 +++++++ docs/test_cases/t00031.md | 14 +- docs/test_cases/t00031_class.svg | 56 +- docs/test_cases/t00031_class_mermaid.svg | 287 +++++++ docs/test_cases/t00032.md | 10 +- docs/test_cases/t00032_class.svg | 54 +- docs/test_cases/t00032_class_mermaid.svg | 309 +++++++ docs/test_cases/t00033.md | 12 +- docs/test_cases/t00033_class.svg | 54 +- docs/test_cases/t00033_class_mermaid.svg | 309 +++++++ docs/test_cases/t00034.md | 14 +- docs/test_cases/t00034_class.svg | 46 +- docs/test_cases/t00034_class_mermaid.svg | 255 ++++++ docs/test_cases/t00035.md | 8 +- docs/test_cases/t00035_class.svg | 22 +- docs/test_cases/t00035_class_mermaid.svg | 153 ++++ docs/test_cases/t00036.md | 8 +- docs/test_cases/t00036_class.svg | 40 +- docs/test_cases/t00036_class_mermaid.svg | 197 +++++ docs/test_cases/t00037.md | 10 +- docs/test_cases/t00037_class.svg | 58 +- docs/test_cases/t00037_class_mermaid.svg | 222 +++++ docs/test_cases/t00038.md | 8 +- docs/test_cases/t00038_class.svg | 54 +- docs/test_cases/t00038_class_mermaid.svg | 453 +++++++++++ docs/test_cases/t00039.md | 10 +- docs/test_cases/t00039_class.svg | 78 +- docs/test_cases/t00039_class_mermaid.svg | 481 +++++++++++ docs/test_cases/t00040.md | 12 +- docs/test_cases/t00040_class.svg | 38 +- docs/test_cases/t00040_class_mermaid.svg | 181 +++++ docs/test_cases/t00041.md | 16 +- docs/test_cases/t00041_class.svg | 58 +- docs/test_cases/t00041_class_mermaid.svg | 332 ++++++++ docs/test_cases/t00042.md | 8 +- docs/test_cases/t00042_class.svg | 42 +- docs/test_cases/t00042_class_mermaid.svg | 234 ++++++ docs/test_cases/t00043.md | 28 +- docs/test_cases/t00043_class.svg | 306 +++---- docs/test_cases/t00043_class_mermaid.svg | 419 ++++++++++ docs/test_cases/t00044.md | 8 +- docs/test_cases/t00044_class.svg | 42 +- docs/test_cases/t00044_class_mermaid.svg | 287 +++++++ docs/test_cases/t00045.md | 10 +- docs/test_cases/t00045_class.svg | 76 +- docs/test_cases/t00045_class_mermaid.svg | 428 ++++++++++ docs/test_cases/t00046.md | 10 +- docs/test_cases/t00046_class.svg | 68 +- docs/test_cases/t00046_class_mermaid.svg | 359 ++++++++ docs/test_cases/t00047.md | 8 +- docs/test_cases/t00047_class.svg | 18 +- docs/test_cases/t00047_class_mermaid.svg | 166 ++++ docs/test_cases/t00048.md | 8 +- docs/test_cases/t00048_class.svg | 74 +- docs/test_cases/t00048_class_mermaid.svg | 274 +++++++ docs/test_cases/t00049.md | 8 +- docs/test_cases/t00049_class.svg | 50 +- docs/test_cases/t00049_class_mermaid.svg | 256 ++++++ docs/test_cases/t00050.md | 8 +- docs/test_cases/t00050_class.svg | 70 +- docs/test_cases/t00050_class_mermaid.svg | 235 ++++++ docs/test_cases/t00051.md | 12 +- docs/test_cases/t00051_class.svg | 86 +- docs/test_cases/t00051_class_mermaid.svg | 279 +++++++ docs/test_cases/t00052.md | 10 +- docs/test_cases/t00052_class.svg | 42 +- docs/test_cases/t00052_class_mermaid.svg | 270 ++++++ docs/test_cases/t00053.md | 8 +- docs/test_cases/t00053_class.svg | 70 +- docs/test_cases/t00053_class_mermaid.svg | 396 +++++++++ docs/test_cases/t00054.md | 8 +- docs/test_cases/t00054_class.svg | 78 +- docs/test_cases/t00054_class_mermaid.svg | 396 +++++++++ docs/test_cases/t00055.md | 8 +- docs/test_cases/t00055_class.svg | 42 +- docs/test_cases/t00055_class_mermaid.svg | 248 ++++++ docs/test_cases/t00056.md | 55 +- docs/test_cases/t00056_class.svg | 94 +-- docs/test_cases/t00056_class_mermaid.svg | 594 ++++++++++++++ docs/test_cases/t00057.md | 8 +- docs/test_cases/t00057_class.svg | 126 +-- docs/test_cases/t00057_class_mermaid.svg | 463 +++++++++++ docs/test_cases/t00058.md | 8 +- docs/test_cases/t00058_class.svg | 54 +- docs/test_cases/t00058_class_mermaid.svg | 325 ++++++++ docs/test_cases/t00059.md | 12 +- docs/test_cases/t00059_class.svg | 94 +-- docs/test_cases/t00059_class_mermaid.svg | 496 +++++++++++ docs/test_cases/t00060.md | 8 +- docs/test_cases/t00060_class.svg | 38 +- docs/test_cases/t00060_class_mermaid.svg | 251 ++++++ docs/test_cases/t00061.md | 8 +- docs/test_cases/t00061_class.svg | 6 +- docs/test_cases/t00061_class_mermaid.svg | 77 ++ docs/test_cases/t00062.md | 8 +- docs/test_cases/t00062_class.svg | 198 ++--- docs/test_cases/t00062_class_mermaid.svg | 823 +++++++++++++++++++ docs/test_cases/t00063.md | 8 +- docs/test_cases/t00063_class.svg | 6 +- docs/test_cases/t00063_class_mermaid.svg | 77 ++ docs/test_cases/t00064.md | 16 +- docs/test_cases/t00064_class.svg | 122 +-- docs/test_cases/t00064_class_mermaid.svg | 811 ++++++++++++++++++ docs/test_cases/t00065.md | 18 +- docs/test_cases/t00065_class.svg | 102 +-- docs/test_cases/t00065_class_mermaid.svg | 534 ++++++++++++ docs/test_cases/t00066.md | 24 +- docs/test_cases/t00066_class.svg | 126 +-- docs/test_cases/t00066_class_mermaid.svg | 227 ++++++ docs/test_cases/t00067.md | 8 +- docs/test_cases/t00067_class.svg | 86 +- docs/test_cases/t00067_class_mermaid.svg | 177 ++++ docs/test_cases/t20001.md | 8 +- docs/test_cases/t20001_sequence.svg | 74 +- docs/test_cases/t20001_sequence_mermaid.svg | 136 ++++ docs/test_cases/t20002.md | 8 +- docs/test_cases/t20002_sequence.svg | 48 +- docs/test_cases/t20002_sequence_mermaid.svg | 118 +++ docs/test_cases/t20003.md | 8 +- docs/test_cases/t20003_sequence.svg | 48 +- docs/test_cases/t20003_sequence_mermaid.svg | 118 +++ docs/test_cases/t20004.md | 8 +- docs/test_cases/t20004_sequence.svg | 120 +-- docs/test_cases/t20004_sequence_mermaid.svg | 256 ++++++ docs/test_cases/t20005.md | 8 +- docs/test_cases/t20005_sequence.svg | 36 +- docs/test_cases/t20005_sequence_mermaid.svg | 121 +++ docs/test_cases/t20006.md | 8 +- docs/test_cases/t20006_sequence.svg | 162 ++-- docs/test_cases/t20006_sequence_mermaid.svg | 271 ++++++ docs/test_cases/t20007.md | 8 +- docs/test_cases/t20007_sequence.svg | 48 +- docs/test_cases/t20007_sequence_mermaid.svg | 124 +++ docs/test_cases/t20008.md | 8 +- docs/test_cases/t20008_sequence.svg | 84 +- docs/test_cases/t20008_sequence_mermaid.svg | 178 ++++ docs/test_cases/t20009.md | 8 +- docs/test_cases/t20009_sequence.svg | 84 +- docs/test_cases/t20009_sequence_mermaid.svg | 178 ++++ docs/test_cases/t20010.md | 8 +- docs/test_cases/t20010_sequence.svg | 72 +- docs/test_cases/t20010_sequence_mermaid.svg | 128 +++ docs/test_cases/t20011.md | 8 +- docs/test_cases/t20011_sequence.svg | 72 +- docs/test_cases/t20011_sequence_mermaid.svg | 146 ++++ docs/test_cases/t20012.md | 8 +- docs/test_cases/t20012_sequence.svg | 198 ++--- docs/test_cases/t20012_sequence_mermaid.svg | 291 +++++++ docs/test_cases/t20013.md | 8 +- docs/test_cases/t20013_sequence.svg | 60 +- docs/test_cases/t20013_sequence_mermaid.svg | 130 +++ docs/test_cases/t20014.md | 8 +- docs/test_cases/t20014_sequence.svg | 72 +- docs/test_cases/t20014_sequence_mermaid.svg | 152 ++++ docs/test_cases/t20015.md | 8 +- docs/test_cases/t20015_sequence.svg | 24 +- docs/test_cases/t20015_sequence_mermaid.svg | 78 ++ docs/test_cases/t20016.md | 8 +- docs/test_cases/t20016_sequence.svg | 48 +- docs/test_cases/t20016_sequence_mermaid.svg | 112 +++ docs/test_cases/t20017.md | 8 +- docs/test_cases/t20017_sequence.svg | 48 +- docs/test_cases/t20017_sequence_mermaid.svg | 142 ++++ docs/test_cases/t20018.md | 8 +- docs/test_cases/t20018_sequence.svg | 96 +-- docs/test_cases/t20018_sequence_mermaid.svg | 198 +++++ docs/test_cases/t20019.md | 8 +- docs/test_cases/t20019_sequence.svg | 84 +- docs/test_cases/t20019_sequence_mermaid.svg | 158 ++++ docs/test_cases/t20020.md | 8 +- docs/test_cases/t20020_sequence.svg | 124 +-- docs/test_cases/t20020_sequence_mermaid.svg | 262 ++++++ docs/test_cases/t20021.md | 8 +- docs/test_cases/t20021_sequence.svg | 106 +-- docs/test_cases/t20021_sequence_mermaid.svg | 235 ++++++ docs/test_cases/t20022.md | 8 +- docs/test_cases/t20022_sequence.svg | 42 +- docs/test_cases/t20022_sequence_mermaid.svg | 103 +++ docs/test_cases/t20023.md | 8 +- docs/test_cases/t20023_sequence.svg | 50 +- docs/test_cases/t20023_sequence_mermaid.svg | 127 +++ docs/test_cases/t20024.md | 8 +- docs/test_cases/t20024_sequence.svg | 88 +- docs/test_cases/t20024_sequence_mermaid.svg | 191 +++++ docs/test_cases/t20025.md | 8 +- docs/test_cases/t20025_sequence.svg | 42 +- docs/test_cases/t20025_sequence_mermaid.svg | 107 +++ docs/test_cases/t20026.md | 8 +- docs/test_cases/t20026_sequence.svg | 24 +- docs/test_cases/t20026_sequence_mermaid.svg | 78 ++ docs/test_cases/t20027.md | 8 +- docs/test_cases/t20027_sequence.svg | 24 +- docs/test_cases/t20027_sequence_mermaid.svg | 78 ++ docs/test_cases/t20028.md | 8 +- docs/test_cases/t20028_sequence.svg | 44 +- docs/test_cases/t20028_sequence_mermaid.svg | 113 +++ docs/test_cases/t20029.md | 8 +- docs/test_cases/t20029_sequence.svg | 80 +- docs/test_cases/t20029_sequence_mermaid.svg | 202 +++++ docs/test_cases/t20030.md | 14 +- docs/test_cases/t20030_sequence.svg | 112 +-- docs/test_cases/t20030_sequence_mermaid.svg | 181 +++++ docs/test_cases/t20031.md | 8 +- docs/test_cases/t20031_sequence.svg | 58 +- docs/test_cases/t20031_sequence_mermaid.svg | 142 ++++ docs/test_cases/t20032.md | 8 +- docs/test_cases/t20032_sequence.svg | 60 +- docs/test_cases/t20032_sequence_mermaid.svg | 130 +++ docs/test_cases/t20033.md | 8 +- docs/test_cases/t20033_sequence.svg | 128 +-- docs/test_cases/t20033_sequence_mermaid.svg | 284 +++++++ docs/test_cases/t20034.md | 384 ++++----- docs/test_cases/t20034_sequence.svg | 220 ++--- docs/test_cases/t20034_sequence_mermaid.svg | 176 ++++ docs/test_cases/t20035.md | 8 +- docs/test_cases/t20035_sequence.svg | 32 +- docs/test_cases/t20035_sequence_mermaid.svg | 106 +++ docs/test_cases/t20036.md | 218 ++--- docs/test_cases/t20036_sequence.svg | 194 ++--- docs/test_cases/t20036_sequence_mermaid.svg | 155 ++++ docs/test_cases/t30001.md | 8 +- docs/test_cases/t30001_package.svg | 48 +- docs/test_cases/t30001_package_mermaid.svg | 1 + docs/test_cases/t30002.md | 8 +- docs/test_cases/t30002_package.svg | 94 +-- docs/test_cases/t30002_package_mermaid.svg | 1 + docs/test_cases/t30003.md | 8 +- docs/test_cases/t30003_package.svg | 26 +- docs/test_cases/t30003_package_mermaid.svg | 1 + docs/test_cases/t30004.md | 8 +- docs/test_cases/t30004_package.svg | 30 +- docs/test_cases/t30004_package_mermaid.svg | 1 + docs/test_cases/t30005.md | 8 +- docs/test_cases/t30005_package.svg | 38 +- docs/test_cases/t30005_package_mermaid.svg | 1 + docs/test_cases/t30006.md | 8 +- docs/test_cases/t30006_package.svg | 16 +- docs/test_cases/t30006_package_mermaid.svg | 1 + docs/test_cases/t30007.md | 8 +- docs/test_cases/t30007_package.svg | 20 +- docs/test_cases/t30007_package_mermaid.svg | 1 + docs/test_cases/t30008.md | 8 +- docs/test_cases/t30008_package.svg | 34 +- docs/test_cases/t30008_package_mermaid.svg | 1 + docs/test_cases/t30009.md | 8 +- docs/test_cases/t30009_package.svg | 42 +- docs/test_cases/t30009_package_mermaid.svg | 1 + docs/test_cases/t30010.md | 8 +- docs/test_cases/t30010_package_mermaid.svg | 1 + docs/test_cases/t30011.md | 8 +- docs/test_cases/t30011_package_mermaid.svg | 1 + docs/test_cases/t40001.md | 12 +- docs/test_cases/t40001_include.svg | 30 +- docs/test_cases/t40001_include_mermaid.svg | 1 + docs/test_cases/t40002.md | 8 +- docs/test_cases/t40002_include.svg | 34 +- docs/test_cases/t40002_include_mermaid.svg | 1 + docs/test_cases/t40003.md | 8 +- docs/test_cases/t40003_include.svg | 50 +- docs/test_cases/t40003_include_mermaid.svg | 1 + docs/test_cases/t90000.md | 29 +- docs/test_cases/t90000_class_mermaid.svg | 158 ++++ util/format_svg.py | 6 +- util/generate_mermaid.py | 31 +- 351 files changed, 34009 insertions(+), 5201 deletions(-) create mode 100644 docs/test_cases/t00002_class_mermaid.svg create mode 100644 docs/test_cases/t00003_class_mermaid.svg create mode 100644 docs/test_cases/t00004_class_mermaid.svg create mode 100644 docs/test_cases/t00005_class_mermaid.svg create mode 100644 docs/test_cases/t00006_class_mermaid.svg create mode 100644 docs/test_cases/t00007_class_mermaid.svg create mode 100644 docs/test_cases/t00008_class_mermaid.svg create mode 100644 docs/test_cases/t00009_class_mermaid.svg create mode 100644 docs/test_cases/t00010_class_mermaid.svg create mode 100644 docs/test_cases/t00011_class_mermaid.svg create mode 100644 docs/test_cases/t00012_class_mermaid.svg create mode 100644 docs/test_cases/t00013_class_mermaid.svg create mode 100644 docs/test_cases/t00014_class_mermaid.svg create mode 100644 docs/test_cases/t00015_class_mermaid.svg create mode 100644 docs/test_cases/t00016_class_mermaid.svg create mode 100644 docs/test_cases/t00017_class_mermaid.svg create mode 100644 docs/test_cases/t00018_class_mermaid.svg create mode 100644 docs/test_cases/t00019_class_mermaid.svg create mode 100644 docs/test_cases/t00020_class_mermaid.svg create mode 100644 docs/test_cases/t00021_class_mermaid.svg create mode 100644 docs/test_cases/t00022_class_mermaid.svg create mode 100644 docs/test_cases/t00023_class_mermaid.svg create mode 100644 docs/test_cases/t00024_class_mermaid.svg create mode 100644 docs/test_cases/t00025_class_mermaid.svg create mode 100644 docs/test_cases/t00026_class_mermaid.svg create mode 100644 docs/test_cases/t00027_class_mermaid.svg create mode 100644 docs/test_cases/t00028_class_mermaid.svg create mode 100644 docs/test_cases/t00029_class_mermaid.svg create mode 100644 docs/test_cases/t00030_class_mermaid.svg create mode 100644 docs/test_cases/t00031_class_mermaid.svg create mode 100644 docs/test_cases/t00032_class_mermaid.svg create mode 100644 docs/test_cases/t00033_class_mermaid.svg create mode 100644 docs/test_cases/t00034_class_mermaid.svg create mode 100644 docs/test_cases/t00035_class_mermaid.svg create mode 100644 docs/test_cases/t00036_class_mermaid.svg create mode 100644 docs/test_cases/t00037_class_mermaid.svg create mode 100644 docs/test_cases/t00038_class_mermaid.svg create mode 100644 docs/test_cases/t00039_class_mermaid.svg create mode 100644 docs/test_cases/t00040_class_mermaid.svg create mode 100644 docs/test_cases/t00041_class_mermaid.svg create mode 100644 docs/test_cases/t00042_class_mermaid.svg create mode 100644 docs/test_cases/t00043_class_mermaid.svg create mode 100644 docs/test_cases/t00044_class_mermaid.svg create mode 100644 docs/test_cases/t00045_class_mermaid.svg create mode 100644 docs/test_cases/t00046_class_mermaid.svg create mode 100644 docs/test_cases/t00047_class_mermaid.svg create mode 100644 docs/test_cases/t00048_class_mermaid.svg create mode 100644 docs/test_cases/t00049_class_mermaid.svg create mode 100644 docs/test_cases/t00050_class_mermaid.svg create mode 100644 docs/test_cases/t00051_class_mermaid.svg create mode 100644 docs/test_cases/t00052_class_mermaid.svg create mode 100644 docs/test_cases/t00053_class_mermaid.svg create mode 100644 docs/test_cases/t00054_class_mermaid.svg create mode 100644 docs/test_cases/t00055_class_mermaid.svg create mode 100644 docs/test_cases/t00056_class_mermaid.svg create mode 100644 docs/test_cases/t00057_class_mermaid.svg create mode 100644 docs/test_cases/t00058_class_mermaid.svg create mode 100644 docs/test_cases/t00059_class_mermaid.svg create mode 100644 docs/test_cases/t00060_class_mermaid.svg create mode 100644 docs/test_cases/t00061_class_mermaid.svg create mode 100644 docs/test_cases/t00062_class_mermaid.svg create mode 100644 docs/test_cases/t00063_class_mermaid.svg create mode 100644 docs/test_cases/t00064_class_mermaid.svg create mode 100644 docs/test_cases/t00065_class_mermaid.svg create mode 100644 docs/test_cases/t00066_class_mermaid.svg create mode 100644 docs/test_cases/t00067_class_mermaid.svg create mode 100644 docs/test_cases/t20001_sequence_mermaid.svg create mode 100644 docs/test_cases/t20002_sequence_mermaid.svg create mode 100644 docs/test_cases/t20003_sequence_mermaid.svg create mode 100644 docs/test_cases/t20004_sequence_mermaid.svg create mode 100644 docs/test_cases/t20005_sequence_mermaid.svg create mode 100644 docs/test_cases/t20006_sequence_mermaid.svg create mode 100644 docs/test_cases/t20007_sequence_mermaid.svg create mode 100644 docs/test_cases/t20008_sequence_mermaid.svg create mode 100644 docs/test_cases/t20009_sequence_mermaid.svg create mode 100644 docs/test_cases/t20010_sequence_mermaid.svg create mode 100644 docs/test_cases/t20011_sequence_mermaid.svg create mode 100644 docs/test_cases/t20012_sequence_mermaid.svg create mode 100644 docs/test_cases/t20013_sequence_mermaid.svg create mode 100644 docs/test_cases/t20014_sequence_mermaid.svg create mode 100644 docs/test_cases/t20015_sequence_mermaid.svg create mode 100644 docs/test_cases/t20016_sequence_mermaid.svg create mode 100644 docs/test_cases/t20017_sequence_mermaid.svg create mode 100644 docs/test_cases/t20018_sequence_mermaid.svg create mode 100644 docs/test_cases/t20019_sequence_mermaid.svg create mode 100644 docs/test_cases/t20020_sequence_mermaid.svg create mode 100644 docs/test_cases/t20021_sequence_mermaid.svg create mode 100644 docs/test_cases/t20022_sequence_mermaid.svg create mode 100644 docs/test_cases/t20023_sequence_mermaid.svg create mode 100644 docs/test_cases/t20024_sequence_mermaid.svg create mode 100644 docs/test_cases/t20025_sequence_mermaid.svg create mode 100644 docs/test_cases/t20026_sequence_mermaid.svg create mode 100644 docs/test_cases/t20027_sequence_mermaid.svg create mode 100644 docs/test_cases/t20028_sequence_mermaid.svg create mode 100644 docs/test_cases/t20029_sequence_mermaid.svg create mode 100644 docs/test_cases/t20030_sequence_mermaid.svg create mode 100644 docs/test_cases/t20031_sequence_mermaid.svg create mode 100644 docs/test_cases/t20032_sequence_mermaid.svg create mode 100644 docs/test_cases/t20033_sequence_mermaid.svg create mode 100644 docs/test_cases/t20034_sequence_mermaid.svg create mode 100644 docs/test_cases/t20035_sequence_mermaid.svg create mode 100644 docs/test_cases/t20036_sequence_mermaid.svg create mode 100644 docs/test_cases/t30001_package_mermaid.svg create mode 100644 docs/test_cases/t30002_package_mermaid.svg create mode 100644 docs/test_cases/t30003_package_mermaid.svg create mode 100644 docs/test_cases/t30004_package_mermaid.svg create mode 100644 docs/test_cases/t30005_package_mermaid.svg create mode 100644 docs/test_cases/t30006_package_mermaid.svg create mode 100644 docs/test_cases/t30007_package_mermaid.svg create mode 100644 docs/test_cases/t30008_package_mermaid.svg create mode 100644 docs/test_cases/t30009_package_mermaid.svg create mode 100644 docs/test_cases/t30010_package_mermaid.svg create mode 100644 docs/test_cases/t30011_package_mermaid.svg create mode 100644 docs/test_cases/t40001_include_mermaid.svg create mode 100644 docs/test_cases/t40002_include_mermaid.svg create mode 100644 docs/test_cases/t40003_include_mermaid.svg create mode 100644 docs/test_cases/t90000_class_mermaid.svg diff --git a/Makefile b/Makefile index a712db46..f87939cb 100644 --- a/Makefile +++ b/Makefile @@ -94,12 +94,15 @@ install: release make -C release install DESTDIR=${DESTDIR} test_diagrams: test - plantuml -tsvg debug/tests/diagrams/puml/*.puml - python3 util/validate_json.py debug/tests/diagrams/json/*.json - python3 util/generate_mermaid.py debug/tests/diagrams/mermaid/*.mmd + mkdir -p debug/tests/diagrams/plantuml + mkdir -p debug/tests/diagrams/mermaid + plantuml -tsvg -nometadata -o plantuml debug/tests/diagrams/*.puml + python3 util/validate_json.py debug/tests/diagrams/*.json + python3 util/generate_mermaid.py debug/tests/diagrams/*.mmd document_test_cases: test_diagrams python3 util/generate_test_cases_docs.py + # Format generated SVG files python3 util/format_svg.py docs/test_cases/*.svg clanguml_diagrams: debug @@ -110,7 +113,8 @@ clanguml_diagrams: debug plantuml -tsvg -nometadata -o plantuml docs/diagrams/*.puml # Convert .mmd files to svg images python3 util/generate_mermaid.py docs/diagrams/*.mmd - python3 util/format_svg.py docs/diagrams/plantuml/*.svg + # Format generated SVG files + python3 util/format_svg.py docs/diagrams/*.svg .PHONY: submodules submodules: diff --git a/docs/test_cases/t00002.md b/docs/test_cases/t00002.md index e36492f1..07593295 100644 --- a/docs/test_cases/t00002.md +++ b/docs/test_cases/t00002.md @@ -114,8 +114,10 @@ private: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00002_class](./t00002_class.svg "Basic class inheritance") +## Generated Mermaid diagrams +![t00002_class](./t00002_class_mermaid.svg "Basic class inheritance") ## Generated JSON models ```json { @@ -618,8 +620,8 @@ private: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00002_class", diff --git a/docs/test_cases/t00002_class.svg b/docs/test_cases/t00002_class.svg index c7a4fe72..e9cffe1c 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -9,123 +9,123 @@ - - + + A - + - + foo_a() = 0 : void - + - + foo_c() = 0 : void - - + + B - + - + foo_a() : void - - + + C - + - + foo_c() : void - - + + D - + - + foo_a() : void - + - + foo_c() : void - + - + as : std::vector<A *> - - + + E - + - + foo_a() : void - + - + foo_c() : void - + - + as : std::vector<A *> - + This is class A - + This is class B - + This is class D diff --git a/docs/test_cases/t00002_class_mermaid.svg b/docs/test_cases/t00002_class_mermaid.svg new file mode 100644 index 00000000..89855b06 --- /dev/null +++ b/docs/test_cases/t00002_class_mermaid.svg @@ -0,0 +1,289 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + -as + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + -as + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ «abstract» +
+
+ +
+ A +
+
+ +
+ +foo_a() : void +
+
+ +
+ +foo_c() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+ +
+ +foo_a() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+ +
+ +foo_c() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+ +
+ -as : std::vector<A *> +
+
+ +
+ +foo_a() : void +
+
+ +
+ +foo_c() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E +
+
+ +
+ -as : std::vector<A *> +
+
+ +
+ +foo_a() : void +
+
+ +
+ +foo_c() : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00003.md b/docs/test_cases/t00003.md index f5c4d34e..67f9cd09 100644 --- a/docs/test_cases/t00003.md +++ b/docs/test_cases/t00003.md @@ -94,8 +94,10 @@ int A::static_int = 1; } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00003_class](./t00003_class.svg "Class fields and methods") +## Generated Mermaid diagrams +![t00003_class](./t00003_class_mermaid.svg "Class fields and methods") ## Generated JSON models ```json { @@ -307,7 +309,7 @@ int A::static_int = 1; "parameters": [ { "name": "", - "type": "clanguml::t00003::A &&" + "type": "A &&" } ], "source_location": { @@ -337,7 +339,7 @@ int A::static_int = 1; "parameters": [ { "name": "", - "type": "const clanguml::t00003::A &" + "type": "const A &" } ], "source_location": { @@ -496,7 +498,7 @@ int A::static_int = 1; "line": 30, "translation_unit": "../../tests/t00003/t00003.cc" }, - "type": "clanguml::t00003::A &" + "type": "A &" }, { "access": "public", @@ -517,7 +519,7 @@ int A::static_int = 1; "parameters": [ { "name": "other", - "type": "clanguml::t00003::A &&" + "type": "A &&" } ], "source_location": { @@ -526,7 +528,7 @@ int A::static_int = 1; "line": 36, "translation_unit": "../../tests/t00003/t00003.cc" }, - "type": "clanguml::t00003::A &" + "type": "A &" }, { "access": "public", @@ -547,7 +549,7 @@ int A::static_int = 1; "parameters": [ { "name": "other", - "type": "clanguml::t00003::A &" + "type": "A &" } ], "source_location": { @@ -556,7 +558,7 @@ int A::static_int = 1; "line": 37, "translation_unit": "../../tests/t00003/t00003.cc" }, - "type": "clanguml::t00003::A &" + "type": "A &" }, { "access": "public", @@ -741,7 +743,7 @@ int A::static_int = 1; "line": 50, "translation_unit": "../../tests/t00003/t00003.cc" }, - "type": "clanguml::t00003::A" + "type": "A" }, { "access": "protected", @@ -831,8 +833,8 @@ int A::static_int = 1; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00003_class", diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index a0f29032..b5e80234 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,227 +9,227 @@ - - + + A - + - + A() = default : void - + - + A(int i) : void - + - + A(A &&) = default : void - + - + A(const A &) = deleted : void A<T>(T t) : void - + - + ~A() = default : void - + - + operator=(A && other) noexcept : A & - + - + operator=(A & other) noexcept : A & - + - + operator++() : A & - + - + auto_method() : int - + - + basic_method() : void - + - + const_method() const : void - + - + create_from_int(int i) : A - + - + default_int(int i = 12) : int - + - + default_string(int i, std::string s = "abc") : std::string - + - + double_int(const int i) : int - + - + private_method() : void - + - + protected_method() : void - + - + size() constexpr const : std::size_t - + - + static_method() : int - + - + sum(const double a, const double b) : int - + - + a_ : int - + - + auto_member : const unsigned long - + - + b_ : int - + - + c_ : int - + - + compare : std::function<bool (const int)> - + - + private_member : int - + - + protected_member : int - + - + public_member : int - + - + static_const_int : const int - + - + static_int : int diff --git a/docs/test_cases/t00003_class_mermaid.svg b/docs/test_cases/t00003_class_mermaid.svg new file mode 100644 index 00000000..5e91cf2e --- /dev/null +++ b/docs/test_cases/t00003_class_mermaid.svg @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ -a_ : int +
+
+ +
+ +auto_member : const unsigned long +
+
+ +
+ -b_ : int +
+
+ +
+ -c_ : int +
+
+ +
+ #compare : std::function<bool (const int)> +
+
+ +
+ -private_member : int +
+
+ +
+ #protected_member : int +
+
+ +
+ +public_member : int +
+
+ +
+ +static_const_int : const int +
+
+ +
+ +static_int : int +
+
+ +
+ +A() : void +
+
+ +
+ +A(int i) : void +
+
+ +
+ +A(A &&) : void +
+
+ +
+ +A(const A &) : void +
+
+ +
+ +A(T t) : void +
+
+ +
+ +~A() : void +
+
+ +
+ +operator=(A && other) : A & +
+
+ +
+ +operator=(A & other) : A & +
+
+ +
+ +operator++() : A & +
+
+ +
+ +auto_method() : int +
+
+ +
+ +basic_method() : void +
+
+ +
+ +const_method() : void +
+
+ +
+ +create_from_int(int i) : A +
+
+ +
+ +default_int(int i = 12) : int +
+
+ +
+ +default_string(int i, std::string s = "abc") : std::string +
+
+ +
+ +double_int(const int i) : int +
+
+ +
+ -private_method() : void +
+
+ +
+ #protected_method() : void +
+
+ +
+ +size() : std::size_t +
+
+ +
+ +static_method() : int +
+
+ +
+ +sum(const double a, const double b) : int +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00004.md b/docs/test_cases/t00004.md index 55005143..712fc9c6 100644 --- a/docs/test_cases/t00004.md +++ b/docs/test_cases/t00004.md @@ -74,8 +74,10 @@ public: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00004_class](./t00004_class.svg "Nested classes and enums") +## Generated Mermaid diagrams +![t00004_class](./t00004_class_mermaid.svg "Nested classes and enums") ## Generated JSON models ```json { @@ -528,8 +530,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00004_class", diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index 80f7fd69..d2e512cb 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + B - - + + B::AA @@ -28,38 +28,38 @@ AA_3 - - + + A - + - + foo() const : void - + - + foo2() const : void - - + + A::AA - - + + A::AA::Lights @@ -69,16 +69,16 @@ Red - - + + A::AA::AAA - - + + C::B @@ -87,8 +87,8 @@ - - + + C @@ -97,38 +97,38 @@ - + - + b_int : B<int> - + - + t : T - - + + C::AA - - + + C::AA::AAA - - + + C::AA::CCC @@ -137,8 +137,8 @@ CCC_2 - - + + C::B @@ -147,15 +147,15 @@ - + - + b : V - - + + C::CC @@ -164,16 +164,16 @@ CC_2 - - + + detail::D - - + + detail::D::AA @@ -183,8 +183,8 @@ AA_3 - - + + detail::D::DD diff --git a/docs/test_cases/t00004_class_mermaid.svg b/docs/test_cases/t00004_class_mermaid.svg new file mode 100644 index 00000000..d3147d30 --- /dev/null +++ b/docs/test_cases/t00004_class_mermaid.svg @@ -0,0 +1,598 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ + [nested] + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + [nested] + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +b_int + +
+
+
+
+ + + +
+ + [nested] + +
+
+
+
+ + + +
+ + [nested] + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + [nested] + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + [nested] + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ B::AA +
+
+ +
+ AA_1 +
+
+ +
+ AA_2 +
+
+ +
+ AA_3 +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ +foo() : void +
+
+ +
+ +foo2() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A::AA +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ A::AA::Lights +
+
+ +
+ Green +
+
+ +
+ Yellow +
+
+ +
+ Red +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A::AA::AAA +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C::B<int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<T> +
+
+ +
+ +b_int : B<int> +
+
+ +
+ +t : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C::AA +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C::AA::AAA +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ C::AA::CCC +
+
+ +
+ CCC_1 +
+
+ +
+ CCC_2 +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C::B<V> +
+
+ +
+ -b : V +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ C::CC +
+
+ +
+ CC_1 +
+
+ +
+ CC_2 +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ detail::D +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ detail::D::AA +
+
+ +
+ AA_1 +
+
+ +
+ AA_2 +
+
+ +
+ AA_3 +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ detail::D::DD +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00005.md b/docs/test_cases/t00005.md index 9ab741bc..fe152111 100644 --- a/docs/test_cases/t00005.md +++ b/docs/test_cases/t00005.md @@ -64,8 +64,10 @@ public: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00005_class](./t00005_class.svg "Basic class field relationships") +## Generated Mermaid diagrams +![t00005_class](./t00005_class_mermaid.svg "Basic class field relationships") ## Generated JSON models ```json { @@ -381,7 +383,7 @@ public: "line": 31, "translation_unit": "../../tests/t00005/t00005.cc" }, - "type": "clanguml::t00005::A" + "type": "A" }, { "access": "public", @@ -393,7 +395,7 @@ public: "line": 32, "translation_unit": "../../tests/t00005/t00005.cc" }, - "type": "clanguml::t00005::B *" + "type": "B *" }, { "access": "public", @@ -405,7 +407,7 @@ public: "line": 33, "translation_unit": "../../tests/t00005/t00005.cc" }, - "type": "clanguml::t00005::C &" + "type": "C &" }, { "access": "public", @@ -417,7 +419,7 @@ public: "line": 34, "translation_unit": "../../tests/t00005/t00005.cc" }, - "type": "const clanguml::t00005::D *" + "type": "const D *" }, { "access": "public", @@ -429,7 +431,7 @@ public: "line": 35, "translation_unit": "../../tests/t00005/t00005.cc" }, - "type": "const clanguml::t00005::E &" + "type": "const E &" }, { "access": "public", @@ -441,7 +443,7 @@ public: "line": 36, "translation_unit": "../../tests/t00005/t00005.cc" }, - "type": "clanguml::t00005::F &&" + "type": "F &&" }, { "access": "public", @@ -453,7 +455,7 @@ public: "line": 37, "translation_unit": "../../tests/t00005/t00005.cc" }, - "type": "clanguml::t00005::G **" + "type": "G **" }, { "access": "public", @@ -465,7 +467,7 @@ public: "line": 38, "translation_unit": "../../tests/t00005/t00005.cc" }, - "type": "clanguml::t00005::H ***" + "type": "H ***" }, { "access": "public", @@ -477,7 +479,7 @@ public: "line": 39, "translation_unit": "../../tests/t00005/t00005.cc" }, - "type": "clanguml::t00005::I *&" + "type": "I *&" }, { "access": "public", @@ -489,7 +491,7 @@ public: "line": 40, "translation_unit": "../../tests/t00005/t00005.cc" }, - "type": "volatile clanguml::t00005::J *" + "type": "volatile J *" }, { "access": "public", @@ -501,7 +503,7 @@ public: "line": 41, "translation_unit": "../../tests/t00005/t00005.cc" }, - "type": "clanguml::t00005::K *" + "type": "K *" } ], "methods": [], @@ -518,8 +520,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00005_class", diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index 39221f16..6070b1dd 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,205 +9,205 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + a : A - + - + b : B * - + - + c : C & - + - + d : const D * - + - + e : const E & - + - + f : F && - + - + g : G ** - + - + h : H *** - + - + i : I *& - + - + j : volatile J * - + - + k : K * - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00005_class_mermaid.svg b/docs/test_cases/t00005_class_mermaid.svg new file mode 100644 index 00000000..7643ce4c --- /dev/null +++ b/docs/test_cases/t00005_class_mermaid.svg @@ -0,0 +1,495 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +a + +
+
+
+
+ + + +
+ + +b + +
+
+
+
+ + + +
+ + +c + +
+
+
+
+ + + +
+ + +d + +
+
+
+
+ + + +
+ + +e + +
+
+
+
+ + + +
+ + +f + +
+
+
+
+ + + +
+ + +g + +
+
+
+
+ + + +
+ + +h + +
+
+
+
+ + + +
+ + +i + +
+
+
+
+ + + +
+ + +j + +
+
+
+
+ + + +
+ + +k + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ F +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ H +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ I +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ J +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ K +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +a : A +
+
+ +
+ +b : B +
+
+ +
+ +c : C & +
+
+ +
+ +d : const D +
+
+ +
+ +e : const E & +
+
+ +
+ +f : F && +
+
+ +
+ +g : G * +
+
+ +
+ +h : H ** +
+
+ +
+ +i : I *& +
+
+ +
+ +j : volatile J +
+
+ +
+ +k : K +
+
+ +
+ +some_int : int +
+
+ +
+ +some_int_pointer : int +
+
+ +
+ +some_int_pointer_pointer : int * +
+
+ +
+ +some_int_reference : int & +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00006.md b/docs/test_cases/t00006.md index 6bf1d77e..7f90693e 100644 --- a/docs/test_cases/t00006.md +++ b/docs/test_cases/t00006.md @@ -88,8 +88,10 @@ public: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00006_class](./t00006_class.svg "Class field relationships inferred from templates") +## Generated Mermaid diagrams +![t00006_class](./t00006_class_mermaid.svg "Class field relationships inferred from templates") ## Generated JSON models ```json { @@ -586,7 +588,7 @@ public: "line": 52, "translation_unit": "../../tests/t00006/t00006.cc" }, - "type": "custom_container" + "type": "custom_container" }, { "access": "public", @@ -646,7 +648,7 @@ public: "line": 60, "translation_unit": "../../tests/t00006/t00006.cc" }, - "type": "clanguml::t00006::J[10]" + "type": "J[10]" }, { "access": "public", @@ -658,7 +660,7 @@ public: "line": 61, "translation_unit": "../../tests/t00006/t00006.cc" }, - "type": "clanguml::t00006::K *[20]" + "type": "K *[20]" }, { "access": "public", @@ -699,8 +701,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00006_class", diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index 5c7f15e2..fcf595a4 100644 --- a/docs/test_cases/t00006_class.svg +++ b/docs/test_cases/t00006_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + L - - + + M - - + + N - - + + NN - - + + NNN - - + + custom_container @@ -147,15 +147,15 @@ - + - + data : std::vector<T> - - + + custom_container @@ -164,103 +164,103 @@ - - + + R - + - + a : std::vector<A> - + - + b : std::vector<B *> - + - + c : std::map<int,C> - + - + d : std::map<int,D *> - + - + e : custom_container<E> - + - + f : std::vector<std::vector<F>> - + - + g : std::map<int,std::vector<G *>> - + - + h : std::array<H,10> - + - + i : std::array<I *,5> - + - + j : J[10] - + - + k : K *[20] - + - + lm : std::vector<std::pair<L,M>> - + - + ns : std::tuple<N,NN,NNN> diff --git a/docs/test_cases/t00006_class_mermaid.svg b/docs/test_cases/t00006_class_mermaid.svg new file mode 100644 index 00000000..3c8f0c9b --- /dev/null +++ b/docs/test_cases/t00006_class_mermaid.svg @@ -0,0 +1,703 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +a + +
+
+
+
+ + + +
+ + +b + +
+
+
+
+ + + +
+ + +c + +
+
+
+
+ + + +
+ + +d + +
+
+
+
+ + + +
+ + +e + +
+
+
+
+ + + +
+ + +f + +
+
+
+
+ + + +
+ + +g + +
+
+
+
+ + + +
+ + +h + +
+
+
+
+ + + +
+ + +i + +
+
+
+
+ + + +
+ + +j + +
+
+
+
+ + + +
+ + +k + +
+
+
+
+ + + +
+ + +lm + +
+
+
+
+ + + +
+ + +lm + +
+
+
+
+ + + +
+ + +ns + +
+
+
+
+ + + +
+ + +ns + +
+
+
+
+ + + +
+ + +ns + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ F +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ H +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ I +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ J +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ K +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ L +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ M +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ N +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ NN +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ NNN +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ custom_container<T> +
+
+ +
+ +data : std::vector<T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ custom_container<E> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +a : std::vector<A> +
+
+ +
+ +b : std::vector<B *> +
+
+ +
+ +c : std::map<int,C> +
+
+ +
+ +d : std::map<int,D *> +
+
+ +
+ +e : custom_container<E> +
+
+ +
+ +f : std::vector<std::vector<F>> +
+
+ +
+ +g : std::map<int,std::vector<G *>> +
+
+ +
+ +h : std::array<H,10> +
+
+ +
+ +i : std::array<I *,5> +
+
+ +
+ +j : J[10] +
+
+ +
+ +k : K *[20] +
+
+ +
+ +lm : std::vector<std::pair<L,M>> +
+
+ +
+ +ns : std::tuple<N,NN,NNN> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00007.md b/docs/test_cases/t00007.md index 7cb51a11..410b5a7b 100644 --- a/docs/test_cases/t00007.md +++ b/docs/test_cases/t00007.md @@ -38,8 +38,10 @@ public: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00007_class](./t00007_class.svg "Smart pointers") +## Generated Mermaid diagrams +![t00007_class](./t00007_class_mermaid.svg "Smart pointers") ## Generated JSON models ```json { @@ -172,8 +174,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00007_class", diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index 73b2f6ee..b902e5d7 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,57 +9,57 @@ - - + + A - - + + B - - + + C - - + + R - + - + a : std::unique_ptr<A> - + - + b : std::shared_ptr<B> - + - + c : std::weak_ptr<C> diff --git a/docs/test_cases/t00007_class_mermaid.svg b/docs/test_cases/t00007_class_mermaid.svg new file mode 100644 index 00000000..182b5119 --- /dev/null +++ b/docs/test_cases/t00007_class_mermaid.svg @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +a + +
+
+
+
+ + + +
+ + +b + +
+
+
+
+ + + +
+ + +c + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +a : std::unique_ptr<A> +
+
+ +
+ +b : std::shared_ptr<B> +
+
+ +
+ +c : std::weak_ptr<C> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00008.md b/docs/test_cases/t00008.md index ba236715..50bf46b6 100644 --- a/docs/test_cases/t00008.md +++ b/docs/test_cases/t00008.md @@ -71,8 +71,10 @@ template <> struct E::nested_template { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00008_class](./t00008_class.svg "Template and template template relationships") +## Generated Mermaid diagrams +![t00008_class](./t00008_class_mermaid.svg "Template and template template relationships") ## Generated JSON models ```json { @@ -80,8 +82,8 @@ template <> struct E::nested_template { "elements": [ { "bases": [], - "display_name": "clanguml::t00008::A", - "id": "1657660300852090121", + "display_name": "clanguml::t00008::A", + "id": "2293517130897538130", "is_abstract": false, "is_nested": false, "is_struct": false, @@ -158,7 +160,7 @@ template <> struct E::nested_template { "line": 17, "translation_unit": "../../tests/t00008/t00008.cc" }, - "type": "clanguml::t00008::CMP" + "type": "CMP" } ], "methods": [], @@ -189,7 +191,7 @@ template <> struct E::nested_template { "is_variadic": false, "kind": "non_type_template", "template_parameters": [], - "type": "clanguml::t00008::CMP" + "type": "CMP" }, { "default": "3", @@ -478,7 +480,7 @@ template <> struct E::nested_template { "line": 40, "translation_unit": "../../tests/t00008/t00008.cc" }, - "type": "clanguml::t00008::E::nested_template::DT *" + "type": "DT *" } ], "name": "E::nested_template", @@ -538,7 +540,7 @@ template <> struct E::nested_template { "line": 47, "translation_unit": "../../tests/t00008/t00008.cc" }, - "type": "clanguml::t00008::E::nested_template::DeclType *" + "type": "DeclType *" } ], "name": "E::nested_template", @@ -561,8 +563,8 @@ template <> struct E::nested_template { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00008_class", diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index 60242514..192e051d 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + - + @@ -9,8 +9,8 @@ - - + + A @@ -19,50 +19,50 @@ - + - + comparator : CMP - + - + ints : std::array<int,N> - + - + pointer : T * - + - + reference : T & - + - + value : T - + - + values : std::vector<P> - - + + Vector @@ -71,15 +71,15 @@ - + - + values : std::vector<T> - - + + B @@ -88,15 +88,15 @@ - + - + template_template : C<T> - - + + B @@ -105,8 +105,8 @@ - - + + D @@ -115,78 +115,78 @@ D<Items...>(std::tuple<Items...> *) : void - + - + add(int i) : void - + - + ints : B<int,Vector> - - - - - E - - + + + + + E + + - - - - - E::nested_template - - ET - + + + + + E::nested_template + + ET + - - - + + + - - get(ET * d) : E::nested_template::DT * + + get(ET * d) : DT * - - - - - - E::nested_template - - char - + + + + + + E::nested_template + + char + - - - + + + - - getDecl(char * c) : E::nested_template<char>::DeclType * + + getDecl(char * c) : DeclType * - + ints - - - - - - - - - - + + + + + + + + + + diff --git a/docs/test_cases/t00008_class_mermaid.svg b/docs/test_cases/t00008_class_mermaid.svg new file mode 100644 index 00000000..51d49a31 --- /dev/null +++ b/docs/test_cases/t00008_class_mermaid.svg @@ -0,0 +1,333 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ + +ints + +
+
+
+
+ + + +
+ + [nested] + +
+
+
+
+ + + +
+ + [nested] + +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A<T,P=T,CMP=nullptr,int N=3> +
+
+ +
+ +comparator : CMP +
+
+ +
+ +ints : std::array<int,N> +
+
+ +
+ +pointer : T +
+
+ +
+ +reference : T & +
+
+ +
+ +value : T +
+
+ +
+ +values : std::vector<P> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Vector<T> +
+
+ +
+ +values : std::vector<T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<T,C<>> +
+
+ +
+ +template_template : C<T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<int,Vector> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+ +
+ +ints : B<int,Vector> +
+
+ +
+ +D(std::tuple *) : void +
+
+ +
+ +add(int i) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E::nested_template<ET> +
+
+ +
+ +get(ET * d) : DT * +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E::nested_template<char> +
+
+ +
+ +getDecl(char * c) : DeclType * +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00009.md b/docs/test_cases/t00009.md index c71d264a..d6360228 100644 --- a/docs/test_cases/t00009.md +++ b/docs/test_cases/t00009.md @@ -39,8 +39,10 @@ public: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00009_class](./t00009_class.svg "Template instantiation") +## Generated Mermaid diagrams +![t00009_class](./t00009_class_mermaid.svg "Template instantiation") ## Generated JSON models ```json { @@ -243,8 +245,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00009_class", diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index c227ba31..72c861d5 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,15 +19,15 @@ - + - + value : T - - + + A @@ -36,8 +36,8 @@ - - + + A @@ -46,8 +46,8 @@ - - + + A @@ -56,33 +56,33 @@ - - + + B - + - + aint : A<int> - + - + astring : A<std::string> * - + - + avector : A<std::vector<std::string>> & diff --git a/docs/test_cases/t00009_class_mermaid.svg b/docs/test_cases/t00009_class_mermaid.svg new file mode 100644 index 00000000..baab15d2 --- /dev/null +++ b/docs/test_cases/t00009_class_mermaid.svg @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +aint + +
+
+
+
+ + + +
+ + +astring + +
+
+
+
+ + + +
+ + +avector + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A<T> +
+
+ +
+ +value : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<std::vector<std::string>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+ +
+ +aint : A<int> +
+
+ +
+ +astring : A<std::string> +
+
+ +
+ +avector : A<std::vector<std::string>> & +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00010.md b/docs/test_cases/t00010.md index e98defe3..cefeaf32 100644 --- a/docs/test_cases/t00010.md +++ b/docs/test_cases/t00010.md @@ -43,8 +43,10 @@ public: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00010_class](./t00010_class.svg "Basic template instantiation") +## Generated Mermaid diagrams +![t00010_class](./t00010_class_mermaid.svg "Basic template instantiation") ## Generated JSON models ```json { @@ -253,8 +255,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00010_class", diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index 5a470caf..1f81df81 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,22 +19,22 @@ - + - + first : T - + - + second : P - - + + A @@ -43,8 +43,8 @@ - - + + B @@ -53,15 +53,15 @@ - + - + astring : A<T,std::string> - - + + B @@ -70,19 +70,19 @@ - - + + C - + - + aintstring : B<int> diff --git a/docs/test_cases/t00010_class_mermaid.svg b/docs/test_cases/t00010_class_mermaid.svg new file mode 100644 index 00000000..ca38fd41 --- /dev/null +++ b/docs/test_cases/t00010_class_mermaid.svg @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ + +astring + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +aintstring + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A<T,P> +
+
+ +
+ +first : T +
+
+ +
+ +second : P +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<T,std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<T> +
+
+ +
+ +astring : A<T,std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+ +
+ +aintstring : B<int> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00011.md b/docs/test_cases/t00011.md index 595a9081..5de47443 100644 --- a/docs/test_cases/t00011.md +++ b/docs/test_cases/t00011.md @@ -52,8 +52,10 @@ public: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00011_class](./t00011_class.svg "Friend relationships") +## Generated Mermaid diagrams +![t00011_class](./t00011_class_mermaid.svg "Friend relationships") ## Generated JSON models ```json { @@ -169,7 +171,7 @@ public: "line": 29, "translation_unit": "../../tests/t00011/t00011.cc" }, - "type": "clanguml::t00011::A *" + "type": "A *" } ], "methods": [ @@ -212,8 +214,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00011_class", diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index 11777f86..3f09cc83 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -19,48 +19,48 @@ - + - + value : T - - + + A - + - + foo() : void - - + + B - + - + foo() : void - + - + m_a : A * diff --git a/docs/test_cases/t00011_class_mermaid.svg b/docs/test_cases/t00011_class_mermaid.svg new file mode 100644 index 00000000..6ce25e26 --- /dev/null +++ b/docs/test_cases/t00011_class_mermaid.svg @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +<> + +
+
+
+
+ + + +
+ + +m_a + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ D<T> +
+
+ +
+ -value : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ +foo() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+ +
+ +m_a : A +
+
+ +
+ +foo() : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00012.md b/docs/test_cases/t00012.md index daaf66f9..5b9c0bf6 100644 --- a/docs/test_cases/t00012.md +++ b/docs/test_cases/t00012.md @@ -59,8 +59,10 @@ class R { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00012_class](./t00012_class.svg "Advanced template instantiations") +## Generated Mermaid diagrams +![t00012_class](./t00012_class_mermaid.svg "Advanced template instantiations") ## Generated JSON models ```json { @@ -554,8 +556,8 @@ class R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00012_class", diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index ad4e4431..e1950354 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,22 +19,22 @@ - + - + value : T - + - + values : std::variant<Ts...> - - + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,15 +60,15 @@ - + - + ints : std::array<T,sizeof...(Is)> - - + + A @@ -77,8 +77,8 @@ - - + + A @@ -87,8 +87,8 @@ - - + + B @@ -97,8 +97,8 @@ - - + + B @@ -107,8 +107,8 @@ - - + + C @@ -117,50 +117,50 @@ - - + + R - + - + a1 : A<int,std::string,float> - + - + a2 : A<int,std::string,bool> - + - + b1 : B<3,2,1> - + - + b2 : B<1,1,1,1> - + - + c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> - + Long template annotation diff --git a/docs/test_cases/t00012_class_mermaid.svg b/docs/test_cases/t00012_class_mermaid.svg new file mode 100644 index 00000000..6f87bda8 --- /dev/null +++ b/docs/test_cases/t00012_class_mermaid.svg @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + -a1 + +
+
+
+
+ + + +
+ + -a2 + +
+
+
+
+ + + +
+ + -b1 + +
+
+
+
+ + + +
+ + -b2 + +
+
+
+
+ + + +
+ + -c1 + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A<T,Ts...> +
+
+ +
+ -value : T +
+
+ +
+ -values : std::variant<Ts...> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<int... Is> +
+
+ +
+ -ints : std::array<int,sizeof...(Is)> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<T,int... Is> +
+
+ +
+ -ints : std::array<T,sizeof...(Is)> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<int,std::string,float> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<int,std::string,bool> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<3,2,1> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<1,1,1,1> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ -a1 : A<int,std::string,float> +
+
+ +
+ -a2 : A<int,std::string,bool> +
+
+ +
+ -b1 : B<3,2,1> +
+
+ +
+ -b2 : B<1,1,1,1> +
+
+ +
+ -c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00013.md b/docs/test_cases/t00013.md index 28b27b4a..574aca69 100644 --- a/docs/test_cases/t00013.md +++ b/docs/test_cases/t00013.md @@ -87,8 +87,10 @@ private: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00013_class](./t00013_class.svg "Template instantiation relationships") +## Generated Mermaid diagrams +![t00013_class](./t00013_class_mermaid.svg "Template instantiation relationships") ## Generated JSON models ```json { @@ -313,7 +315,7 @@ private: "parameters": [ { "name": "r", - "type": "clanguml::t00013::R *" + "type": "R *" } ], "source_location": { @@ -592,7 +594,7 @@ private: "parameters": [ { "name": "a", - "type": "clanguml::t00013::A *" + "type": "A *" } ], "source_location": { @@ -622,7 +624,7 @@ private: "parameters": [ { "name": "b", - "type": "clanguml::t00013::B &" + "type": "B &" } ], "source_location": { @@ -652,7 +654,7 @@ private: "parameters": [ { "name": "b", - "type": "const clanguml::t00013::B &" + "type": "const B &" } ], "source_location": { @@ -682,7 +684,7 @@ private: "parameters": [ { "name": "c", - "type": "clanguml::t00013::C" + "type": "C" } ], "source_location": { @@ -712,7 +714,7 @@ private: "parameters": [ { "name": "d", - "type": "clanguml::t00013::D &&" + "type": "D &&" } ], "source_location": { @@ -742,7 +744,7 @@ private: "parameters": [ { "name": "d", - "type": "clanguml::t00013::D &&" + "type": "D &&" } ], "source_location": { @@ -905,8 +907,8 @@ private: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00013_class", diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index 94675b34..59a13c1b 100644 --- a/docs/test_cases/t00013_class.svg +++ b/docs/test_cases/t00013_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ABCD::F @@ -19,15 +19,15 @@ - + - + f : T - - + + ABCD::F @@ -36,75 +36,75 @@ - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + print(R * r) : void - + - + d : int - - + + E @@ -113,15 +113,15 @@ - + - + e : T - - + + G @@ -130,22 +130,22 @@ - + - + args : std::tuple<Args...> - + - + g : T - - + + E @@ -154,8 +154,8 @@ - - + + G @@ -164,8 +164,8 @@ - - + + E @@ -174,93 +174,93 @@ - - + + R - + - + get_a(A * a) : int - + - + get_b(B & b) : int - + - + get_c(C c) : int - + - + get_const_b(const B & b) : int - + - + get_d(D && d) : int - + - + get_d2(D && d) : int get_e<T>(E<T> e) : T get_f<T>(const F<T> & f) : T - + - + get_int_e(const E<int> & e) : int - + - + get_int_e2(E<int> & e) : int - + - + get_int_f(const ABCD::F<int> & f) : int - + - + estring : E<std::string> - + - + gintstring : G<int,float,std::string> diff --git a/docs/test_cases/t00013_class_mermaid.svg b/docs/test_cases/t00013_class_mermaid.svg new file mode 100644 index 00000000..8cb4717f --- /dev/null +++ b/docs/test_cases/t00013_class_mermaid.svg @@ -0,0 +1,552 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +gintstring + +
+
+
+
+ + + +
+ + -estring + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ ABCD::F<T> +
+
+ +
+ +f : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ABCD::F<int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ +a : int +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+ +
+ +b : int +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+ +
+ +c : int +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+ +
+ +d : int +
+
+ +
+ +print(R * r) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E<T> +
+
+ +
+ +e : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G<T,Args...> +
+
+ +
+ +args : std::tuple<Args...> +
+
+ +
+ +g : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E<int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G<int,float,std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E<std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ -estring : E<std::string> +
+
+ +
+ +gintstring : G<int,float,std::string> +
+
+ +
+ +get_a(A * a) : int +
+
+ +
+ +get_b(B & b) : int +
+
+ +
+ +get_c(C c) : int +
+
+ +
+ +get_const_b(const B & b) : int +
+
+ +
+ +get_d(D && d) : int +
+
+ +
+ +get_d2(D && d) : int +
+
+ +
+ +get_e(E e) : T +
+
+ +
+ +get_f(const F & f) : T +
+
+ +
+ +get_int_e(const E & e) : int +
+
+ +
+ +get_int_e2(E & e) : int +
+
+ +
+ +get_int_f(const ABCD::F & f) : int +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00014.md b/docs/test_cases/t00014.md index 71b713b2..c75fbbee 100644 --- a/docs/test_cases/t00014.md +++ b/docs/test_cases/t00014.md @@ -16,6 +16,9 @@ diagrams: plantuml: before: - left to right direction + mermaid: + before: + - direction LR ``` ## Source code File t00014.cc @@ -104,8 +107,10 @@ public: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00014_class](./t00014_class.svg "Alias template instantiation") +## Generated Mermaid diagrams +![t00014_class](./t00014_class_mermaid.svg "Alias template instantiation") ## Generated JSON models ```json { @@ -298,8 +303,8 @@ public: "namespace": "clanguml::t00014", "source_location": { "column": 12, - "file": "../../../../../../usr/include/c++/12/bits/stl_iterator.h", - "line": 2611, + "file": "../../../../../../usr/include/c++/11/bits/stl_iterator.h", + "line": 2488, "translation_unit": "../../tests/t00014/t00014.cc" }, "template_parameters": [ @@ -333,8 +338,8 @@ public: "namespace": "clanguml::t00014", "source_location": { "column": 11, - "file": "../../../../../../usr/include/c++/12/bits/unique_ptr.h", - "line": 269, + "file": "../../../../../../usr/include/c++/11/bits/unique_ptr.h", + "line": 242, "translation_unit": "../../tests/t00014/t00014.cc" }, "template_parameters": [ @@ -368,8 +373,8 @@ public: "namespace": "clanguml::t00014", "source_location": { "column": 12, - "file": "../../../../../../usr/include/c++/12/bits/stl_iterator.h", - "line": 2611, + "file": "../../../../../../usr/include/c++/11/bits/stl_iterator.h", + "line": 2488, "translation_unit": "../../tests/t00014/t00014.cc" }, "template_parameters": [ @@ -403,8 +408,8 @@ public: "namespace": "clanguml::t00014", "source_location": { "column": 12, - "file": "../../../../../../usr/include/c++/12/bits/stl_iterator.h", - "line": 2611, + "file": "../../../../../../usr/include/c++/11/bits/stl_iterator.h", + "line": 2488, "translation_unit": "../../tests/t00014/t00014.cc" }, "template_parameters": [ @@ -438,8 +443,8 @@ public: "namespace": "clanguml::t00014", "source_location": { "column": 11, - "file": "../../../../../../usr/include/c++/12/bits/unique_ptr.h", - "line": 269, + "file": "../../../../../../usr/include/c++/11/bits/unique_ptr.h", + "line": 242, "translation_unit": "../../tests/t00014/t00014.cc" }, "template_parameters": [ @@ -473,8 +478,8 @@ public: "namespace": "clanguml::t00014", "source_location": { "column": 12, - "file": "../../../../../../usr/include/c++/12/bits/stl_iterator.h", - "line": 2611, + "file": "../../../../../../usr/include/c++/11/bits/stl_iterator.h", + "line": 2488, "translation_unit": "../../tests/t00014/t00014.cc" }, "template_parameters": [ @@ -508,8 +513,8 @@ public: "namespace": "clanguml::t00014", "source_location": { "column": 11, - "file": "../../../../../../usr/include/c++/12/bits/shared_ptr.h", - "line": 175, + "file": "../../../../../../usr/include/c++/11/bits/shared_ptr.h", + "line": 122, "translation_unit": "../../tests/t00014/t00014.cc" }, "template_parameters": [ @@ -690,7 +695,7 @@ public: "namespace": "clanguml::t00014", "source_location": { "column": 11, - "file": "../../../../../../usr/include/c++/12/bits/std_function.h", + "file": "../../../../../../usr/include/c++/11/bits/std_function.h", "line": 111, "translation_unit": "../../tests/t00014/t00014.cc" }, @@ -725,7 +730,7 @@ public: "namespace": "clanguml::t00014", "source_location": { "column": 11, - "file": "../../../../../../usr/include/c++/12/bits/std_function.h", + "file": "../../../../../../usr/include/c++/11/bits/std_function.h", "line": 111, "translation_unit": "../../tests/t00014/t00014.cc" }, @@ -837,7 +842,7 @@ public: "line": 66, "translation_unit": "../../tests/t00014/t00014.cc" }, - "type": "clanguml::t00014::AIntString" + "type": "AIntString" }, { "access": "private", @@ -849,7 +854,7 @@ public: "line": 67, "translation_unit": "../../tests/t00014/t00014.cc" }, - "type": "clanguml::t00014::AStringString" + "type": "AStringString" }, { "access": "private", @@ -861,7 +866,7 @@ public: "line": 68, "translation_unit": "../../tests/t00014/t00014.cc" }, - "type": "clanguml::t00014::BStringString" + "type": "BStringString" }, { "access": "private", @@ -885,7 +890,7 @@ public: "line": 72, "translation_unit": "../../tests/t00014/t00014.cc" }, - "type": "clanguml::t00014::BVector" + "type": "BVector" }, { "access": "public", @@ -897,7 +902,7 @@ public: "line": 75, "translation_unit": "../../tests/t00014/t00014.cc" }, - "type": "clanguml::t00014::BVector2" + "type": "BVector2" }, { "access": "public", @@ -909,7 +914,7 @@ public: "line": 76, "translation_unit": "../../tests/t00014/t00014.cc" }, - "type": "SimpleCallback" + "type": "SimpleCallback" }, { "access": "public", @@ -921,7 +926,7 @@ public: "line": 77, "translation_unit": "../../tests/t00014/t00014.cc" }, - "type": "GenericCallback" + "type": "GenericCallback" }, { "access": "public", @@ -933,7 +938,7 @@ public: "line": 78, "translation_unit": "../../tests/t00014/t00014.cc" }, - "type": "clanguml::t00014::VoidCallback" + "type": "VoidCallback" }, { "access": "public", @@ -945,7 +950,7 @@ public: "line": 79, "translation_unit": "../../tests/t00014/t00014.cc" }, - "type": "VectorPtr" + "type": "VectorPtr
" } ], "methods": [], @@ -969,8 +974,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00014_class", diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index c467a9c1..a0c1c38c 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + - + @@ -9,414 +9,414 @@ - - - - - A - - T,P - - + + + + + A + + T,P + + - - - + + + - - p : P + + p : P - - - + + + - - t : T + + t : T - - - - - B - - + + + + + B + + - - - + + + - - value : std::string + + value : std::string - - - - - A - - T,std::string - - + + + + + A + + T,std::string + + - - - - - A - - T,std::unique_ptr<std::string> - - + + + + + A + + T,std::unique_ptr<std::string> + + - - - - - A - - long,T - - + + + + + A + + long,T + + - - - - - A - - double,T - - + + + + + A + + double,T + + - - - - - A - - long,U - - + + + + + A + + long,U + + - - - - - A - - long,bool - - + + + + + A + + long,bool + + - - - - - A - - double,bool - - + + + + + A + + double,bool + + - - - - - A - - long,float - - + + + + + A + + long,float + + - - - - - A - - double,float - - + + + + + A + + double,float + + - - - - - A - - bool,std::string - - + + + + + A + + bool,std::string + + - - - - - A - - float,std::unique_ptr<std::string> - - + + + + + A + + float,std::unique_ptr<std::string> + + - - - - - A - - int,std::string - - + + + + + A + + int,std::string + + - - - - - A - - std::string,std::string - - + + + + + A + + std::string,std::string + + - - - - - A - - char,std::string - - + + + + + A + + char,std::string + + - - - - - A - - wchar_t,std::string - - + + + + + A + + wchar_t,std::string + + - - - - - R - - T - - + + + + + R + + T + + - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + atfloat : AAPtr<T,float> - + - + bapair : PairPairBA<bool> - + - + boolstring : A<bool,std::string> - + - + bs : BVector - + - + bs2 : BVector2 - + - + bstringstring : BStringString - + - + cb : SimpleCallback<ACharString> - + - + floatstring : AStringPtr<float> - + - - gcb : GenericCallback<R::AWCharString> + + gcb : GenericCallback<AWCharString> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bapair - - - - bs - - - - bs2 - - - - vps - - - - bapair - - - - abool - - - - aboolfloat - - - - aboolfloat - - - - atfloat - - - - afloat - - - - boolstring - - - - floatstring - - - - intstring - - - - stringstring - - - - bstringstring - - - - atfloat - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bapair + + + + bs + + + + bs2 + + + + vps + + + + bapair + + + + abool + + + + aboolfloat + + + + aboolfloat + + + + atfloat + + + + afloat + + + + boolstring + + + + floatstring + + + + intstring + + + + stringstring + + + + bstringstring + + + + atfloat + + + + diff --git a/docs/test_cases/t00014_class_mermaid.svg b/docs/test_cases/t00014_class_mermaid.svg new file mode 100644 index 00000000..802d0c05 --- /dev/null +++ b/docs/test_cases/t00014_class_mermaid.svg @@ -0,0 +1,859 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + -bapair + +
+
+
+
+ + + +
+ + -bapair + +
+
+
+
+ + + +
+ + -abool + +
+
+
+
+ + + +
+ + -aboolfloat + +
+
+
+
+ + + +
+ + -aboolfloat + +
+
+
+
+ + + +
+ + -afloat + +
+
+
+
+ + + +
+ + -boolstring + +
+
+
+
+ + + +
+ + -floatstring + +
+
+
+
+ + + +
+ + -intstring + +
+
+
+
+ + + +
+ + -stringstring + +
+
+
+
+ + + +
+ + -bstringstring + +
+
+
+
+ + + +
+ + -atfloat + +
+
+
+
+ + + +
+ + -atfloat + +
+
+
+
+ + + +
+ + #bs + +
+
+
+
+ + + +
+ + +bs2 + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +vps + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A<T,P> +
+
+ +
+ +p : P +
+
+ +
+ +t : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+ +
+ +value : std::string +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<T,std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<T,std::unique_ptr<std::string>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<long,T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<double,T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<long,U> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<long,bool> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<double,bool> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<long,float> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<double,float> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<bool,std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<float,std::unique_ptr<std::string>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<int,std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<std::string,std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<char,std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<wchar_t,std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R<T> +
+
+ +
+ -abool : APtr<bool> +
+
+ +
+ -aboolfloat : AAPtr<bool,float> +
+
+ +
+ -afloat : ASharedPtr<float> +
+
+ +
+ -atfloat : AAPtr<T,float> +
+
+ +
+ -bapair : PairPairBA<bool> +
+
+ +
+ -boolstring : A<bool,std::string> +
+
+ +
+ #bs : BVector +
+
+ +
+ +bs2 : BVector2 +
+
+ +
+ -bstringstring : BStringString +
+
+ +
+ +cb : SimpleCallback<ACharString> +
+
+ +
+ -floatstring : AStringPtr<float> +
+
+ +
+ +gcb : GenericCallback<AWCharString> +
+
+ +
+ -intstring : AIntString +
+
+ +
+ -stringstring : AStringString +
+
+ +
+ +vcb : VoidCallback +
+
+ +
+ +vps : VectorPtr<B> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00015.md b/docs/test_cases/t00015.md index 5ca19533..206a036d 100644 --- a/docs/test_cases/t00015.md +++ b/docs/test_cases/t00015.md @@ -47,8 +47,10 @@ class B : public ns1::ns2::Anon { }; } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00015_class](./t00015_class.svg "Namespace fun") +## Generated Mermaid diagrams +![t00015_class](./t00015_class_mermaid.svg "Namespace fun") ## Generated JSON models ```json { @@ -187,8 +189,8 @@ class B : public ns1::ns2::Anon { }; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00015_class", diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index 6d366176..793a44fa 100644 --- a/docs/test_cases/t00015_class.svg +++ b/docs/test_cases/t00015_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + ns1::A - - + + ns1::ns2_v0_9_0::A - - + + ns1::Anon - - + + ns3::ns1::ns2::Anon - - + + ns3::B diff --git a/docs/test_cases/t00015_class_mermaid.svg b/docs/test_cases/t00015_class_mermaid.svg new file mode 100644 index 00000000..9e34b027 --- /dev/null +++ b/docs/test_cases/t00015_class_mermaid.svg @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ ns1::A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2_v0_9_0::A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::Anon +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns3::ns1::ns2::Anon +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns3::B +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00016.md b/docs/test_cases/t00016.md index c1ce09d6..301d2d9e 100644 --- a/docs/test_cases/t00016.md +++ b/docs/test_cases/t00016.md @@ -48,8 +48,10 @@ template <> struct is_numeric { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00016_class](./t00016_class.svg "Unnamed enums and empty templates") +## Generated Mermaid diagrams +![t00016_class](./t00016_class_mermaid.svg "Unnamed enums and empty templates") ## Generated JSON models ```json { @@ -273,8 +275,8 @@ template <> struct is_numeric { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00016_class", diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index 6fd2ae8f..5951fc48 100644 --- a/docs/test_cases/t00016_class.svg +++ b/docs/test_cases/t00016_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + is_numeric @@ -21,8 +21,8 @@ value : enum - - + + is_numeric @@ -33,8 +33,8 @@ value : enum - - + + is_numeric @@ -45,8 +45,8 @@ value : enum - - + + is_numeric @@ -57,8 +57,8 @@ value : enum - - + + is_numeric @@ -69,8 +69,8 @@ value : enum - - + + is_numeric diff --git a/docs/test_cases/t00016_class_mermaid.svg b/docs/test_cases/t00016_class_mermaid.svg new file mode 100644 index 00000000..8c53c83c --- /dev/null +++ b/docs/test_cases/t00016_class_mermaid.svg @@ -0,0 +1,254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ is_numeric<typename> +
+
+ +
+ +value : enum +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ is_numeric<float> +
+
+ +
+ +value : enum +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ is_numeric<char> +
+
+ +
+ +value : enum +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ is_numeric<unsigned int> +
+
+ +
+ +value : enum +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ is_numeric<int> +
+
+ +
+ +value : enum +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ is_numeric<bool> +
+
+ +
+ +value : enum +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00017.md b/docs/test_cases/t00017.md index dbaeb11f..3f89805b 100644 --- a/docs/test_cases/t00017.md +++ b/docs/test_cases/t00017.md @@ -76,8 +76,10 @@ private: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00017_class](./t00017_class.svg "Test include relations also as members flag") +## Generated Mermaid diagrams +![t00017_class](./t00017_class_mermaid.svg "Test include relations also as members flag") ## Generated JSON models ```json { @@ -393,7 +395,7 @@ private: "line": 42, "translation_unit": "../../tests/t00017/t00017.cc" }, - "type": "clanguml::t00017::A" + "type": "A" }, { "access": "private", @@ -405,7 +407,7 @@ private: "line": 43, "translation_unit": "../../tests/t00017/t00017.cc" }, - "type": "clanguml::t00017::B *" + "type": "B *" }, { "access": "private", @@ -417,7 +419,7 @@ private: "line": 44, "translation_unit": "../../tests/t00017/t00017.cc" }, - "type": "clanguml::t00017::C &" + "type": "C &" }, { "access": "private", @@ -429,7 +431,7 @@ private: "line": 45, "translation_unit": "../../tests/t00017/t00017.cc" }, - "type": "const clanguml::t00017::D *" + "type": "const D *" }, { "access": "private", @@ -441,7 +443,7 @@ private: "line": 46, "translation_unit": "../../tests/t00017/t00017.cc" }, - "type": "const clanguml::t00017::E &" + "type": "const E &" }, { "access": "private", @@ -453,7 +455,7 @@ private: "line": 47, "translation_unit": "../../tests/t00017/t00017.cc" }, - "type": "clanguml::t00017::F &&" + "type": "F &&" }, { "access": "private", @@ -465,7 +467,7 @@ private: "line": 48, "translation_unit": "../../tests/t00017/t00017.cc" }, - "type": "clanguml::t00017::G **" + "type": "G **" }, { "access": "private", @@ -477,7 +479,7 @@ private: "line": 49, "translation_unit": "../../tests/t00017/t00017.cc" }, - "type": "clanguml::t00017::H ***" + "type": "H ***" }, { "access": "private", @@ -489,7 +491,7 @@ private: "line": 50, "translation_unit": "../../tests/t00017/t00017.cc" }, - "type": "clanguml::t00017::I *&" + "type": "I *&" }, { "access": "private", @@ -501,7 +503,7 @@ private: "line": 51, "translation_unit": "../../tests/t00017/t00017.cc" }, - "type": "volatile clanguml::t00017::J *" + "type": "volatile J *" }, { "access": "private", @@ -513,7 +515,7 @@ private: "line": 52, "translation_unit": "../../tests/t00017/t00017.cc" }, - "type": "clanguml::t00017::K *" + "type": "K *" } ], "methods": [ @@ -540,19 +542,19 @@ private: }, { "name": "cc", - "type": "clanguml::t00017::C &" + "type": "C &" }, { "name": "ee", - "type": "const clanguml::t00017::E &" + "type": "const E &" }, { "name": "ff", - "type": "clanguml::t00017::F &&" + "type": "F &&" }, { "name": "ii", - "type": "clanguml::t00017::I *&" + "type": "I *&" } ], "source_location": { @@ -577,8 +579,8 @@ private: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00017_class", diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index e81dfa22..48ae2fb9 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,135 +9,135 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + R(int & some_int, C & cc, const E & ee, F && ff, I *& ii) : void - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00017_class_mermaid.svg b/docs/test_cases/t00017_class_mermaid.svg new file mode 100644 index 00000000..2034f400 --- /dev/null +++ b/docs/test_cases/t00017_class_mermaid.svg @@ -0,0 +1,445 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + -a + +
+
+
+
+ + + +
+ + -b + +
+
+
+
+ + + +
+ + -c + +
+
+
+
+ + + +
+ + -d + +
+
+
+
+ + + +
+ + -e + +
+
+
+
+ + + +
+ + -f + +
+
+
+
+ + + +
+ + -g + +
+
+
+
+ + + +
+ + -h + +
+
+
+
+ + + +
+ + -i + +
+
+
+
+ + + +
+ + -j + +
+
+
+
+ + + +
+ + -k + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ F +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ H +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ I +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ J +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ K +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ -some_int : int +
+
+ +
+ -some_int_pointer : int +
+
+ +
+ -some_int_pointer_pointer : int * +
+
+ +
+ -some_int_reference : int & +
+
+ +
+ -R(int & some_int, C & cc, const E & ee, F && ff, I *& ii) : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00018.md b/docs/test_cases/t00018.md index b87d9cdf..9869b572 100644 --- a/docs/test_cases/t00018.md +++ b/docs/test_cases/t00018.md @@ -133,8 +133,10 @@ void widget::draw(const clanguml::t00018::widget &w) } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00018_class](./t00018_class.svg "Pimpl pattern") +## Generated Mermaid diagrams +![t00018_class](./t00018_class_mermaid.svg "Pimpl pattern") ## Generated JSON models ```json { @@ -439,7 +441,7 @@ void widget::draw(const clanguml::t00018::widget &w) "parameters": [ { "name": "", - "type": "clanguml::t00018::widget &&" + "type": "widget &&" } ], "source_location": { @@ -469,7 +471,7 @@ void widget::draw(const clanguml::t00018::widget &w) "parameters": [ { "name": "", - "type": "const clanguml::t00018::widget &" + "type": "const widget &" } ], "source_location": { @@ -499,7 +501,7 @@ void widget::draw(const clanguml::t00018::widget &w) "parameters": [ { "name": "", - "type": "clanguml::t00018::widget &&" + "type": "widget &&" } ], "source_location": { @@ -508,7 +510,7 @@ void widget::draw(const clanguml::t00018::widget &w) "line": 30, "translation_unit": "../../tests/t00018/t00018.cc" }, - "type": "clanguml::t00018::widget &" + "type": "widget &" }, { "access": "public", @@ -529,7 +531,7 @@ void widget::draw(const clanguml::t00018::widget &w) "parameters": [ { "name": "", - "type": "const clanguml::t00018::widget &" + "type": "const widget &" } ], "source_location": { @@ -538,7 +540,7 @@ void widget::draw(const clanguml::t00018::widget &w) "line": 31, "translation_unit": "../../tests/t00018/t00018.cc" }, - "type": "clanguml::t00018::widget &" + "type": "widget &" } ], "name": "widget", @@ -554,8 +556,8 @@ void widget::draw(const clanguml::t00018::widget &w) } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00018_class", diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index 6585b859..f615c215 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,121 +9,121 @@ - - + + impl::widget - + - + widget(int n) : void - + - + draw(const widget & w) const : void - + - + draw(const widget & w) : void - + - + n : int - - + + widget - + - + widget(int) : void - + - + widget(widget &&) : void - + - + widget(const widget &) = deleted : void - + - + ~widget() : void - + - + operator=(widget &&) : widget & - + - + operator=(const widget &) = deleted : widget & - + - + draw() const : void - + - + draw() : void - + - + shown() const : bool - + - + pImpl : std::unique_ptr<impl::widget> diff --git a/docs/test_cases/t00018_class_mermaid.svg b/docs/test_cases/t00018_class_mermaid.svg new file mode 100644 index 00000000..4bddd61e --- /dev/null +++ b/docs/test_cases/t00018_class_mermaid.svg @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ + -pImpl + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ impl::widget +
+
+ +
+ -n : int +
+
+ +
+ +widget(int n) : void +
+
+ +
+ +draw(const widget & w) : void +
+
+ +
+ +draw(const widget & w) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ widget +
+
+ +
+ -pImpl : std::unique_ptr<impl::widget> +
+
+ +
+ +widget(int) : void +
+
+ +
+ +widget(widget &&) : void +
+
+ +
+ +widget(const widget &) : void +
+
+ +
+ +~widget() : void +
+
+ +
+ +operator=(widget &&) : widget & +
+
+ +
+ +operator=(const widget &) : widget & +
+
+ +
+ +draw() : void +
+
+ +
+ +draw() : void +
+
+ +
+ +shown() : bool +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00019.md b/docs/test_cases/t00019.md index ec164484..d77281ad 100644 --- a/docs/test_cases/t00019.md +++ b/docs/test_cases/t00019.md @@ -151,8 +151,10 @@ class Base { } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00019_class](./t00019_class.svg "Layercake pattern") +## Generated Mermaid diagrams +![t00019_class](./t00019_class_mermaid.svg "Layercake pattern") ## Generated JSON models ```json { @@ -672,8 +674,8 @@ class Base { "namespace": "clanguml::t00019", "source_location": { "column": 11, - "file": "../../../../../../usr/include/c++/12/bits/unique_ptr.h", - "line": 269, + "file": "../../../../../../usr/include/c++/11/bits/unique_ptr.h", + "line": 242, "translation_unit": "../../tests/t00019/t00019.cc" }, "template_parameters": [ @@ -737,8 +739,8 @@ class Base { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00019_class", diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index 70fbc166..eb2a6169 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,45 +9,45 @@ - - + + Base - + - + Base() = default : void - + - + ~Base() constexpr = default : void - + - + m1() : int - + - + m2() : std::string - - + + Layer1 @@ -55,23 +55,23 @@ LowerLayer - + - + m1() : int - + - + m2() : std::string - - + + Layer2 @@ -79,16 +79,16 @@ LowerLayer - + - + all_calls_count() const : int - - + + Layer3 @@ -96,51 +96,51 @@ LowerLayer - + - + m1() : int - + - + m1_calls() const : int - + - + m2() : std::string - + - + m2_calls() const : int - + - + m_m1_calls : int - + - + m_m2_calls : int - - + + Layer3 @@ -149,8 +149,8 @@ - - + + Layer2 @@ -159,8 +159,8 @@ - - + + Layer1 @@ -169,19 +169,19 @@ - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> diff --git a/docs/test_cases/t00019_class_mermaid.svg b/docs/test_cases/t00019_class_mermaid.svg new file mode 100644 index 00000000..eb369a12 --- /dev/null +++ b/docs/test_cases/t00019_class_mermaid.svg @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +layers + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ Base +
+
+ +
+ -Base() : void +
+
+ +
+ -~Base() : void +
+
+ +
+ -m1() : int +
+
+ +
+ -m2() : std::string +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Layer1<LowerLayer> +
+
+ +
+ -m1() : int +
+
+ +
+ -m2() : std::string +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Layer2<LowerLayer> +
+
+ +
+ -all_calls_count() : int +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Layer3<LowerLayer> +
+
+ +
+ -m_m1_calls : int +
+
+ +
+ -m_m2_calls : int +
+
+ +
+ -m1() : int +
+
+ +
+ -m1_calls() : int +
+
+ +
+ -m2() : std::string +
+
+ +
+ -m2_calls() : int +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Layer3<Base> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Layer2<Layer3<Base>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Layer1<Layer2<Layer3<Base>>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ +layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00020.md b/docs/test_cases/t00020.md index b4d9a8e9..0a0a9c16 100644 --- a/docs/test_cases/t00020.md +++ b/docs/test_cases/t00020.md @@ -96,8 +96,10 @@ public: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00020_class](./t00020_class.svg "Abstract factory pattern") +## Generated Mermaid diagrams +![t00020_class](./t00020_class_mermaid.svg "Abstract factory pattern") ## Generated JSON models ```json { @@ -734,8 +736,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00020_class", diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index 089cdf46..813e86be 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,175 +9,175 @@ - - + + ProductA - + - + ~ProductA() constexpr = default : void - + - + sell(int price) const = 0 : bool - - + + ProductA1 - + - + sell(int price) const : bool - - + + ProductA2 - + - + sell(int price) const : bool - - + + ProductB - + - + ~ProductB() constexpr = default : void - + - + buy(int price) const = 0 : bool - - + + ProductB1 - + - + buy(int price) const : bool - - + + ProductB2 - + - + buy(int price) const : bool - - + + AbstractFactory - + - + make_a() const = 0 : std::unique_ptr<ProductA> - + - + make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 - + - + make_a() const : std::unique_ptr<ProductA> - + - + make_b() const : std::unique_ptr<ProductB> - - + + Factory2 - + - + make_a() const : std::unique_ptr<ProductA> - + - + make_b() const : std::unique_ptr<ProductB> diff --git a/docs/test_cases/t00020_class_mermaid.svg b/docs/test_cases/t00020_class_mermaid.svg new file mode 100644 index 00000000..b86b1e86 --- /dev/null +++ b/docs/test_cases/t00020_class_mermaid.svg @@ -0,0 +1,421 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ «abstract» +
+
+ +
+ ProductA +
+
+ +
+ +~ProductA() : void +
+
+ +
+ +sell(int price) : bool +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ProductA1 +
+
+ +
+ +sell(int price) : bool +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ProductA2 +
+
+ +
+ +sell(int price) : bool +
+
+
+
+
+ + + + + + + +
+ «abstract» +
+
+ +
+ ProductB +
+
+ +
+ +~ProductB() : void +
+
+ +
+ +buy(int price) : bool +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ProductB1 +
+
+ +
+ +buy(int price) : bool +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ProductB2 +
+
+ +
+ +buy(int price) : bool +
+
+
+
+
+ + + + + + + +
+ «abstract» +
+
+ +
+ AbstractFactory +
+
+ +
+ +make_a() : std::unique_ptr<ProductA> +
+
+ +
+ +make_b() : std::unique_ptr<ProductB> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Factory1 +
+
+ +
+ +make_a() : std::unique_ptr<ProductA> +
+
+ +
+ +make_b() : std::unique_ptr<ProductB> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Factory2 +
+
+ +
+ +make_a() : std::unique_ptr<ProductA> +
+
+ +
+ +make_b() : std::unique_ptr<ProductB> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00021.md b/docs/test_cases/t00021.md index 7a70f81b..8a2f2fb8 100644 --- a/docs/test_cases/t00021.md +++ b/docs/test_cases/t00021.md @@ -70,8 +70,10 @@ public: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00021_class](./t00021_class.svg "Visitor pattern") +## Generated Mermaid diagrams +![t00021_class](./t00021_class_mermaid.svg "Visitor pattern") ## Generated JSON models ```json { @@ -132,7 +134,7 @@ public: "parameters": [ { "name": "item", - "type": "const clanguml::t00021::A &" + "type": "const A &" } ], "source_location": { @@ -162,7 +164,7 @@ public: "parameters": [ { "name": "item", - "type": "const clanguml::t00021::B &" + "type": "const B &" } ], "source_location": { @@ -222,7 +224,7 @@ public: "parameters": [ { "name": "item", - "type": "const clanguml::t00021::A &" + "type": "const A &" } ], "source_location": { @@ -252,7 +254,7 @@ public: "parameters": [ { "name": "item", - "type": "const clanguml::t00021::B &" + "type": "const B &" } ], "source_location": { @@ -312,7 +314,7 @@ public: "parameters": [ { "name": "item", - "type": "const clanguml::t00021::A &" + "type": "const A &" } ], "source_location": { @@ -342,7 +344,7 @@ public: "parameters": [ { "name": "item", - "type": "const clanguml::t00021::B &" + "type": "const B &" } ], "source_location": { @@ -402,7 +404,7 @@ public: "parameters": [ { "name": "item", - "type": "const clanguml::t00021::A &" + "type": "const A &" } ], "source_location": { @@ -432,7 +434,7 @@ public: "parameters": [ { "name": "item", - "type": "const clanguml::t00021::B &" + "type": "const B &" } ], "source_location": { @@ -510,7 +512,7 @@ public: "parameters": [ { "name": "visitor", - "type": "const clanguml::t00021::Visitor &" + "type": "const Visitor &" } ], "source_location": { @@ -570,7 +572,7 @@ public: "parameters": [ { "name": "visitor", - "type": "const clanguml::t00021::Visitor &" + "type": "const Visitor &" } ], "source_location": { @@ -630,7 +632,7 @@ public: "parameters": [ { "name": "visitor", - "type": "const clanguml::t00021::Visitor &" + "type": "const Visitor &" } ], "source_location": { @@ -655,8 +657,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00021_class", diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index 17428c24..94d0915e 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,152 +9,152 @@ - - + + Visitor - + - + ~Visitor() constexpr = default : void - + - + visit_A(const A & item) const = 0 : void - + - + visit_B(const B & item) const = 0 : void - - + + Visitor1 - + - + visit_A(const A & item) const : void - + - + visit_B(const B & item) const : void - - + + Visitor2 - + - + visit_A(const A & item) const : void - + - + visit_B(const B & item) const : void - - + + Visitor3 - + - + visit_A(const A & item) const : void - + - + visit_B(const B & item) const : void - - + + Item - + - + ~Item() constexpr = default : void - + - + accept(const Visitor & visitor) const = 0 : void - - + + A - + - + accept(const Visitor & visitor) const : void - - + + B - + - + accept(const Visitor & visitor) const : void diff --git a/docs/test_cases/t00021_class_mermaid.svg b/docs/test_cases/t00021_class_mermaid.svg new file mode 100644 index 00000000..34d2e02e --- /dev/null +++ b/docs/test_cases/t00021_class_mermaid.svg @@ -0,0 +1,418 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ «abstract» +
+
+ +
+ Visitor +
+
+ +
+ +~Visitor() : void +
+
+ +
+ +visit_A(const A & item) : void +
+
+ +
+ +visit_B(const B & item) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Visitor1 +
+
+ +
+ +visit_A(const A & item) : void +
+
+ +
+ +visit_B(const B & item) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Visitor2 +
+
+ +
+ +visit_A(const A & item) : void +
+
+ +
+ +visit_B(const B & item) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Visitor3 +
+
+ +
+ +visit_A(const A & item) : void +
+
+ +
+ +visit_B(const B & item) : void +
+
+
+
+
+ + + + + + + +
+ «abstract» +
+
+ +
+ Item +
+
+ +
+ +~Item() : void +
+
+ +
+ +accept(const Visitor & visitor) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ +accept(const Visitor & visitor) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+ +
+ +accept(const Visitor & visitor) : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00022.md b/docs/test_cases/t00022.md index 253d4b4b..fc763b8e 100644 --- a/docs/test_cases/t00022.md +++ b/docs/test_cases/t00022.md @@ -51,8 +51,10 @@ protected: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00022_class](./t00022_class.svg "Template method pattern") +## Generated Mermaid diagrams +![t00022_class](./t00022_class_mermaid.svg "Template method pattern") ## Generated JSON models ```json { @@ -318,8 +320,8 @@ protected: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00022_class", diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index c304fffb..e7fda857 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,76 +9,76 @@ - - + + A - + - + method1() = 0 : void - + - + method2() = 0 : void - + - + template_method() : void - - + + A1 - + - + method1() : void - + - + method2() : void - - + + A2 - + - + method1() : void - + - + method2() : void diff --git a/docs/test_cases/t00022_class_mermaid.svg b/docs/test_cases/t00022_class_mermaid.svg new file mode 100644 index 00000000..c275fa85 --- /dev/null +++ b/docs/test_cases/t00022_class_mermaid.svg @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ «abstract» +
+
+ +
+ A +
+
+ +
+ #method1() : void +
+
+ +
+ #method2() : void +
+
+ +
+ +template_method() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A1 +
+
+ +
+ #method1() : void +
+
+ +
+ #method2() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A2 +
+
+ +
+ #method1() : void +
+
+ +
+ #method2() : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00023.md b/docs/test_cases/t00023.md index e7b7d97d..28f32d60 100644 --- a/docs/test_cases/t00023.md +++ b/docs/test_cases/t00023.md @@ -60,8 +60,10 @@ private: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00023_class](./t00023_class.svg "Strategy pattern") +## Generated Mermaid diagrams +![t00023_class](./t00023_class_mermaid.svg "Strategy pattern") ## Generated JSON models ```json { @@ -398,8 +400,8 @@ private: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00023_class", diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index 1cbb3f5a..673fc00d 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,102 +9,102 @@ - - + + Strategy - + - + ~Strategy() constexpr = default : void - + - + algorithm() = 0 : void - - + + StrategyA - + - + algorithm() : void - - + + StrategyB - + - + algorithm() : void - - + + StrategyC - + - + algorithm() : void - - + + Context - + - + Context(std::unique_ptr<Strategy> strategy) : void - + - + apply() : void - + - + m_strategy : std::unique_ptr<Strategy> diff --git a/docs/test_cases/t00023_class_mermaid.svg b/docs/test_cases/t00023_class_mermaid.svg new file mode 100644 index 00000000..2d2898c6 --- /dev/null +++ b/docs/test_cases/t00023_class_mermaid.svg @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + -m_strategy + +
+
+
+
+
+ + + + + + + + +
+ «abstract» +
+
+ +
+ Strategy +
+
+ +
+ +~Strategy() : void +
+
+ +
+ +algorithm() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ StrategyA +
+
+ +
+ +algorithm() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ StrategyB +
+
+ +
+ +algorithm() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ StrategyC +
+
+ +
+ +algorithm() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Context +
+
+ +
+ -m_strategy : std::unique_ptr<Strategy> +
+
+ +
+ +Context(std::unique_ptr strategy) : void +
+
+ +
+ +apply() : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00024.md b/docs/test_cases/t00024.md index 51aa05e7..15793475 100644 --- a/docs/test_cases/t00024.md +++ b/docs/test_cases/t00024.md @@ -59,8 +59,10 @@ private: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00024_class](./t00024_class.svg "Proxy pattern") +## Generated Mermaid diagrams +![t00024_class](./t00024_class_mermaid.svg "Proxy pattern") ## Generated JSON models ```json { @@ -449,8 +451,8 @@ private: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00024_class", diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index 35606c41..e4a72557 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,115 +9,115 @@ - - + + Target - + - + ~Target() = 0 : void - + - + m1() = 0 : void - + - + m2() = 0 : void - - + + Target1 - + - + m1() : void - + - + m2() : void - - + + Target2 - + - + m1() : void - + - + m2() : void - - + + Proxy - + - + Proxy(std::shared_ptr<Target> target) : void - + - + m1() : void - + - + m2() : void - + - + m_target : std::shared_ptr<Target> diff --git a/docs/test_cases/t00024_class_mermaid.svg b/docs/test_cases/t00024_class_mermaid.svg new file mode 100644 index 00000000..118279bb --- /dev/null +++ b/docs/test_cases/t00024_class_mermaid.svg @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + -m_target + +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ «abstract» +
+
+ +
+ Target +
+
+ +
+ +~Target() : void +
+
+ +
+ +m1() : void +
+
+ +
+ +m2() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Target1 +
+
+ +
+ +m1() : void +
+
+ +
+ +m2() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Target2 +
+
+ +
+ +m1() : void +
+
+ +
+ +m2() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Proxy +
+
+ +
+ -m_target : std::shared_ptr<Target> +
+
+ +
+ +Proxy(std::shared_ptr target) : void +
+
+ +
+ +m1() : void +
+
+ +
+ +m2() : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00025.md b/docs/test_cases/t00025.md index e9b6dcf2..ae1b5f29 100644 --- a/docs/test_cases/t00025.md +++ b/docs/test_cases/t00025.md @@ -57,8 +57,10 @@ public: } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00025_class](./t00025_class.svg "Template proxy pattern") +## Generated Mermaid diagrams +![t00025_class](./t00025_class_mermaid.svg "Template proxy pattern") ## Generated JSON models ```json { @@ -411,7 +413,7 @@ public: "line": 33, "translation_unit": "../../tests/t00025/t00025.cc" }, - "type": "Proxy" + "type": "Proxy" }, { "access": "public", @@ -423,7 +425,7 @@ public: "line": 34, "translation_unit": "../../tests/t00025/t00025.cc" }, - "type": "Proxy" + "type": "Proxy" } ], "methods": [], @@ -440,8 +442,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00025_class", diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index 0f0d17a5..af0adb76 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,52 +9,52 @@ - - + + Target1 - + - + m1() : void - + - + m2() : void - - + + Target2 - + - + m1() : void - + - + m2() : void - - + + Proxy @@ -62,38 +62,38 @@ T - + - + Proxy(std::shared_ptr<T> target) : void - + - + m1() : void - + - + m2() : void - + - + m_target : std::shared_ptr<T> - - + + Proxy @@ -102,8 +102,8 @@ - - + + Proxy @@ -112,26 +112,26 @@ - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> diff --git a/docs/test_cases/t00025_class_mermaid.svg b/docs/test_cases/t00025_class_mermaid.svg new file mode 100644 index 00000000..68e5828d --- /dev/null +++ b/docs/test_cases/t00025_class_mermaid.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +proxy1 + +
+
+
+
+ + + +
+ + +proxy2 + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ Target1 +
+
+ +
+ +m1() : void +
+
+ +
+ +m2() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Target2 +
+
+ +
+ +m1() : void +
+
+ +
+ +m2() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Proxy<T> +
+
+ +
+ -m_target : std::shared_ptr<T> +
+
+ +
+ +Proxy(std::shared_ptr target) : void +
+
+ +
+ +m1() : void +
+
+ +
+ +m2() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Proxy<Target1> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Proxy<Target2> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ProxyHolder +
+
+ +
+ +proxy1 : Proxy<Target1> +
+
+ +
+ +proxy2 : Proxy<Target2> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00026.md b/docs/test_cases/t00026.md index c26438e5..33f19e1a 100644 --- a/docs/test_cases/t00026.md +++ b/docs/test_cases/t00026.md @@ -78,8 +78,10 @@ struct StringMemento { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00026_class](./t00026_class.svg "Template memento pattern") +## Generated Mermaid diagrams +![t00026_class](./t00026_class_mermaid.svg "Template memento pattern") ## Generated JSON models ```json { @@ -580,8 +582,8 @@ struct StringMemento { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00026_class", diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index 8abd603d..f7c9cfb5 100644 --- a/docs/test_cases/t00026_class.svg +++ b/docs/test_cases/t00026_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Memento @@ -18,31 +18,31 @@ T - + - + Memento(T && v) : void - + - + value() const : T - + - + m_value : T - - + + Originator @@ -50,52 +50,52 @@ T - + - + Originator(T && v) : void - + - + load(const Memento<T> & m) : void - + - + memoize_value() const : Memento<T> - + - + print() const : void - + - + set(T && v) : void - + - + m_value : T - - + + Caretaker @@ -103,30 +103,30 @@ T - + - + set_state(const std::string & s, Memento<T> && m) : void - + - + state(const std::string & n) : Memento<T> & - + - + m_mementos : std::unordered_map<std::string,Memento<T>> - - + + Caretaker @@ -135,8 +135,8 @@ - - + + Originator @@ -145,26 +145,26 @@ - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> diff --git a/docs/test_cases/t00026_class_mermaid.svg b/docs/test_cases/t00026_class_mermaid.svg new file mode 100644 index 00000000..90054c70 --- /dev/null +++ b/docs/test_cases/t00026_class_mermaid.svg @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ + -m_mementos + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +caretaker + +
+
+
+
+ + + +
+ + +originator + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ Memento<T> +
+
+ +
+ -m_value : T +
+
+ +
+ +Memento(T && v) : void +
+
+ +
+ +value() : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Originator<T> +
+
+ +
+ -m_value : T +
+
+ +
+ +Originator(T && v) : void +
+
+ +
+ +load(const Memento & m) : void +
+
+ +
+ +memoize_value() : Memento<T> +
+
+ +
+ +print() : void +
+
+ +
+ +set(T && v) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Caretaker<T> +
+
+ +
+ -m_mementos : std::unordered_map<std::string,Memento<T>> +
+
+ +
+ +set_state(const std::string & s, Memento && m) : void +
+
+ +
+ +state(const std::string & n) : Memento<T> & +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Caretaker<std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Originator<std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ StringMemento +
+
+ +
+ +caretaker : Caretaker<std::string> +
+
+ +
+ +originator : Originator<std::string> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00027.md b/docs/test_cases/t00027.md index 5d72bec2..f7ff0cff 100644 --- a/docs/test_cases/t00027.md +++ b/docs/test_cases/t00027.md @@ -75,8 +75,10 @@ struct Window { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00027_class](./t00027_class.svg "Template decorator pattern") +## Generated Mermaid diagrams +![t00027_class](./t00027_class_mermaid.svg "Template decorator pattern") ## Generated JSON models ```json { @@ -708,8 +710,8 @@ struct Window { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00027_class", diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index f47e5821..3edd483c 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - + + Shape - + - + ~Shape() constexpr = default : void - + - + display() = 0 : void - - + + Line - - + + Line @@ -49,24 +49,24 @@ T<>... - + - + display() : void - - + + Text - - + + Text @@ -74,31 +74,31 @@ T<>... - + - + display() : void - - + + ShapeDecorator - + - + display() = 0 : void - - + + Color @@ -106,16 +106,16 @@ T - + - + display() : void - - + + Weight @@ -123,16 +123,16 @@ T - + - + display() : void - - + + Line @@ -141,8 +141,8 @@ - - + + Line @@ -151,8 +151,8 @@ - - + + Text @@ -161,8 +161,8 @@ - - + + Text @@ -171,40 +171,40 @@ - - + + Window - + - + border : Line<Color,Weight> - + - + description : Text<Color> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> diff --git a/docs/test_cases/t00027_class_mermaid.svg b/docs/test_cases/t00027_class_mermaid.svg new file mode 100644 index 00000000..dc7a0549 --- /dev/null +++ b/docs/test_cases/t00027_class_mermaid.svg @@ -0,0 +1,490 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +border + +
+
+
+
+ + + +
+ + +divider + +
+
+
+
+ + + +
+ + +title + +
+
+
+
+ + + +
+ + +description + +
+
+
+
+
+ + + + + + + + +
+ «abstract» +
+
+ +
+ Shape +
+
+ +
+ +~Shape() : void +
+
+ +
+ +display() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Line +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Line<T<>...> +
+
+ +
+ +display() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Text +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Text<T<>...> +
+
+ +
+ +display() : void +
+
+
+
+
+ + + + + + + +
+ «abstract» +
+
+ +
+ ShapeDecorator +
+
+ +
+ +display() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Color<T> +
+
+ +
+ +display() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Weight<T> +
+
+ +
+ +display() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Line<Color,Weight> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Line<Color> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Text<Color,Weight> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Text<Color> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Window +
+
+ +
+ +border : Line<Color,Weight> +
+
+ +
+ +description : Text<Color> +
+
+ +
+ +divider : Line<Color> +
+
+ +
+ +title : Text<Color,Weight> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00028.md b/docs/test_cases/t00028.md index e5485b47..79959c91 100644 --- a/docs/test_cases/t00028.md +++ b/docs/test_cases/t00028.md @@ -84,8 +84,10 @@ class R { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00028_class](./t00028_class.svg "PlantUML note decorator test case") +## Generated Mermaid diagrams +![t00028_class](./t00028_class_mermaid.svg "PlantUML note decorator test case") ## Generated JSON models ```json { @@ -347,7 +349,7 @@ class R { "line": 43, "translation_unit": "../../tests/t00028/t00028.cc" }, - "type": "clanguml::t00028::A" + "type": "A" }, { "access": "private", @@ -363,7 +365,7 @@ class R { "line": 46, "translation_unit": "../../tests/t00028/t00028.cc" }, - "type": "clanguml::t00028::B *" + "type": "B *" }, { "access": "private", @@ -375,7 +377,7 @@ class R { "line": 48, "translation_unit": "../../tests/t00028/t00028.cc" }, - "type": "clanguml::t00028::C &" + "type": "C &" }, { "access": "private", @@ -411,7 +413,7 @@ class R { "line": 54, "translation_unit": "../../tests/t00028/t00028.cc" }, - "type": "clanguml::t00028::G **" + "type": "G **" } ], "methods": [ @@ -434,7 +436,7 @@ class R { "parameters": [ { "name": "c", - "type": "clanguml::t00028::C &" + "type": "C &" } ], "source_location": { @@ -459,8 +461,8 @@ class R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00028_class", diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index 2516af12..d276803a 100644 --- a/docs/test_cases/t00028_class.svg +++ b/docs/test_cases/t00028_class.svg @@ -1,6 +1,6 @@ - + @@ -9,54 +9,54 @@ - - + + A - + A class note. - - + + B - + B class note. - - + + C - + C class note. - - + + D - + D class note. - - + + E @@ -65,26 +65,26 @@ - + - + param : T - + E template class note. - - + + G - - + + F @@ -94,11 +94,11 @@ three - + F enum note. - - + + E @@ -107,70 +107,70 @@ - - + + R - + - + R(C & c) : void - + - + aaa : A - + - + bbb : B * - + - + ccc : C & - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G ** - + R class note. - + R contains an instance of A. - + Reference to C. diff --git a/docs/test_cases/t00028_class_mermaid.svg b/docs/test_cases/t00028_class_mermaid.svg new file mode 100644 index 00000000..d5b762aa --- /dev/null +++ b/docs/test_cases/t00028_class_mermaid.svg @@ -0,0 +1,536 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ + -aaa + +
+
+
+
+ + + +
+ + -bbb + +
+
+
+
+ + + +
+ + -ccc + +
+
+
+
+ + + +
+ + -ddd + +
+
+
+
+ + + +
+ + -eee + +
+
+
+
+ + + +
+ + -ggg + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E<T> +
+
+ +
+ -param : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ F +
+
+ +
+ one +
+
+ +
+ two +
+
+ +
+ three +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E<int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ -aaa : A +
+
+ +
+ -bbb : B +
+
+ +
+ -ccc : C & +
+
+ +
+ -ddd : std::vector<std::shared_ptr<D>> +
+
+ +
+ -eee : E<int> +
+
+ +
+ -ggg : G * +
+
+ +
+ -R(C & c) : void +
+
+
+
+
+ + + + + +
+ A class note. +
+
+
+
+ + + + + +
+ B class note. +
+
+
+
+ + + + + +
+ C class note. +
+
+
+
+ + + + + +
+ D
class
note.
+
+
+
+
+ + + + + +
+ E template class note. +
+
+
+
+ + + + + +
+ F enum note. +
+
+
+
+ + + + + +
+ R class note. +
+
+
+
+ + + + + +
+ R contains an instance of A. +
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00029.md b/docs/test_cases/t00029.md index 880fa983..f65247bf 100644 --- a/docs/test_cases/t00029.md +++ b/docs/test_cases/t00029.md @@ -67,8 +67,10 @@ struct R { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00029_class](./t00029_class.svg "PlantUML skip decorator test case") +## Generated Mermaid diagrams +![t00029_class](./t00029_class_mermaid.svg "PlantUML skip decorator test case") ## Generated JSON models ```json { @@ -265,7 +267,7 @@ struct R { "line": 35, "translation_unit": "../../tests/t00029/t00029.cc" }, - "type": "clanguml::t00029::G1" + "type": "G1" }, { "access": "public", @@ -281,7 +283,7 @@ struct R { "line": 41, "translation_unit": "../../tests/t00029/t00029.cc" }, - "type": "clanguml::t00029::G3 &" + "type": "G3 &" }, { "access": "public", @@ -310,8 +312,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00029_class", diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index 2b962eaf..2ab0a3da 100644 --- a/docs/test_cases/t00029_class.svg +++ b/docs/test_cases/t00029_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + A - - + + C @@ -27,15 +27,15 @@ - + - + param : T - - + + E @@ -45,65 +45,65 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3 & - + - + g4 : std::shared_ptr<G4> diff --git a/docs/test_cases/t00029_class_mermaid.svg b/docs/test_cases/t00029_class_mermaid.svg new file mode 100644 index 00000000..27cfdc73 --- /dev/null +++ b/docs/test_cases/t00029_class_mermaid.svg @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +g1 + +
+
+
+
+ + + +
+ + +g4 + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<T> +
+
+ +
+ -param : T +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ E +
+
+ +
+ one +
+
+ +
+ two +
+
+ +
+ three +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G1 +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G2 +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G3 +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G4 +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +g1 : G1 +
+
+ +
+ +g3 : G3 & +
+
+ +
+ +g4 : std::shared_ptr<G4> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00030.md b/docs/test_cases/t00030.md index 58e57173..9978f9ca 100644 --- a/docs/test_cases/t00030.md +++ b/docs/test_cases/t00030.md @@ -55,8 +55,10 @@ struct R { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00030_class](./t00030_class.svg "PlantUML relationship decorators test case") +## Generated Mermaid diagrams +![t00030_class](./t00030_class_mermaid.svg "PlantUML relationship decorators test case") ## Generated JSON models ```json { @@ -196,7 +198,7 @@ struct R { "line": 19, "translation_unit": "../../tests/t00030/t00030.cc" }, - "type": "clanguml::t00030::A" + "type": "A" }, { "access": "public", @@ -244,7 +246,7 @@ struct R { "line": 28, "translation_unit": "../../tests/t00030/t00030.cc" }, - "type": "clanguml::t00030::D" + "type": "D" }, { "access": "public", @@ -260,7 +262,7 @@ struct R { "line": 31, "translation_unit": "../../tests/t00030/t00030.cc" }, - "type": "clanguml::t00030::E *" + "type": "E *" } ], "methods": [], @@ -277,8 +279,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00030_class", diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index bb2a5012..c453f91a 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,87 +9,87 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + aaa : A - + - + bbb : std::vector<B> - + - + ccc : std::vector<C> - + - + ddd : D - + - + eee : E * diff --git a/docs/test_cases/t00030_class_mermaid.svg b/docs/test_cases/t00030_class_mermaid.svg new file mode 100644 index 00000000..cb269976 --- /dev/null +++ b/docs/test_cases/t00030_class_mermaid.svg @@ -0,0 +1,309 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +aaa + +
+
+
+
+ + + +
+ + +bbb + +
+
+
+
+ + + +
+ 0..1 +
+
+
+
+ + + +
+ 1..* +
+
+
+ + + +
+ + +ccc + +
+
+
+
+ + + +
+ 0..1 +
+
+
+
+ + + +
+ 1..5 +
+
+
+ + + +
+ + +ddd + +
+
+
+
+ + + +
+ 1 +
+
+
+ + + +
+ + +eee + +
+
+
+
+ + + +
+ 1 +
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +aaa : A +
+
+ +
+ +bbb : std::vector<B> +
+
+ +
+ +ccc : std::vector<C> +
+
+ +
+ +ddd : D +
+
+ +
+ +eee : E +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00031.md b/docs/test_cases/t00031.md index 18c5cbab..92883c60 100644 --- a/docs/test_cases/t00031.md +++ b/docs/test_cases/t00031.md @@ -59,8 +59,10 @@ struct R { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00031_class](./t00031_class.svg "PlantUML style decorator test case") +## Generated Mermaid diagrams +![t00031_class](./t00031_class_mermaid.svg "PlantUML style decorator test case") ## Generated JSON models ```json { @@ -236,7 +238,7 @@ struct R { "line": 22, "translation_unit": "../../tests/t00031/t00031.cc" }, - "type": "clanguml::t00031::A *" + "type": "A *" }, { "access": "public", @@ -284,7 +286,7 @@ struct R { "line": 34, "translation_unit": "../../tests/t00031/t00031.cc" }, - "type": "clanguml::t00031::D *" + "type": "D *" } ], "methods": [ @@ -307,7 +309,7 @@ struct R { "parameters": [ { "name": "b", - "type": "clanguml::t00031::B" + "type": "B" } ], "source_location": { @@ -332,8 +334,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00031_class", diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index 6d4f932e..bc60d6a0 100644 --- a/docs/test_cases/t00031_class.svg +++ b/docs/test_cases/t00031_class.svg @@ -1,33 +1,33 @@ - + - + - + - - - + + + A - - + + B @@ -37,8 +37,8 @@ three - - + + @@ -48,23 +48,23 @@ - + - + ttt : T - - + + D - - + + C @@ -73,47 +73,47 @@ - - + + R - + - + add_b(B b) : void - + - + aaa : A * - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D * diff --git a/docs/test_cases/t00031_class_mermaid.svg b/docs/test_cases/t00031_class_mermaid.svg new file mode 100644 index 00000000..1f5a6c06 --- /dev/null +++ b/docs/test_cases/t00031_class_mermaid.svg @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +aaa + +
+
+
+
+ + + +
+ + +bbb + +
+
+
+
+ + + +
+ + +ccc + +
+
+
+
+ + + +
+ + +ddd + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ B +
+
+ +
+ one +
+
+ +
+ two +
+
+ +
+ three +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<T> +
+
+ +
+ -ttt : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +aaa : A +
+
+ +
+ +bbb : std::vector<B> +
+
+ +
+ +ccc : C<int> +
+
+ +
+ +ddd : D +
+
+ +
+ +add_b(B b) : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00032.md b/docs/test_cases/t00032.md index ebdec154..39c61b99 100644 --- a/docs/test_cases/t00032.md +++ b/docs/test_cases/t00032.md @@ -56,8 +56,10 @@ struct R { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00032_class](./t00032_class.svg "Class template with template base classes test case") +## Generated Mermaid diagrams +![t00032_class](./t00032_class_mermaid.svg "Class template with template base classes test case") ## Generated JSON models ```json { @@ -410,7 +412,7 @@ struct R { "line": 32, "translation_unit": "../../tests/t00032/t00032.cc" }, - "type": "Overload" + "type": "Overload" } ], "methods": [], @@ -427,8 +429,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00032_class", diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index cc05752d..a347a031 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,69 +9,69 @@ - - + + Base - - + + TBase - - + + A - + - + operator()() : void - - + + B - + - + operator()() : void - - + + C - + - + operator()() : void - - + + Overload @@ -80,15 +80,15 @@ - + - + counter : L - - + + Overload @@ -97,19 +97,19 @@ - - + + R - + - + overload : Overload<TBase,int,A,B,C> diff --git a/docs/test_cases/t00032_class_mermaid.svg b/docs/test_cases/t00032_class_mermaid.svg new file mode 100644 index 00000000..978d59ff --- /dev/null +++ b/docs/test_cases/t00032_class_mermaid.svg @@ -0,0 +1,309 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +overload + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ Base +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ TBase +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ +operator() : ) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+ +
+ +operator() : ) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+ +
+ +operator() : ) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Overload<T,L,Ts...> +
+
+ +
+ +counter : L +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Overload<TBase,int,A,B,C> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +overload : Overload<TBase,int,A,B,C> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00033.md b/docs/test_cases/t00033.md index 241c6c20..cc153e41 100644 --- a/docs/test_cases/t00033.md +++ b/docs/test_cases/t00033.md @@ -48,8 +48,10 @@ struct R { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00033_class](./t00033_class.svg "Nested template instantiation dependency test case") +## Generated Mermaid diagrams +![t00033_class](./t00033_class_mermaid.svg "Nested template instantiation dependency test case") ## Generated JSON models ```json { @@ -231,8 +233,8 @@ struct R { "namespace": "clanguml::t00033", "source_location": { "column": 11, - "file": "../../../../../../usr/include/c++/12/bits/unique_ptr.h", - "line": 269, + "file": "../../../../../../usr/include/c++/11/bits/unique_ptr.h", + "line": 242, "translation_unit": "../../tests/t00033/t00033.cc" }, "template_parameters": [ @@ -375,8 +377,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00033_class", diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index ee759801..6a83d9d2 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,15 +19,15 @@ - + - + aaa : T - - + + B @@ -36,15 +36,15 @@ - + - + bbb : T - - + + C @@ -53,30 +53,30 @@ - + - + ccc : T - - + + D - + - + ddd : int - - + + C @@ -85,8 +85,8 @@ - - + + B @@ -95,8 +95,8 @@ - - + + A @@ -105,19 +105,19 @@ - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> diff --git a/docs/test_cases/t00033_class_mermaid.svg b/docs/test_cases/t00033_class_mermaid.svg new file mode 100644 index 00000000..49b807b4 --- /dev/null +++ b/docs/test_cases/t00033_class_mermaid.svg @@ -0,0 +1,309 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +abc + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A<T> +
+
+ +
+ +aaa : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<T> +
+
+ +
+ +bbb : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<T> +
+
+ +
+ +ccc : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+ +
+ +ddd : int +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<D> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<std::unique_ptr<C<D>>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<B<std::unique_ptr<C<D>>>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +abc : A<B<std::unique_ptr<C<D>>>> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00034.md b/docs/test_cases/t00034.md index 1eada8f9..2f694724 100644 --- a/docs/test_cases/t00034.md +++ b/docs/test_cases/t00034.md @@ -74,8 +74,10 @@ struct R { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00034_class](./t00034_class.svg "Template metaprogramming type function test case") +## Generated Mermaid diagrams +![t00034_class](./t00034_class_mermaid.svg "Template metaprogramming type function test case") ## Generated JSON models ```json { @@ -111,7 +113,7 @@ struct R { "parameters": [ { "name": "", - "type": "const clanguml::t00034::Void &" + "type": "const Void &" } ], "source_location": { @@ -141,7 +143,7 @@ struct R { "parameters": [ { "name": "", - "type": "const clanguml::t00034::Void &" + "type": "const Void &" } ], "source_location": { @@ -322,7 +324,7 @@ struct R { "line": 46, "translation_unit": "../../tests/t00034/t00034.cc" }, - "type": "lift_void_t *" + "type": "lift_void_t *" }, { "access": "public", @@ -351,8 +353,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00034_class", diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index b36921bc..e08d0b05 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + Void - + - + operator!=(const Void &) constexpr const : bool - + - + operator==(const Void &) constexpr const : bool - - + + lift_void @@ -41,8 +41,8 @@ - - + + lift_void @@ -51,8 +51,8 @@ - - + + drop_void @@ -61,8 +61,8 @@ - - + + drop_void @@ -71,34 +71,34 @@ - - + + A - - + + R - + - + la : lift_void_t<A> * - + - + lv : lift_void_t<void> * diff --git a/docs/test_cases/t00034_class_mermaid.svg b/docs/test_cases/t00034_class_mermaid.svg new file mode 100644 index 00000000..0ee71308 --- /dev/null +++ b/docs/test_cases/t00034_class_mermaid.svg @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +la + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ Void +
+
+ +
+ +operator!=(const Void &) : bool +
+
+ +
+ +operator==(const Void &) : bool +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ lift_void<T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ lift_void<void> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ drop_void<T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ drop_void<Void> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +la : lift_void_t<A> +
+
+ +
+ +lv : lift_void_t<void> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00035.md b/docs/test_cases/t00035.md index a6172637..0c4040c8 100644 --- a/docs/test_cases/t00035.md +++ b/docs/test_cases/t00035.md @@ -41,8 +41,10 @@ struct Right { }; } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00035_class](./t00035_class.svg "PlantUML class diagram layout hints test case") +## Generated Mermaid diagrams +![t00035_class](./t00035_class_mermaid.svg "PlantUML class diagram layout hints test case") ## Generated JSON models ```json { @@ -160,8 +162,8 @@ struct Right { }; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00035_class", diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index bb335c51..b03c6010 100644 --- a/docs/test_cases/t00035_class.svg +++ b/docs/test_cases/t00035_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + Top - - + + Left - - + + Center - - + + Bottom - - + + Right diff --git a/docs/test_cases/t00035_class_mermaid.svg b/docs/test_cases/t00035_class_mermaid.svg new file mode 100644 index 00000000..5e2adfee --- /dev/null +++ b/docs/test_cases/t00035_class_mermaid.svg @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ Top +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Left +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Center +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Bottom +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Right +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00036.md b/docs/test_cases/t00036.md index 508ee267..8054bb95 100644 --- a/docs/test_cases/t00036.md +++ b/docs/test_cases/t00036.md @@ -67,8 +67,10 @@ struct DImpl : public ns2::ns22::D { }; } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00036_class](./t00036_class.svg "Class diagram with namespaces generated as packages") +## Generated Mermaid diagrams +![t00036_class](./t00036_class_mermaid.svg "Class diagram with namespaces generated as packages") ## Generated JSON models ```json { @@ -276,8 +278,8 @@ struct DImpl : public ns2::ns22::D { }; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00036_class", diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index fcf9a876..85c4714d 100644 --- a/docs/test_cases/t00036_class.svg +++ b/docs/test_cases/t00036_class.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - + ns1 - + ns11 - + ns111 - + ns2 - + ns22 - - + + E @@ -34,8 +34,8 @@ yellow - - + + A @@ -44,15 +44,15 @@ - + - + a : T - - + + A @@ -61,23 +61,23 @@ - - + + B - + - + a_int : A<int> - - + + C diff --git a/docs/test_cases/t00036_class_mermaid.svg b/docs/test_cases/t00036_class_mermaid.svg new file mode 100644 index 00000000..b72b21b2 --- /dev/null +++ b/docs/test_cases/t00036_class_mermaid.svg @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +a_int + +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ «Enumeration» +
+
+ +
+ ns1::E +
+
+ +
+ blue +
+
+ +
+ yellow +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns11::A<T> +
+
+ +
+ +a : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns11::ns111::B +
+
+ +
+ +a_int : A<int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns11::A<int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns2::ns22::C +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00037.md b/docs/test_cases/t00037.md index 0f4eb8aa..59f1b40a 100644 --- a/docs/test_cases/t00037.md +++ b/docs/test_cases/t00037.md @@ -53,8 +53,10 @@ struct A { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00037_class](./t00037_class.svg "Anonymous nested struct test case") +## Generated Mermaid diagrams +![t00037_class](./t00037_class_mermaid.svg "Anonymous nested struct test case") ## Generated JSON models ```json { @@ -245,7 +247,7 @@ struct A { "line": 29, "translation_unit": "../../tests/t00037/t00037.cc" }, - "type": "clanguml::t00037::ST" + "type": "ST" } ], "methods": [ @@ -288,8 +290,8 @@ struct A { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00037_class", diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index 6d5a7dd9..4e6a0ac3 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + @@ -9,106 +9,106 @@ - - + + ST - + - + dimensions : ST::(anonymous_662) - + - + units : ST::(anonymous_792) - - + + ST::(dimensions) - + - + t : double - + - + x : double - + - + y : double - + - + z : double - - + + ST::(units) - + - + c : double - + - + h : double - - + + A - + - + A() : void - + - + st : ST diff --git a/docs/test_cases/t00037_class_mermaid.svg b/docs/test_cases/t00037_class_mermaid.svg new file mode 100644 index 00000000..6745d65e --- /dev/null +++ b/docs/test_cases/t00037_class_mermaid.svg @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +dimensions + +
+
+
+
+ + + +
+ + -units + +
+
+
+
+ + + +
+ + +st + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ ST +
+
+ +
+ +dimensions : ST::(anonymous_662) +
+
+ +
+ -units : ST::(anonymous_792) +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ST::(dimensions) +
+
+ +
+ +t : double +
+
+ +
+ +x : double +
+
+ +
+ +y : double +
+
+ +
+ +z : double +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ST::(units) +
+
+ +
+ +c : double +
+
+ +
+ +h : double +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ +st : ST +
+
+ +
+ +A() : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00038.md b/docs/test_cases/t00038.md index 17ab9e44..b737a30a 100644 --- a/docs/test_cases/t00038.md +++ b/docs/test_cases/t00038.md @@ -72,8 +72,10 @@ struct map - + @@ -9,8 +9,8 @@ - - + + thirdparty::ns1::color_t @@ -20,16 +20,16 @@ blue - - + + thirdparty::ns1::E - - + + property_t @@ -39,47 +39,47 @@ property_c - - + + A - - + + B - - + + C - - + + key_t - + - + key : std::string - - + + map @@ -88,8 +88,8 @@ - - + + map @@ -98,8 +98,8 @@ - - + + map @@ -108,8 +108,8 @@ - - + + map @@ -118,8 +118,8 @@ - - + + map diff --git a/docs/test_cases/t00038_class_mermaid.svg b/docs/test_cases/t00038_class_mermaid.svg new file mode 100644 index 00000000..c16735f7 --- /dev/null +++ b/docs/test_cases/t00038_class_mermaid.svg @@ -0,0 +1,453 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ «Enumeration» +
+
+ +
+ thirdparty::ns1::color_t +
+
+ +
+ red +
+
+ +
+ green +
+
+ +
+ blue +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ thirdparty::ns1::E +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ property_t +
+
+ +
+ property_a +
+
+ +
+ property_b +
+
+ +
+ property_c +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ key_t +
+
+ +
+ +key : std::string +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ map<T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ map<std::integral_constant<thirdparty::ns1::color_t,thirdparty::ns1::color_t::red>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ map<std::integral_constant<property_t,property_t::property_a>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ map<std::vector<std::integral_constant<property_t,property_t::property_b>>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ map<std::map<key_t,std::vector<std::integral_constant<property_t,property_t::property_c>>>> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00039.md b/docs/test_cases/t00039.md index b7ac5aaf..f3ae6844 100644 --- a/docs/test_cases/t00039.md +++ b/docs/test_cases/t00039.md @@ -87,8 +87,10 @@ template struct FFF : public FF { } // namespace clanguml::t00039 ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00039_class](./t00039_class.svg "Subclass class diagram filter test") +## Generated Mermaid diagrams +![t00039_class](./t00039_class_mermaid.svg "Subclass class diagram filter test") ## Generated JSON models ```json { @@ -349,7 +351,7 @@ template struct FFF : public FF { "line": 27, "translation_unit": "../../tests/t00039/t00039.cc" }, - "type": "clanguml::t00039::B *" + "type": "B *" } ], "methods": [], @@ -608,8 +610,8 @@ template struct FFF : public FF { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00039_class", diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index 77b36048..490837fd 100644 --- a/docs/test_cases/t00039_class.svg +++ b/docs/test_cases/t00039_class.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - + + C - - + + D - - + + E - - + + CD - - + + DE - - + + CDE - - + + A - - + + AA - - + + AAA - + - + b : B * - - + + ns2::AAAA - - + + ns3::F @@ -106,15 +106,15 @@ - + - + t : T * - - + + ns3::FF @@ -123,15 +123,15 @@ - + - + m : M * - - + + ns3::FE @@ -140,15 +140,15 @@ - + - + m : M * - - + + ns3::FFF @@ -157,11 +157,11 @@ - + - + n : N * diff --git a/docs/test_cases/t00039_class_mermaid.svg b/docs/test_cases/t00039_class_mermaid.svg new file mode 100644 index 00000000..2d38e266 --- /dev/null +++ b/docs/test_cases/t00039_class_mermaid.svg @@ -0,0 +1,481 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ CD +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ DE +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ CDE +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ AA +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ AAA +
+
+ +
+ +b : B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns2::AAAA +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns3::F<T> +
+
+ +
+ +t : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns3::FF<T,M> +
+
+ +
+ +m : M +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns3::FE<T,M> +
+
+ +
+ +m : M +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns3::FFF<T,M,N> +
+
+ +
+ +n : N +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00040.md b/docs/test_cases/t00040.md index daed1831..b2d9a0bf 100644 --- a/docs/test_cases/t00040.md +++ b/docs/test_cases/t00040.md @@ -63,8 +63,10 @@ struct R { } // namespace clanguml::t00040 ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00040_class](./t00040_class.svg "Relationship and access filter test") +## Generated Mermaid diagrams +![t00040_class](./t00040_class_mermaid.svg "Relationship and access filter test") ## Generated JSON models ```json { @@ -199,7 +201,7 @@ struct R { "line": 25, "translation_unit": "../../tests/t00040/t00040.cc" }, - "type": "clanguml::t00040::B *" + "type": "B *" }, { "access": "private", @@ -282,7 +284,7 @@ struct R { "parameters": [ { "name": "a", - "type": "clanguml::t00040::A *" + "type": "A *" } ], "source_location": { @@ -307,8 +309,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00040_class", diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index 43b04c5c..c4bdb854 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,70 +9,70 @@ - - + + A - + - + get_a() : int - + - + ii_ : int - - + + AA - - + + AAA - + - + get_aaa() : int - + - + b : B * - - + + R - + - + foo(A * a) : void diff --git a/docs/test_cases/t00040_class_mermaid.svg b/docs/test_cases/t00040_class_mermaid.svg new file mode 100644 index 00000000..c16b95c9 --- /dev/null +++ b/docs/test_cases/t00040_class_mermaid.svg @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ #ii_ : int +
+
+ +
+ +get_a() : int +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ AA +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ AAA +
+
+ +
+ +b : B +
+
+ +
+ +get_aaa() : int +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +foo(A * a) : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00041.md b/docs/test_cases/t00041.md index 70c8ed07..511928bd 100644 --- a/docs/test_cases/t00041.md +++ b/docs/test_cases/t00041.md @@ -74,8 +74,10 @@ struct NM : public N { }; } // namespace clanguml::t00041 ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00041_class](./t00041_class.svg "Context diagram filter test") +## Generated Mermaid diagrams +![t00041_class](./t00041_class_mermaid.svg "Context diagram filter test") ## Generated JSON models ```json { @@ -123,7 +125,7 @@ struct NM : public N { }; "line": 14, "translation_unit": "../../tests/t00041/t00041.cc" }, - "type": "clanguml::t00041::RR *" + "type": "RR *" } ], "methods": [], @@ -209,7 +211,7 @@ struct NM : public N { }; "line": 28, "translation_unit": "../../tests/t00041/t00041.cc" }, - "type": "clanguml::t00041::E *" + "type": "E *" }, { "access": "public", @@ -221,7 +223,7 @@ struct NM : public N { }; "line": 29, "translation_unit": "../../tests/t00041/t00041.cc" }, - "type": "clanguml::t00041::F *" + "type": "F *" }, { "access": "public", @@ -256,7 +258,7 @@ struct NM : public N { }; "parameters": [ { "name": "h", - "type": "clanguml::t00041::H *" + "type": "H *" } ], "source_location": { @@ -390,8 +392,8 @@ struct NM : public N { }; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00041_class", diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index aca40ed3..d06dbaa4 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,107 +9,107 @@ - - + + R - - + + D - + - + rr : RR * - - + + E - - + + F - - + + RR - + - + foo(H * h) : void - + - + e : E * - + - + f : F * - + - + g : detail::G * - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM diff --git a/docs/test_cases/t00041_class_mermaid.svg b/docs/test_cases/t00041_class_mermaid.svg new file mode 100644 index 00000000..63ec4462 --- /dev/null +++ b/docs/test_cases/t00041_class_mermaid.svg @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +rr + +
+
+
+
+ + + +
+ + +e + +
+
+
+
+ + + +
+ + +f + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ R +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+ +
+ +rr : RR +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ F +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ RR +
+
+ +
+ +e : E +
+
+ +
+ +f : F +
+
+ +
+ +g : detail::G +
+
+ +
+ +foo(H * h) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ RRR +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::N +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::NN +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::NM +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00042.md b/docs/test_cases/t00042.md index b6c12cae..41fa0615 100644 --- a/docs/test_cases/t00042.md +++ b/docs/test_cases/t00042.md @@ -59,8 +59,10 @@ struct R { } // namespace clanguml::t00042 ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00042_class](./t00042_class.svg "Specialization class template diagram filter test") +## Generated Mermaid diagrams +![t00042_class](./t00042_class_mermaid.svg "Specialization class template diagram filter test") ## Generated JSON models ```json { @@ -305,8 +307,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00042_class", diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index e7240d76..dfe01169 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,15 +19,15 @@ - + - + a : T - - + + A @@ -36,15 +36,15 @@ - + - + a : void * - - + + B @@ -53,22 +53,22 @@ - + - + b : T - + - + bb : K - - + + A @@ -77,8 +77,8 @@ - - + + A @@ -87,8 +87,8 @@ - - + + B diff --git a/docs/test_cases/t00042_class_mermaid.svg b/docs/test_cases/t00042_class_mermaid.svg new file mode 100644 index 00000000..ecf5cddb --- /dev/null +++ b/docs/test_cases/t00042_class_mermaid.svg @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A<T> +
+
+ +
+ +a : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<void> +
+
+ +
+ +a : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<T,K> +
+
+ +
+ +b : T +
+
+ +
+ +bb : K +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<double> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<int,float> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00043.md b/docs/test_cases/t00043.md index 4da12efb..f4b1a46d 100644 --- a/docs/test_cases/t00043.md +++ b/docs/test_cases/t00043.md @@ -78,8 +78,10 @@ struct J { } // namespace clanguml::t00043 ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00043_class](./t00043_class.svg "Dependants and dependencies class diagram filter test") +## Generated Mermaid diagrams +![t00043_class](./t00043_class_mermaid.svg "Dependants and dependencies class diagram filter test") ## Generated JSON models ```json { @@ -140,7 +142,7 @@ struct J { "parameters": [ { "name": "a", - "type": "clanguml::t00043::dependants::A *" + "type": "A *" } ], "source_location": { @@ -193,7 +195,7 @@ struct J { "parameters": [ { "name": "a", - "type": "clanguml::t00043::dependants::A *" + "type": "A *" } ], "source_location": { @@ -246,7 +248,7 @@ struct J { "parameters": [ { "name": "b", - "type": "clanguml::t00043::dependants::B *" + "type": "B *" } ], "source_location": { @@ -299,7 +301,7 @@ struct J { "parameters": [ { "name": "c", - "type": "clanguml::t00043::dependants::C *" + "type": "C *" } ], "source_location": { @@ -329,7 +331,7 @@ struct J { "parameters": [ { "name": "bb", - "type": "clanguml::t00043::dependants::BB *" + "type": "BB *" } ], "source_location": { @@ -382,7 +384,7 @@ struct J { "parameters": [ { "name": "d", - "type": "clanguml::t00043::dependants::D *" + "type": "D *" } ], "source_location": { @@ -486,7 +488,7 @@ struct J { "parameters": [ { "name": "g", - "type": "clanguml::t00043::dependencies::G *" + "type": "G *" } ], "source_location": { @@ -516,7 +518,7 @@ struct J { "parameters": [ { "name": "gg", - "type": "clanguml::t00043::dependencies::GG *" + "type": "GG *" } ], "source_location": { @@ -569,7 +571,7 @@ struct J { "parameters": [ { "name": "h", - "type": "clanguml::t00043::dependencies::H *" + "type": "H *" } ], "source_location": { @@ -622,7 +624,7 @@ struct J { "parameters": [ { "name": "i", - "type": "clanguml::t00043::dependencies::I *" + "type": "I *" } ], "source_location": { @@ -651,8 +653,8 @@ struct J { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00043_class", diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index f1bf95c5..1304ac9b 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + - + @@ -9,189 +9,189 @@ - + dependants - - - dependencies - - - - - A - - + + + dependencies + + + + + A + + - - - - - B - + + + + + B + - - - + + + - - b(dependants::A * a) : void + + b(A * a) : void - - - - - - BB - + + + + + + BB + - - - + + + - - bb(dependants::A * a) : void + + bb(A * a) : void - - - - - - C - + + + + + + C + - - - + + + - - c(dependants::B * b) : void + + c(B * b) : void - - - - - - D - + + + + + + D + - - - + + + - - d(dependants::C * c) : void + + d(C * c) : void - - - + + + - - dd(dependants::BB * bb) : void + + dd(BB * bb) : void - - - - - - E - + + + + + + E + - - - + + + - - e(dependants::D * d) : void + + e(D * d) : void - - - - - - G - - + + + + + + G + + - - - - - GG - - + + + + + GG + + - - - - - H - + + + + + H + - - - + + + - - h(dependencies::G * g) : void + + h(G * g) : void - - - + + + - - hh(dependencies::GG * gg) : void + + hh(GG * gg) : void - - - - - - I - + + + + + + I + - - - + + + - - i(dependencies::H * h) : void + + i(H * h) : void - - - - - - J - + + + + + + J + - - - + + + - - i(dependencies::I * i) : void + + i(I * i) : void - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/test_cases/t00043_class_mermaid.svg b/docs/test_cases/t00043_class_mermaid.svg new file mode 100644 index 00000000..d26a7b79 --- /dev/null +++ b/docs/test_cases/t00043_class_mermaid.svg @@ -0,0 +1,419 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ dependants::A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ dependants::B +
+
+ +
+ +b(A * a) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ dependants::BB +
+
+ +
+ +bb(A * a) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ dependants::C +
+
+ +
+ +c(B * b) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ dependants::D +
+
+ +
+ +d(C * c) : void +
+
+ +
+ +dd(BB * bb) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ dependants::E +
+
+ +
+ +e(D * d) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ dependencies::G +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ dependencies::GG +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ dependencies::H +
+
+ +
+ +h(G * g) : void +
+
+ +
+ +hh(GG * gg) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ dependencies::I +
+
+ +
+ +i(H * h) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ dependencies::J +
+
+ +
+ +i(I * i) : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00044.md b/docs/test_cases/t00044.md index c149a98b..09c09c38 100644 --- a/docs/test_cases/t00044.md +++ b/docs/test_cases/t00044.md @@ -57,8 +57,10 @@ struct R { } // namespace clanguml::t00044 ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00044_class](./t00044_class.svg "Test case for inner type aliases with parent class template args") +## Generated Mermaid diagrams +![t00044_class](./t00044_class_mermaid.svg "Test case for inner type aliases with parent class template args") ## Generated JSON models ```json { @@ -430,8 +432,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00044_class", diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index 63829706..506e782b 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + signal_handler @@ -19,8 +19,8 @@ - - + + sink @@ -28,26 +28,26 @@ signal_handler<Ret(Args...),A> - + - + sink(signal_t & sh) : void get_signal<CastTo>() : CastTo * - + - + signal : signal_t * - - + + signal_handler @@ -56,8 +56,8 @@ - - + + sink @@ -66,23 +66,23 @@ - - + + R - + - + sink1 : sink<signal_handler<void (int),bool>> - - + + signal_handler @@ -91,8 +91,8 @@ - - + + sink diff --git a/docs/test_cases/t00044_class_mermaid.svg b/docs/test_cases/t00044_class_mermaid.svg new file mode 100644 index 00000000..4f928ac4 --- /dev/null +++ b/docs/test_cases/t00044_class_mermaid.svg @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ + -signal + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +sink1 + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ signal_handler<Ret(Args...),A> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ sink<signal_handler<Ret(Args...),A>> +
+
+ +
+ -signal : signal_t +
+
+ +
+ +sink(signal_t & sh) : void +
+
+ +
+ +get_signal() : CastTo +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ signal_handler<void(int),bool> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ sink<signal_handler<void(int),bool>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +sink1 : sink<signal_handler<void (int),bool>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ signal_handler<T,A> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ sink<T> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00045.md b/docs/test_cases/t00045.md index 0b5f4e99..d9817a1a 100644 --- a/docs/test_cases/t00045.md +++ b/docs/test_cases/t00045.md @@ -60,8 +60,10 @@ public: } // namespace ns1 ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00045_class](./t00045_class.svg "Test case for root namespace handling") +## Generated Mermaid diagrams +![t00045_class](./t00045_class_mermaid.svg "Test case for root namespace handling") ## Generated JSON models ```json { @@ -377,7 +379,7 @@ public: "line": 31, "translation_unit": "../../tests/t00045/t00045.cc" }, - "type": "ns1::ns2::A *" + "type": "A *" }, { "access": "public", @@ -461,8 +463,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00045_class", diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg index c422693b..911a9a6b 100644 --- a/docs/test_cases/t00045_class.svg +++ b/docs/test_cases/t00045_class.svg @@ -1,6 +1,6 @@ - + @@ -9,32 +9,32 @@ - - + + A - - + + AA - - + + AAA - - + + AAAA @@ -43,110 +43,110 @@ - + - + t : T - - + + ns1::A - - + + ns1::ns2::A - - + + ns1::ns2::B - - + + ns1::ns2::C - - + + ns1::ns2::D - - + + ns1::ns2::E - - + + ns1::ns2::AAA - - + + ns1::ns2::R - + - + foo(AA & aa) : void - + - - a : ns1::ns2::A * + + a : A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * diff --git a/docs/test_cases/t00045_class_mermaid.svg b/docs/test_cases/t00045_class_mermaid.svg new file mode 100644 index 00000000..33d2ca48 --- /dev/null +++ b/docs/test_cases/t00045_class_mermaid.svg @@ -0,0 +1,428 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +a + +
+
+
+
+ + + +
+ + +ns1_a + +
+
+
+
+ + + +
+ + +ns1_ns2_a + +
+
+
+
+ + + +
+ + +root_a + +
+
+
+
+ + + +
+ + +<> + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ AA +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ AAA +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ AAAA<T> +
+
+ +
+ -t : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::E +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::AAA +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::R +
+
+ +
+ +a : A +
+
+ +
+ +ns1_a : ns1::A +
+
+ +
+ +ns1_ns2_a : ns1::ns2::A +
+
+ +
+ +root_a : ::A +
+
+ +
+ +foo(AA & aa) : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00046.md b/docs/test_cases/t00046.md index fe400fcc..41c3a812 100644 --- a/docs/test_cases/t00046.md +++ b/docs/test_cases/t00046.md @@ -53,8 +53,10 @@ public: } // namespace ns1 ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00046_class](./t00046_class.svg "Test case for root namespace handling with packages") +## Generated Mermaid diagrams +![t00046_class](./t00046_class_mermaid.svg "Test case for root namespace handling with packages") ## Generated JSON models ```json { @@ -290,7 +292,7 @@ public: "line": 26, "translation_unit": "../../tests/t00046/t00046.cc" }, - "type": "ns1::ns2::A *" + "type": "A *" }, { "access": "public", @@ -394,8 +396,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00046_class", diff --git a/docs/test_cases/t00046_class.svg b/docs/test_cases/t00046_class.svg index b4aeb1af..176f7d42 100644 --- a/docs/test_cases/t00046_class.svg +++ b/docs/test_cases/t00046_class.svg @@ -1,6 +1,6 @@ - + @@ -9,120 +9,120 @@ - + ns1 - + ns2 - - + + A - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + foo(AA & aa) : void - + - - a : ns1::ns2::A * + + a : A * - + - + i : std::vector<std::uint8_t> - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * - - + + A - - + + AA diff --git a/docs/test_cases/t00046_class_mermaid.svg b/docs/test_cases/t00046_class_mermaid.svg new file mode 100644 index 00000000..9b079680 --- /dev/null +++ b/docs/test_cases/t00046_class_mermaid.svg @@ -0,0 +1,359 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +a + +
+
+
+
+ + + +
+ + +ns1_a + +
+
+
+
+ + + +
+ + +ns1_ns2_a + +
+
+
+
+ + + +
+ + +root_a + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ AA +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::E +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ns1::ns2::R +
+
+ +
+ +a : A +
+
+ +
+ +i : std::vector<std::uint8_t> +
+
+ +
+ +ns1_a : ns1::A +
+
+ +
+ +ns1_ns2_a : ns1::ns2::A +
+
+ +
+ +root_a : ::A +
+
+ +
+ +foo(AA & aa) : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00047.md b/docs/test_cases/t00047.md index e0dd5452..3e44ff15 100644 --- a/docs/test_cases/t00047.md +++ b/docs/test_cases/t00047.md @@ -43,8 +43,10 @@ using conditional = typename conditional_t::type; } // namespace t00047 } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00047_class](./t00047_class.svg "Test case for recursive variadic template") +## Generated Mermaid diagrams +![t00047_class](./t00047_class_mermaid.svg "Test case for recursive variadic template") ## Generated JSON models ```json { @@ -192,8 +194,8 @@ using conditional = typename conditional_t::type; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00047_class", diff --git a/docs/test_cases/t00047_class.svg b/docs/test_cases/t00047_class.svg index eb0acaab..02837f88 100644 --- a/docs/test_cases/t00047_class.svg +++ b/docs/test_cases/t00047_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + conditional_t @@ -19,8 +19,8 @@ - - + + conditional_t @@ -29,8 +29,8 @@ - - + + conditional_t @@ -39,8 +39,8 @@ - - + + conditional_t diff --git a/docs/test_cases/t00047_class_mermaid.svg b/docs/test_cases/t00047_class_mermaid.svg new file mode 100644 index 00000000..f434bc56 --- /dev/null +++ b/docs/test_cases/t00047_class_mermaid.svg @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ conditional_t<Else> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ conditional_t<std::true_type,Result,Tail...> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ conditional_t<std::false_type,Result,Tail...> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ conditional_t<Ts...> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00048.md b/docs/test_cases/t00048.md index 97602829..3e24087d 100644 --- a/docs/test_cases/t00048.md +++ b/docs/test_cases/t00048.md @@ -119,8 +119,10 @@ template struct BaseTemplate { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00048_class](./t00048_class.svg "Test case for unique entity id with multiple translation units") +## Generated Mermaid diagrams +![t00048_class](./t00048_class_mermaid.svg "Test case for unique entity id with multiple translation units") ## Generated JSON models ```json { @@ -543,8 +545,8 @@ template struct BaseTemplate { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00048_class", diff --git a/docs/test_cases/t00048_class.svg b/docs/test_cases/t00048_class.svg index 2200ab4b..91df6e20 100644 --- a/docs/test_cases/t00048_class.svg +++ b/docs/test_cases/t00048_class.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + Base - + - + foo() = 0 : void - + - + base : int - - + + BaseTemplate @@ -40,45 +40,45 @@ T - + - + foo() = 0 : void - + - + base : T - - + + B - + - + foo() : void - + - + b : int - - + + BTemplate @@ -86,45 +86,45 @@ T - + - + foo() : void - + - + b : T - - + + A - + - + foo() : void - + - + a : int - - + + ATemplate @@ -132,19 +132,19 @@ T - + - + foo() : void - + - + a : T diff --git a/docs/test_cases/t00048_class_mermaid.svg b/docs/test_cases/t00048_class_mermaid.svg new file mode 100644 index 00000000..94192c15 --- /dev/null +++ b/docs/test_cases/t00048_class_mermaid.svg @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ «abstract» +
+
+ +
+ Base +
+
+ +
+ +base : int +
+
+ +
+ +foo() : void +
+
+
+
+
+ + + + + + + +
+ «abstract» +
+
+ +
+ BaseTemplate<T> +
+
+ +
+ +base : T +
+
+ +
+ +foo() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+ +
+ +b : int +
+
+ +
+ +foo() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ BTemplate<T> +
+
+ +
+ +b : T +
+
+ +
+ +foo() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ +a : int +
+
+ +
+ +foo() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ ATemplate<T> +
+
+ +
+ +a : T +
+
+ +
+ +foo() : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00049.md b/docs/test_cases/t00049.md index eee6b9de..593f6a27 100644 --- a/docs/test_cases/t00049.md +++ b/docs/test_cases/t00049.md @@ -46,8 +46,10 @@ struct R { } // namespace t00049 } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00049_class](./t00049_class.svg "Test case configurable type aliases") +## Generated Mermaid diagrams +![t00049_class](./t00049_class_mermaid.svg "Test case configurable type aliases") ## Generated JSON models ```json { @@ -325,8 +327,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00049_class", diff --git a/docs/test_cases/t00049_class.svg b/docs/test_cases/t00049_class.svg index 92378b07..929353fa 100644 --- a/docs/test_cases/t00049_class.svg +++ b/docs/test_cases/t00049_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,23 +18,23 @@ T - + - + get_a() : T & - + - + a : T - - + + A @@ -43,8 +43,8 @@ - - + + A @@ -53,8 +53,8 @@ - - + + A @@ -63,47 +63,47 @@ - - + + R - + - + get_int_map() : A<intmap> - + - + set_int_map(A<intmap> && int_map) : void - + - + a_int_map : A<intmap> - + - + a_string : A<thestring> - + - + a_vector_string : A<string_vector> diff --git a/docs/test_cases/t00049_class_mermaid.svg b/docs/test_cases/t00049_class_mermaid.svg new file mode 100644 index 00000000..e1d131f9 --- /dev/null +++ b/docs/test_cases/t00049_class_mermaid.svg @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +a_string + +
+
+
+
+ + + +
+ + +a_vector_string + +
+
+
+
+ + + +
+ + +a_int_map + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A<T> +
+
+ +
+ +a : T +
+
+ +
+ +get_a() : T & +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<intmap> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<thestring> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<string_vector> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +a_int_map : A<intmap> +
+
+ +
+ +a_string : A<thestring> +
+
+ +
+ +a_vector_string : A<string_vector> +
+
+ +
+ +get_int_map() : A<intmap> +
+
+ +
+ +set_int_map(A && int_map) : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00050.md b/docs/test_cases/t00050.md index 6af63138..23de4c42 100644 --- a/docs/test_cases/t00050.md +++ b/docs/test_cases/t00050.md @@ -180,8 +180,10 @@ class NoComment { }; } // namespace t00050 } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00050_class](./t00050_class.svg "Test case for generating notes from comments using jinja templates") +## Generated Mermaid diagrams +![t00050_class](./t00050_class_mermaid.svg "Test case for generating notes from comments using jinja templates") ## Generated JSON models ```json { @@ -504,8 +506,8 @@ class NoComment { }; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00050_class", diff --git a/docs/test_cases/t00050_class.svg b/docs/test_cases/t00050_class.svg index 12f5f89a..deb1171c 100644 --- a/docs/test_cases/t00050_class.svg +++ b/docs/test_cases/t00050_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + utils::D - - + + E @@ -52,8 +52,8 @@ E3 - - + + F @@ -62,43 +62,43 @@ - + - + t : T[N] - + - + v : V - - + + G - - + + NoComment - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis vehicula class ultricies mollis dictumst, aenean non a in donec nulla. @@ -125,50 +125,50 @@ imperdiet praesent magnis ridiculus congue gravida curabitur dictum sagittis, enim et magna sit inceptos sodales parturient pharetra mollis, aenean vel nostra tellus commodo pretium sapien sociosqu. - + This is a short description of class G. - + This is an intermediate description of class G. - + This is a long description of class G. - + Lorem ipsum - + TODO 1. Write meaningful comment - + TODO 2. Write tests - + TODO 3. Implement - + Long comment example - + TODO Implement... - + Simple array wrapper. - + Template parameters diff --git a/docs/test_cases/t00050_class_mermaid.svg b/docs/test_cases/t00050_class_mermaid.svg new file mode 100644 index 00000000..979d2d64 --- /dev/null +++ b/docs/test_cases/t00050_class_mermaid.svg @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ utils::D +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ E +
+
+ +
+ E1 +
+
+ +
+ E2 +
+
+ +
+ E3 +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ F<T,V,int N> +
+
+ +
+ -t : T[N] +
+
+ +
+ -v : V +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ NoComment +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00051.md b/docs/test_cases/t00051.md index f779ab00..1da67b36 100644 --- a/docs/test_cases/t00051.md +++ b/docs/test_cases/t00051.md @@ -82,8 +82,10 @@ A::custom_thread2 A::start_thread2() } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00051_class](./t00051_class.svg "Test case for relative paths in lambda names") +## Generated Mermaid diagrams +![t00051_class](./t00051_class_mermaid.svg "Test case for relative paths in lambda names") ## Generated JSON models ```json { @@ -428,7 +430,7 @@ A::custom_thread2 A::start_thread2() "line": 33, "translation_unit": "../../tests/t00051/t00051.cc" }, - "type": "clanguml::t00051::A::custom_thread1" + "type": "custom_thread1" }, { "access": "private", @@ -453,7 +455,7 @@ A::custom_thread2 A::start_thread2() "line": 39, "translation_unit": "../../tests/t00051/t00051.cc" }, - "type": "clanguml::t00051::A::custom_thread2" + "type": "custom_thread2" }, { "access": "private", @@ -637,8 +639,8 @@ A::custom_thread2 A::start_thread2() } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00051_class", diff --git a/docs/test_cases/t00051_class.svg b/docs/test_cases/t00051_class.svg index 7463e030..063a725f 100644 --- a/docs/test_cases/t00051_class.svg +++ b/docs/test_cases/t00051_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + B @@ -18,125 +18,125 @@ F,FF=F - + - + B(F && f, FF && ff) : void - + - + f() : void - + - + ff() : void - + - + f_ : F - + - + ff_ : FF - - + + B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)> - + - + B((lambda at ../../tests/t00051/t00051.cc:43:18) && f, (lambda at ../../tests/t00051/t00051.cc:43:27) && ff) : void - + - + f() : void - + - + ff() : void - + - + f_ : (lambda at ../../tests/t00051/t00051.cc:43:18) - + - + ff_ : (lambda at ../../tests/t00051/t00051.cc:43:27) - - + + A - + - + get_function() : (lambda at ../../tests/t00051/t00051.cc:48:16) - + - - start_thread1() : A::custom_thread1 + + start_thread1() : custom_thread1 - + - - start_thread2() : A::custom_thread2 + + start_thread2() : custom_thread2 - + - + start_thread3() : B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)> - - + + A::custom_thread1 @@ -145,18 +145,18 @@ custom_thread1<Function,Args...>(Function && f, Args &&... args) : void - - + + A::custom_thread2 - + - + thread((lambda at ../../tests/t00051/t00051.cc:59:27) &&) : void diff --git a/docs/test_cases/t00051_class_mermaid.svg b/docs/test_cases/t00051_class_mermaid.svg new file mode 100644 index 00000000..9c4e01fc --- /dev/null +++ b/docs/test_cases/t00051_class_mermaid.svg @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + [nested] + +
+
+
+
+ + + +
+ + [nested] + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ B<F,FF=F> +
+
+ +
+ +f_ : F +
+
+ +
+ +ff_ : FF +
+
+ +
+ +B(F && f, FF && ff) : void +
+
+ +
+ +f() : void +
+
+ +
+ +ff() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)> +
+
+ +
+ +f_ : (lambda at ../../tests/t00051/t00051.cc:43:18) +
+
+ +
+ +ff_ : (lambda at ../../tests/t00051/t00051.cc:43:27) +
+
+ +
+ +B((lambda at ../../tests/t00051/t00051.cc:43:18) && f, (lambda at ../../tests/t00051/t00051.cc:43:27) && ff) : void +
+
+ +
+ +f() : void +
+
+ +
+ +ff() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ -get_function() : (lambda at ../../tests/t00051/t00051.cc:48:16) +
+
+ +
+ -start_thread1() : custom_thread1 +
+
+ +
+ -start_thread2() : custom_thread2 +
+
+ +
+ -start_thread3() : B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A::custom_thread1 +
+
+ +
+ +custom_thread1(Function && f, Args &&... args) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A::custom_thread2 +
+
+ +
+ +thread((lambda at ../../tests/t00051/t00051.cc:59:27) : &&) : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00052.md b/docs/test_cases/t00052.md index 074a6b2f..f70437be 100644 --- a/docs/test_cases/t00052.md +++ b/docs/test_cases/t00052.md @@ -53,8 +53,10 @@ struct R { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00052_class](./t00052_class.svg "Test case for template methods rendering") +## Generated Mermaid diagrams +![t00052_class](./t00052_class_mermaid.svg "Test case for template methods rendering") ## Generated JSON models ```json { @@ -355,7 +357,7 @@ struct R { "line": 30, "translation_unit": "../../tests/t00052/t00052.cc" }, - "type": "clanguml::t00052::A" + "type": "A" }, { "access": "public", @@ -396,8 +398,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00052_class", diff --git a/docs/test_cases/t00052_class.svg b/docs/test_cases/t00052_class.svg index a605c9cd..8ae3b728 100644 --- a/docs/test_cases/t00052_class.svg +++ b/docs/test_cases/t00052_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -21,8 +21,8 @@ aa<F,Q>(F && f, Q q) : void - - + + B @@ -30,18 +30,18 @@ T - + - + b(T t) : T bb<F>(F && f, T t) : T - - + + C @@ -52,8 +52,8 @@ c<P>(P p) : T - - + + B @@ -62,8 +62,8 @@ - - + + C @@ -72,33 +72,33 @@ - - + + R - + - + a : A - + - + b : B<int> - + - + c : C<int> diff --git a/docs/test_cases/t00052_class_mermaid.svg b/docs/test_cases/t00052_class_mermaid.svg new file mode 100644 index 00000000..43421355 --- /dev/null +++ b/docs/test_cases/t00052_class_mermaid.svg @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +a + +
+
+
+
+ + + +
+ + +b + +
+
+
+
+ + + +
+ + +c + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ +a(T p) : T +
+
+ +
+ +aa(F && f, Q q) : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<T> +
+
+ +
+ +b(T t) : T +
+
+ +
+ +bb(F && f, T t) : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<T> +
+
+ +
+ -c<p>(P p) : T</p> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +a : A +
+
+ +
+ +b : B<int> +
+
+ +
+ +c : C<int> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00053.md b/docs/test_cases/t00053.md index 5bad95ef..1bd1de0d 100644 --- a/docs/test_cases/t00053.md +++ b/docs/test_cases/t00053.md @@ -50,8 +50,10 @@ enum class j { jjj }; } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00053_class](./t00053_class.svg "Test case for `together` layout hint in class diagram") +## Generated Mermaid diagrams +![t00053_class](./t00053_class_mermaid.svg "Test case for `together` layout hint in class diagram") ## Generated JSON models ```json { @@ -418,8 +420,8 @@ enum class j { jjj }; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00053_class", diff --git a/docs/test_cases/t00053_class.svg b/docs/test_cases/t00053_class.svg index 587925c6..46a522a6 100644 --- a/docs/test_cases/t00053_class.svg +++ b/docs/test_cases/t00053_class.svg @@ -1,6 +1,6 @@ - + @@ -9,72 +9,72 @@ - - + + A - - + + C - - + + E - - + + F - - + + a - - + + c - - + + e - - + + f - - + + h @@ -82,8 +82,8 @@ hhh - - + + j @@ -91,56 +91,56 @@ jjj - - + + b - - + + d - - + + g - - + + B - - + + D - - + + G - - + + i diff --git a/docs/test_cases/t00053_class_mermaid.svg b/docs/test_cases/t00053_class_mermaid.svg new file mode 100644 index 00000000..36915043 --- /dev/null +++ b/docs/test_cases/t00053_class_mermaid.svg @@ -0,0 +1,396 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ b +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ d +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ g +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ i +
+
+ +
+ iii +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ F +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ a +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ c +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ e +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ f +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ h +
+
+ +
+ hhh +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ j +
+
+ +
+ jjj +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00054.md b/docs/test_cases/t00054.md index e92614ff..313708e7 100644 --- a/docs/test_cases/t00054.md +++ b/docs/test_cases/t00054.md @@ -64,8 +64,10 @@ enum class j { jjj }; } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00054_class](./t00054_class.svg "Test case for `together` layout hint in class diagram with rendered namespaces") +## Generated Mermaid diagrams +![t00054_class](./t00054_class_mermaid.svg "Test case for `together` layout hint in class diagram with rendered namespaces") ## Generated JSON models ```json { @@ -460,8 +462,8 @@ enum class j { jjj }; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00054_class", diff --git a/docs/test_cases/t00054_class.svg b/docs/test_cases/t00054_class.svg index 36964618..73f9a81b 100644 --- a/docs/test_cases/t00054_class.svg +++ b/docs/test_cases/t00054_class.svg @@ -1,6 +1,6 @@ - + @@ -9,28 +9,28 @@ - + detail - + detail2 - + detail3 - + detail4 - - + + d - - + + a @@ -40,8 +40,8 @@ - - + + c @@ -51,8 +51,8 @@ - - + + e @@ -62,40 +62,40 @@ - - + + C - - + + F - - + + D - - + + E - - + + A @@ -104,8 +104,8 @@ - - + + B @@ -114,8 +114,8 @@ - - + + f @@ -124,8 +124,8 @@ - - + + G @@ -133,8 +133,8 @@ - - + + h @@ -143,8 +143,8 @@ hhh - - + + i @@ -153,8 +153,8 @@ iii - - + + j @@ -163,16 +163,16 @@ jjj - - + + b - - + + g diff --git a/docs/test_cases/t00054_class_mermaid.svg b/docs/test_cases/t00054_class_mermaid.svg new file mode 100644 index 00000000..10857902 --- /dev/null +++ b/docs/test_cases/t00054_class_mermaid.svg @@ -0,0 +1,396 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ b +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ detail::d +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ g +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ detail2::C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ detail2::F +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ a +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ f +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ detail2::detail3::D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ detail2::detail3::E +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ detail4::h +
+
+ +
+ hhh +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ detail4::i +
+
+ +
+ iii +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ detail4::j +
+
+ +
+ jjj +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ detail::c +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ detail::e +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00055.md b/docs/test_cases/t00055.md index 5b50b3e0..81e27570 100644 --- a/docs/test_cases/t00055.md +++ b/docs/test_cases/t00055.md @@ -37,8 +37,10 @@ struct J { }; } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00055_class](./t00055_class.svg "Test case for `row` and `column` layout hints") +## Generated Mermaid diagrams +![t00055_class](./t00055_class_mermaid.svg "Test case for `row` and `column` layout hints") ## Generated JSON models ```json { @@ -266,8 +268,8 @@ struct J { }; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00055_class", diff --git a/docs/test_cases/t00055_class.svg b/docs/test_cases/t00055_class.svg index ef567e17..700fb3cc 100644 --- a/docs/test_cases/t00055_class.svg +++ b/docs/test_cases/t00055_class.svg @@ -1,6 +1,6 @@ - + @@ -9,80 +9,80 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J diff --git a/docs/test_cases/t00055_class_mermaid.svg b/docs/test_cases/t00055_class_mermaid.svg new file mode 100644 index 00000000..7ea49863 --- /dev/null +++ b/docs/test_cases/t00055_class_mermaid.svg @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ F +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ H +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ I +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ J +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00056.md b/docs/test_cases/t00056.md index d2e494ac..7e34c271 100644 --- a/docs/test_cases/t00056.md +++ b/docs/test_cases/t00056.md @@ -17,6 +17,7 @@ diagrams: ## Source code File t00056.cc ```cpp +#include #include namespace clanguml { @@ -111,8 +112,10 @@ struct F { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00056_class](./t00056_class.svg "Basic C++20 concepts test case") +## Generated Mermaid diagrams +![t00056_class](./t00056_class_mermaid.svg "Basic C++20 concepts test case") ## Generated JSON models ```json { @@ -127,7 +130,7 @@ struct F { "source_location": { "column": 9, "file": "../../tests/t00056/t00056.cc", - "line": 7, + "line": 8, "translation_unit": "../../tests/t00056/t00056.cc" }, "statements": [], @@ -151,7 +154,7 @@ struct F { "source_location": { "column": 9, "file": "../../tests/t00056/t00056.cc", - "line": 10, + "line": 11, "translation_unit": "../../tests/t00056/t00056.cc" }, "statements": [ @@ -168,7 +171,7 @@ struct F { "source_location": { "column": 9, "file": "../../tests/t00056/t00056.cc", - "line": 15, + "line": 16, "translation_unit": "../../tests/t00056/t00056.cc" }, "statements": [], @@ -188,7 +191,7 @@ struct F { "source_location": { "column": 9, "file": "../../tests/t00056/t00056.cc", - "line": 19, + "line": 20, "translation_unit": "../../tests/t00056/t00056.cc" }, "statements": [ @@ -206,7 +209,7 @@ struct F { "source_location": { "column": 9, "file": "../../tests/t00056/t00056.cc", - "line": 26, + "line": 27, "translation_unit": "../../tests/t00056/t00056.cc" }, "statements": [ @@ -228,7 +231,7 @@ struct F { "source_location": { "column": 9, "file": "../../tests/t00056/t00056.cc", - "line": 29, + "line": 30, "translation_unit": "../../tests/t00056/t00056.cc" }, "statements": [ @@ -247,7 +250,7 @@ struct F { "source_location": { "column": 9, "file": "../../tests/t00056/t00056.cc", - "line": 45, + "line": 46, "translation_unit": "../../tests/t00056/t00056.cc" }, "statements": [], @@ -262,7 +265,7 @@ struct F { "source_location": { "column": 9, "file": "../../tests/t00056/t00056.cc", - "line": 48, + "line": 49, "translation_unit": "../../tests/t00056/t00056.cc" }, "statements": [], @@ -285,7 +288,7 @@ struct F { "source_location": { "column": 7, "file": "../../tests/t00056/t00056.cc", - "line": 53, + "line": 54, "translation_unit": "../../tests/t00056/t00056.cc" }, "type": "T" @@ -297,7 +300,7 @@ struct F { "source_location": { "column": 36, "file": "../../tests/t00056/t00056.cc", - "line": 52, + "line": 53, "translation_unit": "../../tests/t00056/t00056.cc" }, "template_parameters": [ @@ -327,7 +330,7 @@ struct F { "source_location": { "column": 7, "file": "../../tests/t00056/t00056.cc", - "line": 60, + "line": 61, "translation_unit": "../../tests/t00056/t00056.cc" }, "type": "T" @@ -339,7 +342,7 @@ struct F { "source_location": { "column": 8, "file": "../../tests/t00056/t00056.cc", - "line": 59, + "line": 60, "translation_unit": "../../tests/t00056/t00056.cc" }, "template_parameters": [ @@ -369,7 +372,7 @@ struct F { "source_location": { "column": 7, "file": "../../tests/t00056/t00056.cc", - "line": 70, + "line": 71, "translation_unit": "../../tests/t00056/t00056.cc" }, "type": "T" @@ -381,7 +384,7 @@ struct F { "source_location": { "column": 8, "file": "../../tests/t00056/t00056.cc", - "line": 69, + "line": 70, "translation_unit": "../../tests/t00056/t00056.cc" }, "template_parameters": [ @@ -410,7 +413,7 @@ struct F { "source_location": { "column": 8, "file": "../../tests/t00056/t00056.cc", - "line": 75, + "line": 76, "translation_unit": "../../tests/t00056/t00056.cc" }, "template_parameters": [ @@ -464,7 +467,7 @@ struct F { "source_location": { "column": 8, "file": "../../tests/t00056/t00056.cc", - "line": 80, + "line": 81, "translation_unit": "../../tests/t00056/t00056.cc" }, "type": "T1" @@ -476,7 +479,7 @@ struct F { "source_location": { "column": 8, "file": "../../tests/t00056/t00056.cc", - "line": 81, + "line": 82, "translation_unit": "../../tests/t00056/t00056.cc" }, "type": "T2" @@ -488,7 +491,7 @@ struct F { "source_location": { "column": 8, "file": "../../tests/t00056/t00056.cc", - "line": 82, + "line": 83, "translation_unit": "../../tests/t00056/t00056.cc" }, "type": "T3" @@ -500,7 +503,7 @@ struct F { "source_location": { "column": 8, "file": "../../tests/t00056/t00056.cc", - "line": 79, + "line": 80, "translation_unit": "../../tests/t00056/t00056.cc" }, "template_parameters": [ @@ -542,7 +545,7 @@ struct F { "source_location": { "column": 8, "file": "../../tests/t00056/t00056.cc", - "line": 88, + "line": 89, "translation_unit": "../../tests/t00056/t00056.cc" }, "type": "T1" @@ -554,7 +557,7 @@ struct F { "source_location": { "column": 8, "file": "../../tests/t00056/t00056.cc", - "line": 89, + "line": 90, "translation_unit": "../../tests/t00056/t00056.cc" }, "type": "T2" @@ -566,7 +569,7 @@ struct F { "source_location": { "column": 8, "file": "../../tests/t00056/t00056.cc", - "line": 90, + "line": 91, "translation_unit": "../../tests/t00056/t00056.cc" }, "type": "T3" @@ -578,7 +581,7 @@ struct F { "source_location": { "column": 8, "file": "../../tests/t00056/t00056.cc", - "line": 87, + "line": 88, "translation_unit": "../../tests/t00056/t00056.cc" }, "template_parameters": [ @@ -605,8 +608,8 @@ struct F { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00056_class", diff --git a/docs/test_cases/t00056_class.svg b/docs/test_cases/t00056_class.svg index 05e1a14b..c9a23da9 100644 --- a/docs/test_cases/t00056_class.svg +++ b/docs/test_cases/t00056_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + «concept» @@ -20,8 +20,8 @@ - - + + «concept» @@ -33,8 +33,8 @@ sizeof (l) > sizeof (r) - - + + «concept» @@ -44,8 +44,8 @@ - - + + «concept» @@ -58,8 +58,8 @@ container.begin() container.end() - - + + «concept» @@ -71,8 +71,8 @@ typename T::value_type - - + + «concept» @@ -86,8 +86,8 @@ {std::to_string(s)} noexcept {std::to_string(s)} -> std::same_as<std::string> - - + + «concept» @@ -97,8 +97,8 @@ - - + + «concept» @@ -108,8 +108,8 @@ - - + + A @@ -118,15 +118,15 @@ - + - + a : T - - + + B @@ -135,15 +135,15 @@ - + - + b : T - - + + C @@ -152,15 +152,15 @@ - + - + c : T - - + + D @@ -169,8 +169,8 @@ - - + + E @@ -179,29 +179,29 @@ - + - + e1 : T1 - + - + e2 : T2 - + - + e3 : T3 - - + + F @@ -210,25 +210,25 @@ - + - + f1 : T1 - + - + f2 : T2 - + - + f3 : T3 diff --git a/docs/test_cases/t00056_class_mermaid.svg b/docs/test_cases/t00056_class_mermaid.svg new file mode 100644 index 00000000..e442788c --- /dev/null +++ b/docs/test_cases/t00056_class_mermaid.svg @@ -0,0 +1,594 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + T + +
+
+
+
+ + + +
+ + T + +
+
+
+
+ + + +
+ + T + +
+
+
+
+ + + +
+ + T + +
+
+
+
+ + + +
+ + T + +
+
+
+
+ + + +
+ + T + +
+
+
+
+ + + +
+ + T + +
+
+
+
+ + + +
+ + T + +
+
+
+
+ + + +
+ + T1 + +
+
+
+
+ + + +
+ + T3 + +
+
+
+
+ + + +
+ + T2 + +
+
+
+
+ + + +
+ + T5 + +
+
+
+
+ + + +
+ + T1,T3 + +
+
+
+
+ + + +
+ + T1,T3 + +
+
+
+
+
+ + + + + + + + +
+ «concept» +
+
+ +
+ greater_than_simple<T,L> +
+
+
+
+
+ + + + + + + +
+ «concept» +
+
+ +
+ greater_than_with_requires<T,P> +
+
+ +
+ "sizeof (l) > sizeof (r)" +
+
+ +
+ "(T l,P r)" +
+
+
+
+
+ + + + + + + +
+ «concept» +
+
+ +
+ max_four_bytes<T> +
+
+
+
+
+ + + + + + + +
+ «concept» +
+
+ +
+ iterable<T> +
+
+ +
+ "container.begin()" +
+
+ +
+ "container.end()" +
+
+ +
+ "(T container)" +
+
+
+
+
+ + + + + + + +
+ «concept» +
+
+ +
+ has_value_type<T> +
+
+ +
+ "typename T::value_type" +
+
+ +
+ "()" +
+
+
+
+
+ + + + + + + +
+ «concept» +
+
+ +
+ convertible_to_string<T> +
+
+ +
+ "std::string{s}" +
+
+ +
+ "{std::to_string(s)} noexcept" +
+
+ +
+ "{std::to_string(s)} -> std::same_as<std::string>" +
+
+ +
+ "(T s)" +
+
+
+
+
+ + + + + + + +
+ «concept» +
+
+ +
+ iterable_with_value_type<T> +
+
+
+
+
+ + + + + + + +
+ «concept» +
+
+ +
+ iterable_or_small_value_type<T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<max_four_bytes T> +
+
+ +
+ +a : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<T> +
+
+ +
+ +b : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<convertible_to_string T> +
+
+ +
+ +c : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D<iterable T1,T2,iterable T3,T4,T5> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ E<T1,T2,T3> +
+
+ +
+ +e1 : T1 +
+
+ +
+ +e2 : T2 +
+
+ +
+ +e3 : T3 +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ F<T1,T2,T3> +
+
+ +
+ +f1 : T1 +
+
+ +
+ +f2 : T2 +
+
+ +
+ +f3 : T3 +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00057.md b/docs/test_cases/t00057.md index 7d9a7076..1d3a56ac 100644 --- a/docs/test_cases/t00057.md +++ b/docs/test_cases/t00057.md @@ -59,8 +59,10 @@ struct t00057_R { }; ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00057_class](./t00057_class.svg "Test case C99/C11 translation units with structs and unions") +## Generated Mermaid diagrams +![t00057_class](./t00057_class_mermaid.svg "Test case C99/C11 translation units with structs and unions") ## Generated JSON models ```json { @@ -550,8 +552,8 @@ struct t00057_R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00057_class", diff --git a/docs/test_cases/t00057_class.svg b/docs/test_cases/t00057_class.svg index 8e219367..73e936bd 100644 --- a/docs/test_cases/t00057_class.svg +++ b/docs/test_cases/t00057_class.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - + + t00057_A - + - + a1 : int - - + + t00057_B - + - + b1 : int - - + + t00057_C - + - + c1 : int - - + + «union» @@ -63,73 +63,73 @@ - + - + d1 : int - + - + d2 : float - - + + t00057_E - + - + coordinates : t00057_E::(anonymous_739) - + - + e : int - + - + height : t00057_E::(anonymous_807) - - + + t00057_E::(coordinates) - + - + x : int - + - + y : int - - + + «union» @@ -137,105 +137,105 @@ - + - + t : double - + - + z : int - - + + t00057_G - + - + g1 : int - - + + t00057_R - + - + a : struct t00057_A - + - + b : t00057_B - + - + c : struct t00057_C * - + - + d : union t00057_D - + - + e : struct t00057_E * - + - + f : struct t00057_F * - + - + g : struct t00057_G * - - + + t00057_F - + - + f1 : int diff --git a/docs/test_cases/t00057_class_mermaid.svg b/docs/test_cases/t00057_class_mermaid.svg new file mode 100644 index 00000000..64d0b5a8 --- /dev/null +++ b/docs/test_cases/t00057_class_mermaid.svg @@ -0,0 +1,463 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +coordinates + +
+
+
+
+ + + +
+ + +height + +
+
+
+
+ + + +
+ + +a + +
+
+
+
+ + + +
+ + +b + +
+
+
+
+ + + +
+ + +c + +
+
+
+
+ + + +
+ + +d + +
+
+
+
+ + + +
+ + +e + +
+
+
+
+ + + +
+ + +f + +
+
+
+
+ + + +
+ + +g + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ t00057_A +
+
+ +
+ +a1 : int +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ t00057_B +
+
+ +
+ +b1 : int +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ t00057_C +
+
+ +
+ +c1 : int +
+
+
+
+
+ + + + + + + +
+ «union» +
+
+ +
+ t00057_D +
+
+ +
+ +d1 : int +
+
+ +
+ +d2 : float +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ t00057_E +
+
+ +
+ +coordinates : t00057_E::(anonymous_739) +
+
+ +
+ +e : int +
+
+ +
+ +height : t00057_E::(anonymous_807) +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ t00057_E::(coordinates) +
+
+ +
+ +x : int +
+
+ +
+ +y : int +
+
+
+
+
+ + + + + + + +
+ «union» +
+
+ +
+ t00057_E::(height) +
+
+ +
+ +t : double +
+
+ +
+ +z : int +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ t00057_G +
+
+ +
+ +g1 : int +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ t00057_R +
+
+ +
+ +a : struct t00057_A +
+
+ +
+ +b : t00057_B +
+
+ +
+ +c : struct t00057_C +
+
+ +
+ +d : union t00057_D +
+
+ +
+ +e : struct t00057_E +
+
+ +
+ +f : struct t00057_F +
+
+ +
+ +g : struct t00057_G +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ t00057_F +
+
+ +
+ +f1 : int +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00058.md b/docs/test_cases/t00058.md index 29b92be6..70872c16 100644 --- a/docs/test_cases/t00058.md +++ b/docs/test_cases/t00058.md @@ -65,8 +65,10 @@ struct R { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00058_class](./t00058_class.svg "Test case for concepts with variadic parameters and type aliases") +## Generated Mermaid diagrams +![t00058_class](./t00058_class_mermaid.svg "Test case for concepts with variadic parameters and type aliases") ## Generated JSON models ```json { @@ -433,8 +435,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00058_class", diff --git a/docs/test_cases/t00058_class.svg b/docs/test_cases/t00058_class.svg index 3e69b90e..bf2653c7 100644 --- a/docs/test_cases/t00058_class.svg +++ b/docs/test_cases/t00058_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + first_type @@ -19,8 +19,8 @@ - - + + «concept» @@ -30,8 +30,8 @@ - - + + A @@ -40,15 +40,15 @@ - + - + a : std::vector<T> - - + + B @@ -57,22 +57,22 @@ - + - + b : std::vector<T> - + - + bb : P - - + + A @@ -81,8 +81,8 @@ - - + + A @@ -91,8 +91,8 @@ - - + + B @@ -101,26 +101,26 @@ - - + + R - + - + aa : A<int,int,double,std::string> - + - + bb : B<int,std::string,int,double,A<int,int>> diff --git a/docs/test_cases/t00058_class_mermaid.svg b/docs/test_cases/t00058_class_mermaid.svg new file mode 100644 index 00000000..ac57cb03 --- /dev/null +++ b/docs/test_cases/t00058_class_mermaid.svg @@ -0,0 +1,325 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + T,Args... + +
+
+
+
+ + + +
+ + T,Args... + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +aa + +
+
+
+
+ + + +
+ + +bb + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ first_type<T,Args...> +
+
+
+
+
+ + + + + + + +
+ «concept» +
+
+ +
+ same_as_first_type<T,Args...> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<T,Args...> +
+
+ +
+ +a : std::vector<T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<T,P,Args...> +
+
+ +
+ +b : std::vector<T> +
+
+ +
+ +bb : P +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<int,int,double,std::string> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<int,int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B<int,std::string,int,double,A<int,int>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +aa : A<int,int,double,std::string> +
+
+ +
+ +bb : B<int,std::string,int,double,A<int,int>> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00059.md b/docs/test_cases/t00059.md index f00dc70e..ac9b31fb 100644 --- a/docs/test_cases/t00059.md +++ b/docs/test_cases/t00059.md @@ -74,8 +74,10 @@ struct R { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00059_class](./t00059_class.svg "Non-virtual abstract factory pattern using concepts test case") +## Generated Mermaid diagrams +![t00059_class](./t00059_class_mermaid.svg "Non-virtual abstract factory pattern using concepts test case") ## Generated JSON models ```json { @@ -616,7 +618,7 @@ struct R { "line": 52, "translation_unit": "../../tests/t00059/t00059.cc" }, - "type": "clanguml::t00059::fruit_factory_1" + "type": "fruit_factory_1" }, { "access": "public", @@ -628,7 +630,7 @@ struct R { "line": 53, "translation_unit": "../../tests/t00059/t00059.cc" }, - "type": "clanguml::t00059::fruit_factory_2" + "type": "fruit_factory_2" } ], "methods": [], @@ -645,8 +647,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00059_class", diff --git a/docs/test_cases/t00059_class.svg b/docs/test_cases/t00059_class.svg index 2fef6eef..78db0541 100644 --- a/docs/test_cases/t00059_class.svg +++ b/docs/test_cases/t00059_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + «concept» @@ -23,8 +23,8 @@ T{} t.get_name() - - + + «concept» @@ -36,8 +36,8 @@ t.get_sweetness() - - + + «concept» @@ -49,96 +49,96 @@ t.get_bitterness() - - + + gala_apple - + - + get_name() const : std::string - + - + get_sweetness() const : float - - + + empire_apple - + - + get_name() const : std::string - + - + get_sweetness() const : float - - + + lima_orange - + - + get_bitterness() const : float - + - + get_name() const : std::string - - + + valencia_orange - + - + get_bitterness() const : float - + - + get_name() const : std::string - - + + fruit_factory @@ -146,23 +146,23 @@ apple_c TA,orange_c TO - + - + create_apple() const : TA - + - + create_orange() const : TO - - + + fruit_factory @@ -171,8 +171,8 @@ - - + + fruit_factory @@ -181,26 +181,26 @@ - - + + R - + - + factory_1 : fruit_factory_1 - + - + factory_2 : fruit_factory_2 diff --git a/docs/test_cases/t00059_class_mermaid.svg b/docs/test_cases/t00059_class_mermaid.svg new file mode 100644 index 00000000..598de6f5 --- /dev/null +++ b/docs/test_cases/t00059_class_mermaid.svg @@ -0,0 +1,496 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + T + +
+
+
+
+ + + +
+ + T + +
+
+
+
+ + + +
+ + TA + +
+
+
+
+ + + +
+ + TO + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +factory_1 + +
+
+
+
+ + + +
+ + +factory_2 + +
+
+
+
+
+ + + + + + + + +
+ «concept» +
+
+ +
+ fruit_c<T> +
+
+ +
+ "T{}" +
+
+ +
+ "t.get_name()" +
+
+ +
+ "(T t)" +
+
+
+
+
+ + + + + + + +
+ «concept» +
+
+ +
+ apple_c<T> +
+
+ +
+ "t.get_sweetness()" +
+
+ +
+ "(T t)" +
+
+
+
+
+ + + + + + + +
+ «concept» +
+
+ +
+ orange_c<T> +
+
+ +
+ "t.get_bitterness()" +
+
+ +
+ "(T t)" +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ gala_apple +
+
+ +
+ +get_name() : std::string +
+
+ +
+ +get_sweetness() : float +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ empire_apple +
+
+ +
+ +get_name() : std::string +
+
+ +
+ +get_sweetness() : float +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ lima_orange +
+
+ +
+ +get_bitterness() : float +
+
+ +
+ +get_name() : std::string +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ valencia_orange +
+
+ +
+ +get_bitterness() : float +
+
+ +
+ +get_name() : std::string +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ fruit_factory<apple_c TA,orange_c TO> +
+
+ +
+ +create_apple() : TA +
+
+ +
+ +create_orange() : TO +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ fruit_factory<gala_apple,valencia_orange> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ fruit_factory<empire_apple,lima_orange> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +factory_1 : fruit_factory_1 +
+
+ +
+ +factory_2 : fruit_factory_2 +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00060.md b/docs/test_cases/t00060.md index fea43baa..e1fb78b0 100644 --- a/docs/test_cases/t00060.md +++ b/docs/test_cases/t00060.md @@ -41,8 +41,10 @@ template struct H : public G { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00060_class](./t00060_class.svg "Parents (base classes) diagram filter test case") +## Generated Mermaid diagrams +![t00060_class](./t00060_class_mermaid.svg "Parents (base classes) diagram filter test case") ## Generated JSON models ```json { @@ -274,8 +276,8 @@ template struct H : public G { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00060_class", diff --git a/docs/test_cases/t00060_class.svg b/docs/test_cases/t00060_class.svg index d3882529..1e463841 100644 --- a/docs/test_cases/t00060_class.svg +++ b/docs/test_cases/t00060_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + D - - + + G @@ -51,15 +51,15 @@ - + - + g : T - - + + H @@ -68,18 +68,18 @@ - + - + h : G<T> - + - + hh : P diff --git a/docs/test_cases/t00060_class_mermaid.svg b/docs/test_cases/t00060_class_mermaid.svg new file mode 100644 index 00000000..695cc8e3 --- /dev/null +++ b/docs/test_cases/t00060_class_mermaid.svg @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +h + +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ G<T> +
+
+ +
+ +g : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ H<T,P> +
+
+ +
+ +h : G<T> +
+
+ +
+ +hh : P +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00061.md b/docs/test_cases/t00061.md index 5a1b99f6..1b36841c 100644 --- a/docs/test_cases/t00061.md +++ b/docs/test_cases/t00061.md @@ -32,8 +32,10 @@ struct C { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00061_class](./t00061_class.svg "Paths diagram filter test case") +## Generated Mermaid diagrams +![t00061_class](./t00061_class_mermaid.svg "Paths diagram filter test case") ## Generated JSON models ```json { @@ -63,8 +65,8 @@ struct C { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00061_class", diff --git a/docs/test_cases/t00061_class.svg b/docs/test_cases/t00061_class.svg index 1967491b..d774201d 100644 --- a/docs/test_cases/t00061_class.svg +++ b/docs/test_cases/t00061_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A diff --git a/docs/test_cases/t00061_class_mermaid.svg b/docs/test_cases/t00061_class_mermaid.svg new file mode 100644 index 00000000..391fd60b --- /dev/null +++ b/docs/test_cases/t00061_class_mermaid.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00062.md b/docs/test_cases/t00062.md index 33e3bed7..1ed843b8 100644 --- a/docs/test_cases/t00062.md +++ b/docs/test_cases/t00062.md @@ -122,8 +122,10 @@ struct A> { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00062_class](./t00062_class.svg "Template specialization matching based on deduced context") +## Generated Mermaid diagrams +![t00062_class](./t00062_class_mermaid.svg "Template specialization matching based on deduced context") ## Generated JSON models ```json { @@ -1370,8 +1372,8 @@ struct A> { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00062_class", diff --git a/docs/test_cases/t00062_class.svg b/docs/test_cases/t00062_class.svg index f66b5981..ab0031a9 100644 --- a/docs/test_cases/t00062_class.svg +++ b/docs/test_cases/t00062_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,15 +19,15 @@ - + - + u : U & - - + + A @@ -36,15 +36,15 @@ - + - + u : U & - - + + A @@ -53,8 +53,8 @@ - - + + A @@ -63,15 +63,15 @@ - + - + u : U ** - - + + A @@ -80,15 +80,15 @@ - + - + u : U *** - - + + A @@ -97,15 +97,15 @@ - + - + u : U *** - - + + A @@ -114,15 +114,15 @@ - + - + u : U && - - + + A @@ -131,15 +131,15 @@ - + - + u : const U & - - + + A @@ -148,22 +148,22 @@ - + - + c : C & - + - + m : M C::* - - + + A @@ -172,22 +172,22 @@ - + - + c : C && - + - + m : M C::* - - + + A @@ -196,22 +196,22 @@ - + - + c : C & - + - + m : M C::* - - + + A @@ -220,15 +220,15 @@ - + - + c : C & - - + + A @@ -237,22 +237,22 @@ - + - + c : C && - + - + m : M C::* - - + + A @@ -261,22 +261,22 @@ - + - + c : C && - + - + mf : float C::* - - + + A @@ -285,22 +285,22 @@ - + - + c : C & - + - + m : M C::* - - + + A @@ -309,15 +309,15 @@ - + - + n : char[N] - - + + A @@ -326,15 +326,15 @@ - + - + n : std::vector<char> - - + + A @@ -343,15 +343,15 @@ - + - + klm : char[K][L][M] - - + + A @@ -360,15 +360,15 @@ - + - + u : bool - - + + A @@ -377,15 +377,15 @@ - + - + c : C<T> - - + + A @@ -394,22 +394,22 @@ - + - + args : std::tuple<Args...> - + - + c : C<T> - - + + A diff --git a/docs/test_cases/t00062_class_mermaid.svg b/docs/test_cases/t00062_class_mermaid.svg new file mode 100644 index 00000000..77bd43c5 --- /dev/null +++ b/docs/test_cases/t00062_class_mermaid.svg @@ -0,0 +1,823 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ A<U &> +
+
+ +
+ +u : U & +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<std::map<std::string,U> &> +
+
+ +
+ +u : U & +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<std::map<std::string,std::map<std::string,std::string>> &> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<U * *> +
+
+ +
+ +u : U * +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<U * * const*> +
+
+ +
+ +u : U ** +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<U const volatile* const volatile> +
+
+ +
+ +u : U ** +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<U &&> +
+
+ +
+ +u : U && +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<U const&> +
+
+ +
+ +u : const U & +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<M C::*> +
+
+ +
+ +c : C & +
+
+ +
+ +m : M C:: +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<M C::* &&> +
+
+ +
+ +c : C && +
+
+ +
+ +m : M C:: +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<M (C::*)(Arg)> +
+
+ +
+ +c : C & +
+
+ +
+ +m : M C:: +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<int (C::*)(bool)> +
+
+ +
+ +c : C & +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<M (C::*)(Arg) &&> +
+
+ +
+ +c : C && +
+
+ +
+ +m : M C:: +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<float (C::*)(int) &&> +
+
+ +
+ +c : C && +
+
+ +
+ +mf : float C:: +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<M (C::*)(Arg1,Arg2,Arg3)> +
+
+ +
+ +c : C & +
+
+ +
+ +m : M C:: +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<char[N]> +
+
+ +
+ +n : char[N] +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<char[1000]> +
+
+ +
+ +n : std::vector<char> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<char[M][L][K]> +
+
+ +
+ +klm : char[K][L][M] +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<U(...)> +
+
+ +
+ +u : bool +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<C<T>> +
+
+ +
+ +c : C<T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<C<T,Args...>> +
+
+ +
+ +args : std::tuple<Args...> +
+
+ +
+ +c : C<T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A<T> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00063.md b/docs/test_cases/t00063.md index 3cfd7028..53fbd872 100644 --- a/docs/test_cases/t00063.md +++ b/docs/test_cases/t00063.md @@ -30,8 +30,10 @@ enum class C { c1, c2, c3 }; } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00063_class](./t00063_class.svg "Element types diagram filter test case") +## Generated Mermaid diagrams +![t00063_class](./t00063_class_mermaid.svg "Element types diagram filter test case") ## Generated JSON models ```json { @@ -61,8 +63,8 @@ enum class C { c1, c2, c3 }; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00063_class", diff --git a/docs/test_cases/t00063_class.svg b/docs/test_cases/t00063_class.svg index 628a990e..245aa97b 100644 --- a/docs/test_cases/t00063_class.svg +++ b/docs/test_cases/t00063_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A diff --git a/docs/test_cases/t00063_class_mermaid.svg b/docs/test_cases/t00063_class_mermaid.svg new file mode 100644 index 00000000..2d231a62 --- /dev/null +++ b/docs/test_cases/t00063_class_mermaid.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00064.md b/docs/test_cases/t00064.md index 8a632325..a1dcf8f9 100644 --- a/docs/test_cases/t00064.md +++ b/docs/test_cases/t00064.md @@ -82,8 +82,10 @@ public: } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00064_class](./t00064_class.svg "Template type list test case") +## Generated Mermaid diagrams +![t00064_class](./t00064_class_mermaid.svg "Template type list test case") ## Generated JSON models ```json { @@ -553,7 +555,7 @@ public: "line": 46, "translation_unit": "../../tests/t00064/t00064.cc" }, - "type": "value_type const*" + "type": "const value_type *" }, { "access": "public", @@ -574,7 +576,7 @@ public: "parameters": [ { "name": "v", - "type": "value_type const&" + "type": "const value_type &" } ], "source_location": { @@ -900,7 +902,7 @@ public: "line": 57, "translation_unit": "../../tests/t00064/t00064.cc" }, - "type": "type_list" + "type": "type_list" }, { "access": "public", @@ -912,7 +914,7 @@ public: "line": 58, "translation_unit": "../../tests/t00064/t00064.cc" }, - "type": "type_group_pair,type_list>" + "type": "type_group_pair,type_list>" } ], "methods": [], @@ -1034,8 +1036,8 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00064_class", diff --git a/docs/test_cases/t00064_class.svg b/docs/test_cases/t00064_class.svg index 89406df6..330d236b 100644 --- a/docs/test_cases/t00064_class.svg +++ b/docs/test_cases/t00064_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + type_list @@ -19,8 +19,8 @@ - - + + type_list @@ -29,8 +29,8 @@ - - + + type_list @@ -39,8 +39,8 @@ - - + + type_list @@ -49,8 +49,8 @@ - - + + head @@ -59,8 +59,8 @@ - - + + type_list @@ -69,8 +69,8 @@ - - + + type_list @@ -79,8 +79,8 @@ - - + + type_list @@ -89,8 +89,8 @@ - - + + type_group_pair @@ -99,15 +99,15 @@ - + - + size : const size_t - - + + optional_ref @@ -116,8 +116,8 @@ - - + + optional_ref @@ -126,8 +126,8 @@ - - + + type_group_pair_it @@ -135,54 +135,54 @@ It,type_list<First...>,type_list<Second...> - + - - find(value_type const& v) constexpr : unsigned int + + find(const value_type & v) constexpr : unsigned int - + - + get(unsigned int i) : ref_t - + - - getp(unsigned int i) : value_type const* + + getp(unsigned int i) : const value_type * - - + + A - - + + B - - + + C - - + + type_list @@ -191,8 +191,8 @@ - - + + type_list @@ -201,8 +201,8 @@ - - + + type_list @@ -211,8 +211,8 @@ - - + + type_group_pair @@ -221,30 +221,30 @@ - - + + R - + - + abc : type_group_pair<type_list<float,double>,type_list<A,B,C>> - + - + aboolint : type_list<A,bool,int> - - + + type_group_pair @@ -253,8 +253,8 @@ - - + + type_group_pair_it @@ -263,8 +263,8 @@ - - + + head diff --git a/docs/test_cases/t00064_class_mermaid.svg b/docs/test_cases/t00064_class_mermaid.svg new file mode 100644 index 00000000..298d8a14 --- /dev/null +++ b/docs/test_cases/t00064_class_mermaid.svg @@ -0,0 +1,811 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +aboolint + +
+
+
+
+ + + +
+ + +abc + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ type_list<Ts...> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_list<Ret(Arg &&),Ts...> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_list<T const,Ts...> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_list<Head,Tail...> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ head<type_list<Head,Tail...>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_list<Type...> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_list<First...> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_list<Second...> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_group_pair<type_list<First...>,type_list<Second...>> +
+
+ +
+ -size : const size_t +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ optional_ref<T> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ optional_ref<type_group_pair_it<It,type_list<First...>,type_list<Second...>>::value_type> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_group_pair_it<It,type_list<First...>,type_list<Second...>> +
+
+ +
+ +find(const value_type & v) : unsigned int +
+
+ +
+ +get(unsigned int i) : ref_t +
+
+ +
+ +getp(unsigned int i) : const value_type +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_list<A,bool,int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_list<float,double> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_list<A,B,C> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_group_pair<type_list<float,double>,type_list<A,B,C>> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +abc : type_group_pair<type_list<float,double>,type_list<A,B,C>> +
+
+ +
+ +aboolint : type_list<A,bool,int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_group_pair<typename,typename> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ type_group_pair_it<typename,typename,typename> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ head<typename> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00065.md b/docs/test_cases/t00065.md index cc219cf9..436d083e 100644 --- a/docs/test_cases/t00065.md +++ b/docs/test_cases/t00065.md @@ -33,8 +33,10 @@ struct R { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00065_class](./t00065_class.svg "Class diagram with packages from directory structure") +## Generated Mermaid diagrams +![t00065_class](./t00065_class_mermaid.svg "Class diagram with packages from directory structure") ## Generated JSON models ```json { @@ -130,7 +132,7 @@ struct R { "line": 13, "translation_unit": "../../clang-uml/tests/t00065/t00065.cc" }, - "type": "clanguml::t00065::ABC" + "type": "ABC" }, { "access": "public", @@ -142,7 +144,7 @@ struct R { "line": 14, "translation_unit": "../../clang-uml/tests/t00065/t00065.cc" }, - "type": "clanguml::t00065::XYZ" + "type": "XYZ" }, { "access": "public", @@ -486,7 +488,7 @@ struct R { "line": 7, "translation_unit": "../../clang-uml/tests/t00065/t00065.cc" }, - "type": "clanguml::t00065::A *" + "type": "A *" }, { "access": "public", @@ -498,7 +500,7 @@ struct R { "line": 8, "translation_unit": "../../clang-uml/tests/t00065/t00065.cc" }, - "type": "C" + "type": "C
" }, { "access": "public", @@ -510,7 +512,7 @@ struct R { "line": 9, "translation_unit": "../../clang-uml/tests/t00065/t00065.cc" }, - "type": "D" + "type": "D" } ], "methods": [], @@ -527,8 +529,8 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00065_class", diff --git a/docs/test_cases/t00065_class.svg b/docs/test_cases/t00065_class.svg index b20b34e7..f67bdc18 100644 --- a/docs/test_cases/t00065_class.svg +++ b/docs/test_cases/t00065_class.svg @@ -1,6 +1,6 @@ - + @@ -9,20 +9,20 @@ - + module1 - + submodule1a - + module2 - + concepts - - + + ABC @@ -32,8 +32,8 @@ c - - + + XYZ @@ -43,68 +43,68 @@ z - - + + A - + - + abc : ABC - + - + pimpl : detail::AImpl * - + - + xyz : XYZ - - + + AImpl - - + + B - + - + B() = default : void - + - + b() : void - - + + C @@ -113,15 +113,15 @@ - + - + t : T * - - + + C @@ -130,8 +130,8 @@ - - + + D @@ -140,22 +140,22 @@ - + - + c : C<int> - + - + t : T - - + + C @@ -164,8 +164,8 @@ - - + + D @@ -174,8 +174,8 @@ - - + + «concept» @@ -186,33 +186,33 @@ T{} t.b() - - + + R - + - + a : A * - + - + c : C<B> - + - + d : D<B> diff --git a/docs/test_cases/t00065_class_mermaid.svg b/docs/test_cases/t00065_class_mermaid.svg new file mode 100644 index 00000000..ab12010b --- /dev/null +++ b/docs/test_cases/t00065_class_mermaid.svg @@ -0,0 +1,534 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +abc + +
+
+
+
+ + + +
+ + +xyz + +
+
+
+
+ + + +
+ + +pimpl + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + T + +
+
+
+
+ + + +
+ + +c + +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ + +a + +
+
+
+
+ + + +
+ + +c + +
+
+
+
+ + + +
+ + +d + +
+
+
+
+
+ + + + + + + + +
+ +
+
+ +
+ detail::AImpl +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ ABC +
+
+ +
+ a +
+
+ +
+ b +
+
+ +
+ c +
+
+
+
+
+ + + + + + + +
+ «Enumeration» +
+
+ +
+ XYZ +
+
+ +
+ x +
+
+ +
+ y +
+
+ +
+ z +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ +abc : ABC +
+
+ +
+ +pimpl : detail::AImpl +
+
+ +
+ +xyz : XYZ +
+
+
+
+
+ + + + + + + +
+ «concept» +
+
+ +
+ bconcept<T> +
+
+ +
+ "T{}" +
+
+ +
+ "t.b()" +
+
+ +
+ "(T t)" +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ B +
+
+ +
+ +B() : void +
+
+ +
+ +b() : void +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<T> +
+
+ +
+ +t : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<int> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D<bconcept T> +
+
+ +
+ +c : C<int> +
+
+ +
+ +t : T +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ C<B> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ D<B> +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ R +
+
+ +
+ +a : A +
+
+ +
+ +c : C<B> +
+
+ +
+ +d : D<B> +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00066.md b/docs/test_cases/t00066.md index a1a1ce84..7fdca228 100644 --- a/docs/test_cases/t00066.md +++ b/docs/test_cases/t00066.md @@ -89,8 +89,10 @@ int A::static_int = 1; } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00066_class](./t00066_class.svg "Class fields and methods without grouping and sorting") +## Generated Mermaid diagrams +![t00066_class](./t00066_class_mermaid.svg "Class fields and methods without grouping and sorting") ## Generated JSON models ```json { @@ -302,7 +304,7 @@ int A::static_int = 1; "parameters": [ { "name": "", - "type": "clanguml::t00066::A &&" + "type": "A &&" } ], "source_location": { @@ -332,7 +334,7 @@ int A::static_int = 1; "parameters": [ { "name": "", - "type": "const clanguml::t00066::A &" + "type": "const A &" } ], "source_location": { @@ -491,7 +493,7 @@ int A::static_int = 1; "line": 23, "translation_unit": "../../tests/t00066/t00066.cc" }, - "type": "clanguml::t00066::A &" + "type": "A &" }, { "access": "public", @@ -512,7 +514,7 @@ int A::static_int = 1; "parameters": [ { "name": "other", - "type": "clanguml::t00066::A &&" + "type": "A &&" } ], "source_location": { @@ -521,7 +523,7 @@ int A::static_int = 1; "line": 29, "translation_unit": "../../tests/t00066/t00066.cc" }, - "type": "clanguml::t00066::A &" + "type": "A &" }, { "access": "public", @@ -542,7 +544,7 @@ int A::static_int = 1; "parameters": [ { "name": "other", - "type": "clanguml::t00066::A &" + "type": "A &" } ], "source_location": { @@ -551,7 +553,7 @@ int A::static_int = 1; "line": 30, "translation_unit": "../../tests/t00066/t00066.cc" }, - "type": "clanguml::t00066::A &" + "type": "A &" }, { "access": "public", @@ -736,7 +738,7 @@ int A::static_int = 1; "line": 43, "translation_unit": "../../tests/t00066/t00066.cc" }, - "type": "clanguml::t00066::A" + "type": "A" }, { "access": "protected", @@ -802,8 +804,8 @@ int A::static_int = 1; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00066_class", diff --git a/docs/test_cases/t00066_class.svg b/docs/test_cases/t00066_class.svg index 04a6dda2..2cb5241a 100644 --- a/docs/test_cases/t00066_class.svg +++ b/docs/test_cases/t00066_class.svg @@ -1,6 +1,6 @@ - + @@ -9,222 +9,222 @@ - - + + A - + - + public_member : int - + - + protected_member : int - + - + private_member : int - + - + a_ : int - + - + b_ : int - + - + c_ : int - + - + static_int : int - + - + static_const_int : const int - + - + auto_member : const unsigned long - + - + A() = default : void - + - + A(int i) : void - + - + A(A &&) = default : void - + - + A(const A &) = deleted : void - + - + ~A() = default : void - + - + basic_method() : void - + - + static_method() : int - + - + const_method() const : void - + - + auto_method() : int - + - + operator++() : A & - + - + operator=(A && other) noexcept : A & - + - + operator=(A & other) noexcept : A & - + - + size() const : std::size_t - + - + double_int(const int i) : int - + - + sum(const double a, const double b) : int - + - + default_int(int i = 12) : int - + - + default_string(int i, std::string s = "abc") : std::string - + - + create_from_int(int i) : A - + - + protected_method() : void - + - + private_method() : void - + - + compare : std::function<bool (const int)> diff --git a/docs/test_cases/t00066_class_mermaid.svg b/docs/test_cases/t00066_class_mermaid.svg new file mode 100644 index 00000000..562efbe5 --- /dev/null +++ b/docs/test_cases/t00066_class_mermaid.svg @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ +public_member : int +
+
+ +
+ #protected_member : int +
+
+ +
+ #compare : std::function<bool (const int)> +
+
+ +
+ -private_member : int +
+
+ +
+ -a_ : int +
+
+ +
+ -b_ : int +
+
+ +
+ -c_ : int +
+
+ +
+ +static_int : int +
+
+ +
+ +static_const_int : const int +
+
+ +
+ +auto_member : const unsigned long +
+
+ +
+ +A() : void +
+
+ +
+ +A(int i) : void +
+
+ +
+ +A(A &&) : void +
+
+ +
+ +A(const A &) : void +
+
+ +
+ +~A() : void +
+
+ +
+ +basic_method() : void +
+
+ +
+ +static_method() : int +
+
+ +
+ +const_method() : void +
+
+ +
+ +auto_method() : int +
+
+ +
+ +operator++() : A & +
+
+ +
+ +operator=(A && other) : A & +
+
+ +
+ +operator=(A & other) : A & +
+
+ +
+ +size() : std::size_t +
+
+ +
+ +double_int(const int i) : int +
+
+ +
+ +sum(const double a, const double b) : int +
+
+ +
+ +default_int(int i = 12) : int +
+
+ +
+ +default_string(int i, std::string s = "abc") : std::string +
+
+ +
+ +create_from_int(int i) : A +
+
+ +
+ #protected_method() : void +
+
+ +
+ -private_method() : void +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t00067.md b/docs/test_cases/t00067.md index 044dd2a7..d512681a 100644 --- a/docs/test_cases/t00067.md +++ b/docs/test_cases/t00067.md @@ -92,8 +92,10 @@ int A::static_int = 1; } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t00067_class](./t00067_class.svg "Class method type filter test case") +## Generated Mermaid diagrams +![t00067_class](./t00067_class_mermaid.svg "Class method type filter test case") ## Generated JSON models ```json { @@ -525,8 +527,8 @@ int A::static_int = 1; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t00067_class", diff --git a/docs/test_cases/t00067_class.svg b/docs/test_cases/t00067_class.svg index b94b5977..84b32a72 100644 --- a/docs/test_cases/t00067_class.svg +++ b/docs/test_cases/t00067_class.svg @@ -1,6 +1,6 @@ - + @@ -9,152 +9,152 @@ - - + + A - + - + auto_method() : int - + - + basic_method() : void - + - + const_method() const : void - + - + default_int(int i = 12) : int - + - + default_string(int i, std::string s = "abc") : std::string - + - + double_int(const int i) : int - + - + private_method() : void - + - + protected_method() : void - + - + size() const : std::size_t - + - + sum(const double a, const double b) : int - + - + a_ : int - + - + auto_member : const unsigned long - + - + b_ : int - + - + c_ : int - + - + compare : std::function<bool (const int)> - + - + private_member : int - + - + protected_member : int - + - + public_member : int - + - + static_const_int : const int - + - + static_int : int diff --git a/docs/test_cases/t00067_class_mermaid.svg b/docs/test_cases/t00067_class_mermaid.svg new file mode 100644 index 00000000..04a80ad4 --- /dev/null +++ b/docs/test_cases/t00067_class_mermaid.svg @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ A +
+
+ +
+ -a_ : int +
+
+ +
+ +auto_member : const unsigned long +
+
+ +
+ -b_ : int +
+
+ +
+ -c_ : int +
+
+ +
+ #compare : std::function<bool (const int)> +
+
+ +
+ -private_member : int +
+
+ +
+ #protected_member : int +
+
+ +
+ +public_member : int +
+
+ +
+ +static_const_int : const int +
+
+ +
+ +static_int : int +
+
+ +
+ +auto_method() : int +
+
+ +
+ +basic_method() : void +
+
+ +
+ +const_method() : void +
+
+ +
+ +default_int(int i = 12) : int +
+
+ +
+ +default_string(int i, std::string s = "abc") : std::string +
+
+ +
+ +double_int(const int i) : int +
+
+ +
+ -private_method() : void +
+
+ +
+ #protected_method() : void +
+
+ +
+ +size() : std::size_t +
+
+ +
+ +sum(const double a, const double b) : int +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t20001.md b/docs/test_cases/t20001.md index 02d86640..211dd779 100644 --- a/docs/test_cases/t20001.md +++ b/docs/test_cases/t20001.md @@ -101,15 +101,17 @@ int tmain() } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20001_sequence](./t20001_sequence.svg "Basic sequence diagram test case") +## Generated Mermaid diagrams +![t20001_sequence](./t20001_sequence_mermaid.svg "Basic sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20001_sequence", diff --git a/docs/test_cases/t20001_sequence.svg b/docs/test_cases/t20001_sequence.svg index caa78384..69772616 100644 --- a/docs/test_cases/t20001_sequence.svg +++ b/docs/test_cases/t20001_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,73 +9,73 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - - - + + + + + + + + + + A() - + B(A &) - + add(int,int) - + wrap_add3(int,int,int) - + add3(int,int,int) - + @@ -86,7 +86,7 @@ - + @@ -95,14 +95,14 @@ - + log_result(int) - + Main test function diff --git a/docs/test_cases/t20001_sequence_mermaid.svg b/docs/test_cases/t20001_sequence_mermaid.svg new file mode 100644 index 00000000..8f0edbdc --- /dev/null +++ b/docs/test_cases/t20001_sequence_mermaid.svg @@ -0,0 +1,136 @@ + + + + + B + + + + + + A + + + + + + tmain() + + + + + + + + B + + + + + + + + + A + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A() + + B(A &) + + add(int,int) + + ​ + + wrap_add3(int,int,int) + + add3(int,int,int) + + add(int,int) + + ​ + + log_result(int) + + ​ + + log_result(int) + + ​ + + diff --git a/docs/test_cases/t20002.md b/docs/test_cases/t20002.md index 6874730a..4f9c61c0 100644 --- a/docs/test_cases/t20002.md +++ b/docs/test_cases/t20002.md @@ -38,15 +38,17 @@ void m1() { m2(); } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20002_sequence](./t20002_sequence.svg "Free function sequence diagram test case") +## Generated Mermaid diagrams +![t20002_sequence](./t20002_sequence_mermaid.svg "Free function sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20002_sequence", diff --git a/docs/test_cases/t20002_sequence.svg b/docs/test_cases/t20002_sequence.svg index f7df505d..6080168e 100644 --- a/docs/test_cases/t20002_sequence.svg +++ b/docs/test_cases/t20002_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1() - + m1() - - + + m2() - + m2() - - + + m3() - + m3() - - + + m4() - + m4() - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20002_sequence_mermaid.svg b/docs/test_cases/t20002_sequence_mermaid.svg new file mode 100644 index 00000000..b759ec7c --- /dev/null +++ b/docs/test_cases/t20002_sequence_mermaid.svg @@ -0,0 +1,118 @@ + + + + + m4() + + + + + + m3() + + + + + + m2() + + + + + + m1() + + + + + + + + m4() + + + + + + + + + m3() + + + + + + + + + m2() + + + + + + + + + m1() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20003.md b/docs/test_cases/t20003.md index 624e3366..8af703a6 100644 --- a/docs/test_cases/t20003.md +++ b/docs/test_cases/t20003.md @@ -34,15 +34,17 @@ template void m1(T p) { m2(p); } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20003_sequence](./t20003_sequence.svg "Function template sequence diagram test case") +## Generated Mermaid diagrams +![t20003_sequence](./t20003_sequence_mermaid.svg "Function template sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20003_sequence", diff --git a/docs/test_cases/t20003_sequence.svg b/docs/test_cases/t20003_sequence.svg index 66d24598..7c0be285 100644 --- a/docs/test_cases/t20003_sequence.svg +++ b/docs/test_cases/t20003_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1<T>(T) - + m1<T>(T) - - + + m2<T>(T) - + m2<T>(T) - - + + m3<T>(T) - + m3<T>(T) - - + + m4<T>(T) - + m4<T>(T) - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20003_sequence_mermaid.svg b/docs/test_cases/t20003_sequence_mermaid.svg new file mode 100644 index 00000000..a018550c --- /dev/null +++ b/docs/test_cases/t20003_sequence_mermaid.svg @@ -0,0 +1,118 @@ + + + + + m4<T>(T) + + + + + + m3<T>(T) + + + + + + m2<T>(T) + + + + + + m1<T>(T) + + + + + + + + m4<T>(T) + + + + + + + + + m3<T>(T) + + + + + + + + + m2<T>(T) + + + + + + + + + m1<T>(T) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20004.md b/docs/test_cases/t20004.md index 75e7f0af..8da5ead5 100644 --- a/docs/test_cases/t20004.md +++ b/docs/test_cases/t20004.md @@ -70,15 +70,17 @@ int main() } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20004_sequence](./t20004_sequence.svg "Function template instantiation sequence diagram test case") +## Generated Mermaid diagrams +![t20004_sequence](./t20004_sequence_mermaid.svg "Function template instantiation sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20004_sequence", diff --git a/docs/test_cases/t20004_sequence.svg b/docs/test_cases/t20004_sequence.svg index 897d7ff8..5ad0e1e9 100644 --- a/docs/test_cases/t20004_sequence.svg +++ b/docs/test_cases/t20004_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -29,87 +29,87 @@ - - + + main() - + main() - - + + m1<float>(float) - + m1<float>(float) - - + + m1<unsigned long>(unsigned long) - + m1<unsigned long>(unsigned long) - - + + m4<unsigned long>(unsigned long) - + m4<unsigned long>(unsigned long) - - + + m1<std::string>(std::string) - + m1<std::string>(std::string) - - + + m2<std::string>(std::string) - + m2<std::string>(std::string) - - + + m1<int>(int) - + m1<int>(int) - - + + m2<int>(int) - + m2<int>(int) - - + + m3<int>(int) - + m3<int>(int) - - + + m4<int>(int) - + m4<int>(int) - - - - - - - - - - - + + + + + + + + + + + - + - + @@ -117,11 +117,11 @@ - + - + @@ -129,19 +129,19 @@ - + - + - + - + diff --git a/docs/test_cases/t20004_sequence_mermaid.svg b/docs/test_cases/t20004_sequence_mermaid.svg new file mode 100644 index 00000000..6d8e9e91 --- /dev/null +++ b/docs/test_cases/t20004_sequence_mermaid.svg @@ -0,0 +1,256 @@ + + + + + m4<int>(int) + + + + + + m3<int>(int) + + + + + + m2<int>(int) + + + + + + m1<int>(int) + + + + + + m2<std::string>(std::string) + + + + + + m1<std::string>(std::string) + + + + + + m4<unsigned long>(unsigned long) + + + + + + m1<unsigned long>(unsigned long) + + + + + + m1<float>(float) + + + + + + main() + + + + + + + + m4<int>(int) + + + + + + + + + m3<int>(int) + + + + + + + + + m2<int>(int) + + + + + + + + + m1<int>(int) + + + + + + + + + m2<std::string>(std::string) + + + + + + + + + m1<std::string>(std::string) + + + + + + + + + m4<unsigned long>(unsigned long) + + + + + + + + + m1<unsigned long>(unsigned long) + + + + + + + + + m1<float>(float) + + + + + + + + + main() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20005.md b/docs/test_cases/t20005.md index e27f5940..a38c8461 100644 --- a/docs/test_cases/t20005.md +++ b/docs/test_cases/t20005.md @@ -41,15 +41,17 @@ template struct C { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20005_sequence](./t20005_sequence.svg "Class template basic sequence diagram") +## Generated Mermaid diagrams +![t20005_sequence](./t20005_sequence_mermaid.svg "Class template basic sequence diagram") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20005_sequence", diff --git a/docs/test_cases/t20005_sequence.svg b/docs/test_cases/t20005_sequence.svg index 1bacf220..9b5f1ba1 100644 --- a/docs/test_cases/t20005_sequence.svg +++ b/docs/test_cases/t20005_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - + + + - - + + C<T> - + C<T> - - + + B<T> - + B<T> - - + + A<T> - + A<T> - - - + + + c(T) - + b(T) - + a(T) diff --git a/docs/test_cases/t20005_sequence_mermaid.svg b/docs/test_cases/t20005_sequence_mermaid.svg new file mode 100644 index 00000000..8bb98453 --- /dev/null +++ b/docs/test_cases/t20005_sequence_mermaid.svg @@ -0,0 +1,121 @@ + + + + + A<T> + + + + + + B<T> + + + + + + * + + + + + + C<T> + + + + + + + + A<T> + + + + + + + + + B<T> + + + + + + + + + * + + + + + + + + + C<T> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + c(T) + + b(T) + + a(T) + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20006.md b/docs/test_cases/t20006.md index 414fbb69..cd7307bb 100644 --- a/docs/test_cases/t20006.md +++ b/docs/test_cases/t20006.md @@ -99,15 +99,17 @@ void tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20006_sequence](./t20006_sequence.svg "Class template specialization basic sequence diagram") +## Generated Mermaid diagrams +![t20006_sequence](./t20006_sequence_mermaid.svg "Class template specialization basic sequence diagram") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20006_sequence", diff --git a/docs/test_cases/t20006_sequence.svg b/docs/test_cases/t20006_sequence.svg index dcee9252..a43a354f 100644 --- a/docs/test_cases/t20006_sequence.svg +++ b/docs/test_cases/t20006_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,24 +9,24 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -36,84 +36,84 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + BB<int,std::string> - + BB<int,std::string> - - + + BB<int,float> - + BB<int,float> - - + + BB<int,int> - + BB<int,int> - - + + AA<int> - + AA<int> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + b(int) - + a1(int) @@ -122,12 +122,12 @@ - + b(std::string) - + a2(std::string) @@ -136,69 +136,69 @@ - + BB(AA<int> *) - + BB(AA<int> &) - + bb1(int,int) - + aa1(int) - + bb2(int,int) - + aa2(int) - + bb1(int,std::string) - + aa2(int) - + bb2(int,std::string) - + aa1(int) - + bb1(int,float) - + bb2(int,float) - + aa2(int) diff --git a/docs/test_cases/t20006_sequence_mermaid.svg b/docs/test_cases/t20006_sequence_mermaid.svg new file mode 100644 index 00000000..e09f86e5 --- /dev/null +++ b/docs/test_cases/t20006_sequence_mermaid.svg @@ -0,0 +1,271 @@ + + + + + AA<int> + + + + + + BB<int,int> + + + + + + BB<int,float> + + + + + + BB<int,std::string> + + + + + + A<std::string> + + + + + + B<std::string> + + + + + + A<int> + + + + + + B<int> + + + + + + tmain() + + + + + + + + AA<int> + + + + + + + + + BB<int,int> + + + + + + + + + BB<int,float> + + + + + + + + + BB<int,std::string> + + + + + + + + + A<std::string> + + + + + + + + + B<std::string> + + + + + + + + + A<int> + + + + + + + + + B<int> + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + b(int) + + a1(int) + + ​ + + ​ + + b(std::string) + + a2(std::string) + + ​ + + ​ + + BB(AA<int> *) + + BB(AA<int> &) + + bb1(int,int) + + aa1(int) + + bb2(int,int) + + aa2(int) + + bb1(int,std::string) + + aa2(int) + + bb2(int,std::string) + + aa1(int) + + bb1(int,float) + + bb2(int,float) + + aa2(int) + + diff --git a/docs/test_cases/t20007.md b/docs/test_cases/t20007.md index 780cbe69..57060d56 100644 --- a/docs/test_cases/t20007.md +++ b/docs/test_cases/t20007.md @@ -45,15 +45,17 @@ void tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20007_sequence](./t20007_sequence.svg "Class template variadic argument list sequence diagram") +## Generated Mermaid diagrams +![t20007_sequence](./t20007_sequence_mermaid.svg "Class template variadic argument list sequence diagram") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20007_sequence", diff --git a/docs/test_cases/t20007_sequence.svg b/docs/test_cases/t20007_sequence.svg index 54b3f78d..d38bf8db 100644 --- a/docs/test_cases/t20007_sequence.svg +++ b/docs/test_cases/t20007_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,57 +9,57 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + Adder<int,int> - + Adder<int,int> - - + + Adder<int,float,double> - + Adder<int,float,double> - - + + Adder<std::string,std::string,std::string> - + Adder<std::string,std::string,std::string> - - - - - + + + + + add(int &&,int &&) - + add(int &&,float &&,double &&) - + add(std::string &&,std::string &&,std::string &&) diff --git a/docs/test_cases/t20007_sequence_mermaid.svg b/docs/test_cases/t20007_sequence_mermaid.svg new file mode 100644 index 00000000..d41ca006 --- /dev/null +++ b/docs/test_cases/t20007_sequence_mermaid.svg @@ -0,0 +1,124 @@ + + + + + Adder<std::string,std::string,std::string> + + + + + + Adder<int,float,double> + + + + + + Adder<int,int> + + + + + + tmain() + + + + + + + + Adder<std::string,std::string,std::string> + + + + + + + + + Adder<int,float,double> + + + + + + + + + Adder<int,int> + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + add(int &&,int &&) + + ​ + + add(int &&,float &&,double &&) + + ​ + + add(std::string &&,std::string &&,std::string &&) + + ​ + + diff --git a/docs/test_cases/t20008.md b/docs/test_cases/t20008.md index 4878842d..e2746d2c 100644 --- a/docs/test_cases/t20008.md +++ b/docs/test_cases/t20008.md @@ -63,15 +63,17 @@ void tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20008_sequence](./t20008_sequence.svg "Constexpr if sequence diagram test case") +## Generated Mermaid diagrams +![t20008_sequence](./t20008_sequence_mermaid.svg "Constexpr if sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20008_sequence", diff --git a/docs/test_cases/t20008_sequence.svg b/docs/test_cases/t20008_sequence.svg index 6eff851e..19251b4e 100644 --- a/docs/test_cases/t20008_sequence.svg +++ b/docs/test_cases/t20008_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<const char *> - + B<const char *> - - + + A<const char *> - + A<const char *> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - - - - - - - + + + + + + + + b(int) - + a1(int) - + b(const char *) - + a2(const char *) - + b(std::string) - + a3(std::string) diff --git a/docs/test_cases/t20008_sequence_mermaid.svg b/docs/test_cases/t20008_sequence_mermaid.svg new file mode 100644 index 00000000..17aaaa5d --- /dev/null +++ b/docs/test_cases/t20008_sequence_mermaid.svg @@ -0,0 +1,178 @@ + + + + + A<std::string> + + + + + + B<std::string> + + + + + + A<const char *> + + + + + + B<const char *> + + + + + + A<int> + + + + + + B<int> + + + + + + tmain() + + + + + + + + A<std::string> + + + + + + + + + B<std::string> + + + + + + + + + A<const char *> + + + + + + + + + B<const char *> + + + + + + + + + A<int> + + + + + + + + + B<int> + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + b(int) + + a1(int) + + b(const char *) + + a2(const char *) + + b(std::string) + + a3(std::string) + + diff --git a/docs/test_cases/t20009.md b/docs/test_cases/t20009.md index 2194e5df..03d133dc 100644 --- a/docs/test_cases/t20009.md +++ b/docs/test_cases/t20009.md @@ -49,15 +49,17 @@ void tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20009_sequence](./t20009_sequence.svg "Smart pointer dereference call expression test case") +## Generated Mermaid diagrams +![t20009_sequence](./t20009_sequence_mermaid.svg "Smart pointer dereference call expression test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20009_sequence", diff --git a/docs/test_cases/t20009_sequence.svg b/docs/test_cases/t20009_sequence.svg index 127ce789..d76e4fd7 100644 --- a/docs/test_cases/t20009_sequence.svg +++ b/docs/test_cases/t20009_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<float> - + B<float> - - + + A<float> - + A<float> - - - - - - - - + + + + + + + + b(std::string) - + a(std::string) - + b(int) - + a(int) - + b(float) - + a(float) diff --git a/docs/test_cases/t20009_sequence_mermaid.svg b/docs/test_cases/t20009_sequence_mermaid.svg new file mode 100644 index 00000000..5ce7e173 --- /dev/null +++ b/docs/test_cases/t20009_sequence_mermaid.svg @@ -0,0 +1,178 @@ + + + + + A<float> + + + + + + B<float> + + + + + + A<int> + + + + + + B<int> + + + + + + A<std::string> + + + + + + B<std::string> + + + + + + tmain() + + + + + + + + A<float> + + + + + + + + + B<float> + + + + + + + + + A<int> + + + + + + + + + B<int> + + + + + + + + + A<std::string> + + + + + + + + + B<std::string> + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + b(std::string) + + a(std::string) + + b(int) + + a(int) + + b(float) + + a(float) + + diff --git a/docs/test_cases/t20010.md b/docs/test_cases/t20010.md index a67bff8b..bdb62839 100644 --- a/docs/test_cases/t20010.md +++ b/docs/test_cases/t20010.md @@ -59,15 +59,17 @@ void tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20010_sequence](./t20010_sequence.svg "Container sequence diagram test case") +## Generated Mermaid diagrams +![t20010_sequence](./t20010_sequence_mermaid.svg "Container sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20010_sequence", diff --git a/docs/test_cases/t20010_sequence.svg b/docs/test_cases/t20010_sequence.svg index b265ac5f..0b553367 100644 --- a/docs/test_cases/t20010_sequence.svg +++ b/docs/test_cases/t20010_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,81 +9,81 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A - + A - - - - - - - - - - + + + + + + + + + + b1() - + a1() - + b2() - + a2() - + b3() - + a3() - + b4() - + a4() diff --git a/docs/test_cases/t20010_sequence_mermaid.svg b/docs/test_cases/t20010_sequence_mermaid.svg new file mode 100644 index 00000000..b3a99f04 --- /dev/null +++ b/docs/test_cases/t20010_sequence_mermaid.svg @@ -0,0 +1,128 @@ + + + + + A + + + + + + B<int> + + + + + + tmain() + + + + + + + + A + + + + + + + + + B<int> + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + b1() + + a1() + + b2() + + a2() + + b3() + + a3() + + b4() + + a4() + + diff --git a/docs/test_cases/t20011.md b/docs/test_cases/t20011.md index 84feb92e..0681cea1 100644 --- a/docs/test_cases/t20011.md +++ b/docs/test_cases/t20011.md @@ -51,15 +51,17 @@ void tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20011_sequence](./t20011_sequence.svg "Recursive calls sequence diagram test case") +## Generated Mermaid diagrams +![t20011_sequence](./t20011_sequence_mermaid.svg "Recursive calls sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20011_sequence", diff --git a/docs/test_cases/t20011_sequence.svg b/docs/test_cases/t20011_sequence.svg index 1bdeb089..5508fc56 100644 --- a/docs/test_cases/t20011_sequence.svg +++ b/docs/test_cases/t20011_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - - - - + + + + + + + + + + a(int) @@ -52,26 +52,26 @@ alt - + a(int) - + b(int) - + c(int) - + @@ -81,14 +81,14 @@ alt - + b(int) - + @@ -98,7 +98,7 @@ alt - + diff --git a/docs/test_cases/t20011_sequence_mermaid.svg b/docs/test_cases/t20011_sequence_mermaid.svg new file mode 100644 index 00000000..b9e6399d --- /dev/null +++ b/docs/test_cases/t20011_sequence_mermaid.svg @@ -0,0 +1,146 @@ + + + + + A + + + + + + tmain() + + + + + + + + A + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + alt + + ​ + + + + + + + + + + + + + + + + + + + + + + + + + + + alt + + ​ + + + + + + + + + alt + + ​ + + + a(int) + + a(int) + + b(int) + + c(int) + + d(int) + + b(int) + + a(int) + + a(int) + + diff --git a/docs/test_cases/t20012.md b/docs/test_cases/t20012.md index 65999936..e1728140 100644 --- a/docs/test_cases/t20012.md +++ b/docs/test_cases/t20012.md @@ -126,15 +126,17 @@ void tmain() } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20012_sequence](./t20012_sequence.svg "Lambda expression call sequence diagram test case") +## Generated Mermaid diagrams +![t20012_sequence](./t20012_sequence_mermaid.svg "Lambda expression call sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20012_sequence", diff --git a/docs/test_cases/t20012_sequence.svg b/docs/test_cases/t20012_sequence.svg index 2d04ffd2..a05ce0fe 100644 --- a/docs/test_cases/t20012_sequence.svg +++ b/docs/test_cases/t20012_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,31 +9,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -42,116 +42,116 @@ - - + + tmain() - + tmain() - - + + tmain()::(lambda ../../tests/t20012/t20012.cc:67:20) - + tmain()::(lambda ../../tests/t20012/t20012.cc:67:20) - - + + A - + A - - + + B - + B - - + + tmain()::(lambda ../../tests/t20012/t20012.cc:80:20) - + tmain()::(lambda ../../tests/t20012/t20012.cc:80:20) - - + + C - + C - - + + R<R::(lambda ../../tests/t20012/t20012.cc:86:9)> - + R<R::(lambda ../../tests/t20012/t20012.cc:86:9)> - - + + tmain()::(lambda ../../tests/t20012/t20012.cc:86:9) - + tmain()::(lambda ../../tests/t20012/t20012.cc:86:9) - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -160,67 +160,67 @@ - + operator()() - + c() - + cc() - + ccc() - + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -231,34 +231,34 @@ - + R((lambda at /home/bartek/devel/clang-uml/tests/t20012/t20012.cc:86:9) &&) - + r() - + operator()() - + c() - + cc() - + diff --git a/docs/test_cases/t20012_sequence_mermaid.svg b/docs/test_cases/t20012_sequence_mermaid.svg new file mode 100644 index 00000000..153b3b84 --- /dev/null +++ b/docs/test_cases/t20012_sequence_mermaid.svg @@ -0,0 +1,291 @@ + + + + + tmain()::(lambda ../../tests/t20012/t20012.cc:86:9) + + + + + + R<R::(lambda ../../tests/t20012/t20012.cc:86:9)> + + + + + + C + + + + + + tmain()::(lambda ../../tests/t20012/t20012.cc:80:20) + + + + + + B + + + + + + A + + + + + + tmain()::(lambda ../../tests/t20012/t20012.cc:67:20) + + + + + + tmain() + + + + + + + + tmain()::(lambda ../../tests/t20012/t20012.cc:86:9) + + + + + + + + + R<R::(lambda ../../tests/t20012/t20012.cc:86:9)> + + + + + + + + + C + + + + + + + + + tmain()::(lambda ../../tests/t20012/t20012.cc:80:20) + + + + + + + + + B + + + + + + + + + A + + + + + + + + + tmain()::(lambda ../../tests/t20012/t20012.cc:67:20) + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + operator()() + + a() + + aa() + + aaa() + + b() + + bb() + + bbb() + + ​ + + operator()() + + c() + + cc() + + ccc() + + operator()() + + a() + + aa() + + aaa() + + b() + + bb() + + bbb() + + ​ + + ​ + + R((lambda at /home/bartek/devel/clang-uml/tests/t20012/t20012.cc:86:9) &&) + + r() + + operator()() + + c() + + cc() + + ccc() + + ​ + + diff --git a/docs/test_cases/t20013.md b/docs/test_cases/t20013.md index f5ac0dc6..ac6f5c3e 100644 --- a/docs/test_cases/t20013.md +++ b/docs/test_cases/t20013.md @@ -47,15 +47,17 @@ void tmain(int argc, char **argv) } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20013_sequence](./t20013_sequence.svg "Function and method arguments in sequence diagrams test case") +## Generated Mermaid diagrams +![t20013_sequence](./t20013_sequence_mermaid.svg "Function and method arguments in sequence diagrams test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20013_sequence", diff --git a/docs/test_cases/t20013_sequence.svg b/docs/test_cases/t20013_sequence.svg index 5468e948..e2d0bf59 100644 --- a/docs/test_cases/t20013_sequence.svg +++ b/docs/test_cases/t20013_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - - - - + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + B - + B - - + + A - + A - - - - - - - - + + + + + + + + b(int) - + a1(int) @@ -58,12 +58,12 @@ - + b(double) - + a2(double) @@ -72,12 +72,12 @@ - + b(const char *) - + a3(const char *) diff --git a/docs/test_cases/t20013_sequence_mermaid.svg b/docs/test_cases/t20013_sequence_mermaid.svg new file mode 100644 index 00000000..06076e9a --- /dev/null +++ b/docs/test_cases/t20013_sequence_mermaid.svg @@ -0,0 +1,130 @@ + + + + + A + + + + + + B + + + + + + tmain(int,char **) + + + + + + + + A + + + + + + + + + B + + + + + + + + + tmain(int,char **) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + b(int) + + a1(int) + + ​ + + ​ + + b(double) + + a2(double) + + ​ + + ​ + + b(const char *) + + a3(const char *) + + ​ + + ​ + + diff --git a/docs/test_cases/t20014.md b/docs/test_cases/t20014.md index 6beb752b..1e6dd4bd 100644 --- a/docs/test_cases/t20014.md +++ b/docs/test_cases/t20014.md @@ -82,15 +82,17 @@ namespace t20014 { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20014_sequence](./t20014_sequence.svg "Multiple translation units sequence diagram test case") +## Generated Mermaid diagrams +![t20014_sequence](./t20014_sequence_mermaid.svg "Multiple translation units sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20014_sequence", diff --git a/docs/test_cases/t20014_sequence.svg b/docs/test_cases/t20014_sequence.svg index 22ac1fdb..915a1ef4 100644 --- a/docs/test_cases/t20014_sequence.svg +++ b/docs/test_cases/t20014_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - - - - - - - + + + + + + + + - - + + tmain() - + tmain() - - + + B - + B - - + + A - + A - - + + C<B,int> - + C<B,int> - - - - - - - - - + + + + + + + + + b1(int,int) - + a1(int,int) @@ -67,12 +67,12 @@ - + b2(int,int) - + a2(int,int) @@ -81,17 +81,17 @@ - + c1(int,int) - + b1(int,int) - + a1(int,int) diff --git a/docs/test_cases/t20014_sequence_mermaid.svg b/docs/test_cases/t20014_sequence_mermaid.svg new file mode 100644 index 00000000..96fa12c5 --- /dev/null +++ b/docs/test_cases/t20014_sequence_mermaid.svg @@ -0,0 +1,152 @@ + + + + + C<B,int> + + + + + + A + + + + + + B + + + + + + tmain() + + + + + + + + C<B,int> + + + + + + + + + A + + + + + + + + + B + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + b1(int,int) + + a1(int,int) + + ​ + + ​ + + b2(int,int) + + a2(int,int) + + ​ + + ​ + + c1(int,int) + + b1(int,int) + + a1(int,int) + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20015.md b/docs/test_cases/t20015.md index 95567135..ad9c62fb 100644 --- a/docs/test_cases/t20015.md +++ b/docs/test_cases/t20015.md @@ -63,15 +63,17 @@ void tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20015_sequence](./t20015_sequence.svg "Class exclusion by namespace in sequence diagram test case") +## Generated Mermaid diagrams +![t20015_sequence](./t20015_sequence_mermaid.svg "Class exclusion by namespace in sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20015_sequence", diff --git a/docs/test_cases/t20015_sequence.svg b/docs/test_cases/t20015_sequence.svg index e86e1b3e..207eded8 100644 --- a/docs/test_cases/t20015_sequence.svg +++ b/docs/test_cases/t20015_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + B - + B - - - + + + setup_a(std::shared_ptr<detail::A> &) diff --git a/docs/test_cases/t20015_sequence_mermaid.svg b/docs/test_cases/t20015_sequence_mermaid.svg new file mode 100644 index 00000000..6091c2ba --- /dev/null +++ b/docs/test_cases/t20015_sequence_mermaid.svg @@ -0,0 +1,78 @@ + + + + + B + + + + + + tmain() + + + + + + + + B + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + setup_a(std::shared_ptr<detail::A> &) + + diff --git a/docs/test_cases/t20016.md b/docs/test_cases/t20016.md index adc8285d..ed19dbf0 100644 --- a/docs/test_cases/t20016.md +++ b/docs/test_cases/t20016.md @@ -45,15 +45,17 @@ void tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20016_sequence](./t20016_sequence.svg "Template method specialization sequence diagram test case") +## Generated Mermaid diagrams +![t20016_sequence](./t20016_sequence_mermaid.svg "Template method specialization sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20016_sequence", diff --git a/docs/test_cases/t20016_sequence.svg b/docs/test_cases/t20016_sequence.svg index 7d1498ea..7b3e03b3 100644 --- a/docs/test_cases/t20016_sequence.svg +++ b/docs/test_cases/t20016_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - - - - + + + + + - - + + tmain() - + tmain() - - + + B<long> - + B<long> - - + + A - + A - - - - - - + + + + + + b1(long) - + a1(int) - + b2(long) - + a2(const long &) diff --git a/docs/test_cases/t20016_sequence_mermaid.svg b/docs/test_cases/t20016_sequence_mermaid.svg new file mode 100644 index 00000000..d3ae9e04 --- /dev/null +++ b/docs/test_cases/t20016_sequence_mermaid.svg @@ -0,0 +1,112 @@ + + + + + A + + + + + + B<long> + + + + + + tmain() + + + + + + + + A + + + + + + + + + B<long> + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + b1(long) + + a1(int) + + b2(long) + + a2(const long &) + + ​ + + ​ + + diff --git a/docs/test_cases/t20017.md b/docs/test_cases/t20017.md index d48751c7..0ecd9cc0 100644 --- a/docs/test_cases/t20017.md +++ b/docs/test_cases/t20017.md @@ -42,15 +42,17 @@ int tmain() { return b2(a1(a2(a3(1, 2), b1(3, 4)), 5), 6); } } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20017_sequence](./t20017_sequence.svg "Test case for combine_free_functions_into_file_participants option") +## Generated Mermaid diagrams +![t20017_sequence](./t20017_sequence_mermaid.svg "Test case for combine_free_functions_into_file_participants option") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20017_sequence", diff --git a/docs/test_cases/t20017_sequence.svg b/docs/test_cases/t20017_sequence.svg index 7486bd8e..c0570a73 100644 --- a/docs/test_cases/t20017_sequence.svg +++ b/docs/test_cases/t20017_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,65 +9,65 @@ - - - - - - + + + + + + - + t20017.cc - + t20017.cc - + include/t20017_a.h - + include/t20017_a.h - + include/t20017_b.h - + include/t20017_b.h - - - - - - + + + + + + tmain() - + a3(int,int) - + b1(int,int) - + a2(int,int) - + a1(int,int) - + b2<int>(int,int) diff --git a/docs/test_cases/t20017_sequence_mermaid.svg b/docs/test_cases/t20017_sequence_mermaid.svg new file mode 100644 index 00000000..5e91be23 --- /dev/null +++ b/docs/test_cases/t20017_sequence_mermaid.svg @@ -0,0 +1,142 @@ + + + + + include/t20017_b.h + + + + + + include/t20017_a.h + + + + + + * + + + + + + t20017.cc + + + + + + + + include/t20017_b.h + + + + + + + + + include/t20017_a.h + + + + + + + + + * + + + + + + + + + t20017.cc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tmain() + + a3(int,int) + + ​ + + b1(int,int) + + ​ + + a2(int,int) + + ​ + + a1(int,int) + + ​ + + b2<int>(int,int) + + ​ + + ​ + + diff --git a/docs/test_cases/t20018.md b/docs/test_cases/t20018.md index 056d985c..2aae965a 100644 --- a/docs/test_cases/t20018.md +++ b/docs/test_cases/t20018.md @@ -47,15 +47,17 @@ void tmain() { Answer>::print(); } } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20018_sequence](./t20018_sequence.svg "Recursive template sequence diagram test case") +## Generated Mermaid diagrams +![t20018_sequence](./t20018_sequence_mermaid.svg "Recursive template sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20018_sequence", diff --git a/docs/test_cases/t20018_sequence.svg b/docs/test_cases/t20018_sequence.svg index 9941c9b9..a034ab19 100644 --- a/docs/test_cases/t20018_sequence.svg +++ b/docs/test_cases/t20018_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,14 +9,14 @@ - - - - - - - - + + + + + + + + @@ -25,93 +25,93 @@ - - + + tmain() - + tmain() - - + + Answer<Factorial<5>,120> - + Answer<Factorial<5>,120> - - + + Factorial<5> - + Factorial<5> - - + + Factorial<4> - + Factorial<4> - - + + Factorial<3> - + Factorial<3> - - + + Factorial<2> - + Factorial<2> - - + + Factorial<1> - + Factorial<1> - - + + Factorial<0> - + Factorial<0> - - - - - - - - - + + + + + + + + + print() - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) diff --git a/docs/test_cases/t20018_sequence_mermaid.svg b/docs/test_cases/t20018_sequence_mermaid.svg new file mode 100644 index 00000000..ce997fae --- /dev/null +++ b/docs/test_cases/t20018_sequence_mermaid.svg @@ -0,0 +1,198 @@ + + + + + Factorial<0> + + + + + + Factorial<1> + + + + + + Factorial<2> + + + + + + Factorial<3> + + + + + + Factorial<4> + + + + + + Factorial<5> + + + + + + Answer<Factorial<5>,120> + + + + + + tmain() + + + + + + + + Factorial<0> + + + + + + + + + Factorial<1> + + + + + + + + + Factorial<2> + + + + + + + + + Factorial<3> + + + + + + + + + Factorial<4> + + + + + + + + + Factorial<5> + + + + + + + + + Answer<Factorial<5>,120> + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + print() + + print(int) + + print(int) + + print(int) + + print(int) + + print(int) + + print(int) + + diff --git a/docs/test_cases/t20019.md b/docs/test_cases/t20019.md index b2abaa3b..3333bd68 100644 --- a/docs/test_cases/t20019.md +++ b/docs/test_cases/t20019.md @@ -54,15 +54,17 @@ void tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20019_sequence](./t20019_sequence.svg "Curiously Recurring Template Pattern sequence diagram test case") +## Generated Mermaid diagrams +![t20019_sequence](./t20019_sequence_mermaid.svg "Curiously Recurring Template Pattern sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20019_sequence", diff --git a/docs/test_cases/t20019_sequence.svg b/docs/test_cases/t20019_sequence.svg index 5ea04584..be973318 100644 --- a/docs/test_cases/t20019_sequence.svg +++ b/docs/test_cases/t20019_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + Base<D1> - + Base<D1> - - + + D1 - + D1 - - + + Base<D2> - + Base<D2> - - + + D2 - + D2 - - - - - - - - - - + + + + + + + + + + name() - + impl() - + name() - + impl() - + name() - + impl() - + name() - + impl() diff --git a/docs/test_cases/t20019_sequence_mermaid.svg b/docs/test_cases/t20019_sequence_mermaid.svg new file mode 100644 index 00000000..a03fda27 --- /dev/null +++ b/docs/test_cases/t20019_sequence_mermaid.svg @@ -0,0 +1,158 @@ + + + + + D2 + + + + + + Base<D2> + + + + + + D1 + + + + + + Base<D1> + + + + + + tmain() + + + + + + + + D2 + + + + + + + + + Base<D2> + + + + + + + + + D1 + + + + + + + + + Base<D1> + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + name() + + impl() + + name() + + impl() + + name() + + impl() + + name() + + impl() + + diff --git a/docs/test_cases/t20020.md b/docs/test_cases/t20020.md index 770ea4a1..d646cfb8 100644 --- a/docs/test_cases/t20020.md +++ b/docs/test_cases/t20020.md @@ -110,15 +110,17 @@ int tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20020_sequence](./t20020_sequence.svg "If statement sequence diagram test case") +## Generated Mermaid diagrams +![t20020_sequence](./t20020_sequence_mermaid.svg "If statement sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20020_sequence", diff --git a/docs/test_cases/t20020_sequence.svg b/docs/test_cases/t20020_sequence.svg index e038970f..d0765161 100644 --- a/docs/test_cases/t20020_sequence.svg +++ b/docs/test_cases/t20020_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,82 +9,82 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + C - + C - - + + B - + B - - + + D<int> - + D<int> - - - - - - - - - - - - - - + + + + + + + + + + + + + + alt - + a1() @@ -92,7 +92,7 @@ - + a5() @@ -103,7 +103,7 @@ alt - + [ @@ -112,7 +112,7 @@ - + [ @@ -121,7 +121,7 @@ - + b1() @@ -129,7 +129,7 @@ - + [ @@ -138,7 +138,7 @@ - + b2() @@ -146,14 +146,14 @@ - + a4() - + log() @@ -161,7 +161,7 @@ alt - + c1() const @@ -169,7 +169,7 @@ alt - + @@ -182,7 +182,7 @@ - + @@ -192,7 +192,7 @@ alt - + d1(int,int) diff --git a/docs/test_cases/t20020_sequence_mermaid.svg b/docs/test_cases/t20020_sequence_mermaid.svg new file mode 100644 index 00000000..bd77292b --- /dev/null +++ b/docs/test_cases/t20020_sequence_mermaid.svg @@ -0,0 +1,262 @@ + + + + + D<int> + + + + + + B + + + + + + C + + + + + + A + + + + + + tmain() + + + + + + + + D<int> + + + + + + + + + B + + + + + + + + + C + + + + + + + + + A + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + alt + + ​ + + + + + + + + + + + + + + + alt + + ​ + + + + + + + + + + + + + + + + + + + + + alt + + ​ + + + + + + + + + alt + + ​ + + + + + + + + + + + + alt + + ​ + + + a1() + + ​ + + a5() + + ​ + + [a2()] + + ​ + + [c3(int)] + + ​ + + b1() + + ​ + + [a3()] + + ​ + + b2() + + ​ + + a4() + + ​ + + log() + + c1() const + + [c2() const] + + ​ + + log() const + + d1(int,int) + + ​ + + diff --git a/docs/test_cases/t20021.md b/docs/test_cases/t20021.md index bcfd778f..afe52587 100644 --- a/docs/test_cases/t20021.md +++ b/docs/test_cases/t20021.md @@ -77,15 +77,17 @@ int tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20021_sequence](./t20021_sequence.svg "Loop statements sequence diagram test case") +## Generated Mermaid diagrams +![t20021_sequence](./t20021_sequence_mermaid.svg "Loop statements sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20021_sequence", diff --git a/docs/test_cases/t20021_sequence.svg b/docs/test_cases/t20021_sequence.svg index 3f654d8c..62088109 100644 --- a/docs/test_cases/t20021_sequence.svg +++ b/docs/test_cases/t20021_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + C - + C - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + loop - + [ c4() ] - + @@ -89,7 +89,7 @@ - + a3() @@ -102,7 +102,7 @@ loop - + [ @@ -111,7 +111,7 @@ - + [ @@ -120,7 +120,7 @@ - + [ @@ -129,14 +129,14 @@ - + a1() - + [ @@ -148,7 +148,7 @@ loop - + b2() const @@ -158,7 +158,7 @@ loop - + [ @@ -167,7 +167,7 @@ - + b2() const diff --git a/docs/test_cases/t20021_sequence_mermaid.svg b/docs/test_cases/t20021_sequence_mermaid.svg new file mode 100644 index 00000000..b1eab8f0 --- /dev/null +++ b/docs/test_cases/t20021_sequence_mermaid.svg @@ -0,0 +1,235 @@ + + + + + B + + + + + + A + + + + + + C + + + + + + tmain() + + + + + + + + B + + + + + + + + + A + + + + + + + + + C + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + loop + + ​ + + + + + + + + + + + + loop + + ​ + + + + + + + + + loop + + ​ + + + + + + + + + + + + loop + + ​ + + + + + + + + + + + + loop + + ​ + + + + + + [c4()] + + c5() + + ​ + + ​ + + a3() + + ​ + + [a2()] + + ​ + + [c1()] + + ​ + + [c2()] + + ​ + + a1() + + ​ + + [c3()] + + ​ + + b2() const + + ​ + + [contents()] + + ​ + + b2() const + + ​ + + diff --git a/docs/test_cases/t20022.md b/docs/test_cases/t20022.md index 9412e454..ad679896 100644 --- a/docs/test_cases/t20022.md +++ b/docs/test_cases/t20022.md @@ -57,15 +57,17 @@ int tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20022_sequence](./t20022_sequence.svg "Forward class declaration sequence diagram test case") +## Generated Mermaid diagrams +![t20022_sequence](./t20022_sequence_mermaid.svg "Forward class declaration sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20022_sequence", diff --git a/docs/test_cases/t20022_sequence.svg b/docs/test_cases/t20022_sequence.svg index 615f198a..770c0b7d 100644 --- a/docs/test_cases/t20022_sequence.svg +++ b/docs/test_cases/t20022_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - + + + + + A(std::unique_ptr ) - + a() - + b() diff --git a/docs/test_cases/t20022_sequence_mermaid.svg b/docs/test_cases/t20022_sequence_mermaid.svg new file mode 100644 index 00000000..9baa294f --- /dev/null +++ b/docs/test_cases/t20022_sequence_mermaid.svg @@ -0,0 +1,103 @@ + + + + + B + + + + + + A + + + + + + tmain() + + + + + + + + B + + + + + + + + + A + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A(std::unique_ptr<B>) + + a() + + b() + + diff --git a/docs/test_cases/t20023.md b/docs/test_cases/t20023.md index a7b60c0f..a336c8e5 100644 --- a/docs/test_cases/t20023.md +++ b/docs/test_cases/t20023.md @@ -60,15 +60,17 @@ int tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20023_sequence](./t20023_sequence.svg "Try/catch statement sequence diagram test case") +## Generated Mermaid diagrams +![t20023_sequence](./t20023_sequence_mermaid.svg "Try/catch statement sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20023_sequence", diff --git a/docs/test_cases/t20023_sequence.svg b/docs/test_cases/t20023_sequence.svg index f0a654e7..dce29435 100644 --- a/docs/test_cases/t20023_sequence.svg +++ b/docs/test_cases/t20023_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,37 +9,37 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - + + + + + + + a() @@ -47,7 +47,7 @@ try - + @@ -60,7 +60,7 @@ [std::runtime_error &] - + @@ -73,7 +73,7 @@ [std::logic_error &] - + @@ -86,7 +86,7 @@ [...] - + diff --git a/docs/test_cases/t20023_sequence_mermaid.svg b/docs/test_cases/t20023_sequence_mermaid.svg new file mode 100644 index 00000000..663706f6 --- /dev/null +++ b/docs/test_cases/t20023_sequence_mermaid.svg @@ -0,0 +1,127 @@ + + + + + A + + + + + + tmain() + + + + + + + + A + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + critical + + ​ + + [std::runtime- + _error &] + [std::logic_e- + rror &] + [...] + + a() + + a1() + + ​ + + a2() + + ​ + + a3() + + ​ + + a4() + + ​ + + ​ + + diff --git a/docs/test_cases/t20024.md b/docs/test_cases/t20024.md index 83f56170..7f0b4e50 100644 --- a/docs/test_cases/t20024.md +++ b/docs/test_cases/t20024.md @@ -85,15 +85,17 @@ int tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20024_sequence](./t20024_sequence.svg "Switch statement sequence diagram test case") +## Generated Mermaid diagrams +![t20024_sequence](./t20024_sequence_mermaid.svg "Switch statement sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20024_sequence", diff --git a/docs/test_cases/t20024_sequence.svg b/docs/test_cases/t20024_sequence.svg index 3e37100e..4444bb9b 100644 --- a/docs/test_cases/t20024_sequence.svg +++ b/docs/test_cases/t20024_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + @@ -33,36 +33,36 @@ - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + select(enum_a) @@ -72,7 +72,7 @@ switch [zero] - + @@ -85,7 +85,7 @@ [one] - + @@ -98,7 +98,7 @@ [two] - + @@ -111,7 +111,7 @@ [default] - + @@ -124,7 +124,7 @@ - + select(colors) @@ -134,7 +134,7 @@ switch [enum colors::red] - + @@ -143,7 +143,7 @@ [enum colors::orange] - + @@ -152,7 +152,7 @@ [enum colors::green] - + @@ -161,7 +161,7 @@ [default] - + diff --git a/docs/test_cases/t20024_sequence_mermaid.svg b/docs/test_cases/t20024_sequence_mermaid.svg new file mode 100644 index 00000000..4700dffe --- /dev/null +++ b/docs/test_cases/t20024_sequence_mermaid.svg @@ -0,0 +1,191 @@ + + + + + B + + + + + + A + + + + + + tmain() + + + + + + + + B + + + + + + + + + A + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + alt + + ​ + + [zero] + [one] + [two] + [default] + + + + + + + + + + + + + + + + + + + + + + + + + + + alt + + ​ + + [enum + colors::red] + [enum + colors::orang- + e] + [enum + colors::green- + ] + [default] + + select(enum_a) + + a0() + + ​ + + a1() + + ​ + + a2() + + ​ + + a3() + + ​ + + ​ + + select(colors) + + red() + + orange() + + green() + + grey() + + diff --git a/docs/test_cases/t20025.md b/docs/test_cases/t20025.md index 5fb534a7..af41e7c6 100644 --- a/docs/test_cases/t20025.md +++ b/docs/test_cases/t20025.md @@ -65,15 +65,17 @@ int tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20025_sequence](./t20025_sequence.svg "Skip decorator sequence diagram test case") +## Generated Mermaid diagrams +![t20025_sequence](./t20025_sequence_mermaid.svg "Skip decorator sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20025_sequence", diff --git a/docs/test_cases/t20025_sequence.svg b/docs/test_cases/t20025_sequence.svg index 2757cdc5..fe392bee 100644 --- a/docs/test_cases/t20025_sequence.svg +++ b/docs/test_cases/t20025_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,41 +9,41 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + add(int,int) - + add(int,int) - - - - - + + + + + a() - + @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t20025_sequence_mermaid.svg b/docs/test_cases/t20025_sequence_mermaid.svg new file mode 100644 index 00000000..0516f053 --- /dev/null +++ b/docs/test_cases/t20025_sequence_mermaid.svg @@ -0,0 +1,107 @@ + + + + + add(int,int) + + + + + + A + + + + + + tmain() + + + + + + + + add(int,int) + + + + + + + + + A + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a() + + a2() + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20026.md b/docs/test_cases/t20026.md index 4c0397df..addb62f8 100644 --- a/docs/test_cases/t20026.md +++ b/docs/test_cases/t20026.md @@ -45,15 +45,17 @@ int tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20026_sequence](./t20026_sequence.svg "Virtual method call sequence diagram test case") +## Generated Mermaid diagrams +![t20026_sequence](./t20026_sequence_mermaid.svg "Virtual method call sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20026_sequence", diff --git a/docs/test_cases/t20026_sequence.svg b/docs/test_cases/t20026_sequence.svg index bc3970c4..cc58a4e8 100644 --- a/docs/test_cases/t20026_sequence.svg +++ b/docs/test_cases/t20026_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20026_sequence_mermaid.svg b/docs/test_cases/t20026_sequence_mermaid.svg new file mode 100644 index 00000000..49209c1b --- /dev/null +++ b/docs/test_cases/t20026_sequence_mermaid.svg @@ -0,0 +1,78 @@ + + + + + A + + + + + + tmain() + + + + + + + + A + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a() + + diff --git a/docs/test_cases/t20027.md b/docs/test_cases/t20027.md index fd7ef6bf..8ed41e17 100644 --- a/docs/test_cases/t20027.md +++ b/docs/test_cases/t20027.md @@ -44,15 +44,17 @@ void tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20027_sequence](./t20027_sequence.svg "Filter call expressions based on access test case") +## Generated Mermaid diagrams +![t20027_sequence](./t20027_sequence_mermaid.svg "Filter call expressions based on access test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20027_sequence", diff --git a/docs/test_cases/t20027_sequence.svg b/docs/test_cases/t20027_sequence.svg index 34bb8b7c..7e27e86c 100644 --- a/docs/test_cases/t20027_sequence.svg +++ b/docs/test_cases/t20027_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20027_sequence_mermaid.svg b/docs/test_cases/t20027_sequence_mermaid.svg new file mode 100644 index 00000000..49209c1b --- /dev/null +++ b/docs/test_cases/t20027_sequence_mermaid.svg @@ -0,0 +1,78 @@ + + + + + A + + + + + + tmain() + + + + + + + + A + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a() + + diff --git a/docs/test_cases/t20028.md b/docs/test_cases/t20028.md index e89c4a2b..da9c342c 100644 --- a/docs/test_cases/t20028.md +++ b/docs/test_cases/t20028.md @@ -54,15 +54,17 @@ int tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20028_sequence](./t20028_sequence.svg "Conditional (ternary) '?:' operator test case") +## Generated Mermaid diagrams +![t20028_sequence](./t20028_sequence_mermaid.svg "Conditional (ternary) '?:' operator test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20028_sequence", diff --git a/docs/test_cases/t20028_sequence.svg b/docs/test_cases/t20028_sequence.svg index d4e2f872..01f07481 100644 --- a/docs/test_cases/t20028_sequence.svg +++ b/docs/test_cases/t20028_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,36 +9,36 @@ - - - - - - + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - + + + + + alt - + [ @@ -47,14 +47,14 @@ - + b() - + c() @@ -62,7 +62,7 @@ - + d() diff --git a/docs/test_cases/t20028_sequence_mermaid.svg b/docs/test_cases/t20028_sequence_mermaid.svg new file mode 100644 index 00000000..bccc74c7 --- /dev/null +++ b/docs/test_cases/t20028_sequence_mermaid.svg @@ -0,0 +1,113 @@ + + + + + A + + + + + + tmain() + + + + + + + + A + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + alt + + ​ + + + [a()] + + ​ + + b() + + ​ + + c() + + ​ + + d() + + ​ + + diff --git a/docs/test_cases/t20029.md b/docs/test_cases/t20029.md index 7d2ab56a..a752cfec 100644 --- a/docs/test_cases/t20029.md +++ b/docs/test_cases/t20029.md @@ -98,15 +98,17 @@ int tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20029_sequence](./t20029_sequence.svg "Combined feature sequence diagram test case") +## Generated Mermaid diagrams +![t20029_sequence](./t20029_sequence_mermaid.svg "Combined feature sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20029_sequence", diff --git a/docs/test_cases/t20029_sequence.svg b/docs/test_cases/t20029_sequence.svg index 8a3ae390..7d01b14d 100644 --- a/docs/test_cases/t20029_sequence.svg +++ b/docs/test_cases/t20029_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,60 +9,60 @@ - - - - - - - - - - - + + + + + + + + + + + - - + + tmain() - + tmain() - - + + Encoder<Retrier<ConnectionPool>> - + Encoder<Retrier<ConnectionPool>> - - + + Retrier<ConnectionPool> - + Retrier<ConnectionPool> - - + + ConnectionPool - + ConnectionPool - - + + encode_b64(std::string &&) - + encode_b64(std::string &&) - - - - - - - - + + + + + + + + connect() @@ -73,21 +73,21 @@ alt - + [ send(std::string &&) ] - + encode(std::string &&) - + @@ -97,7 +97,7 @@ - + send(std::string &&) @@ -108,7 +108,7 @@ alt - + [ diff --git a/docs/test_cases/t20029_sequence_mermaid.svg b/docs/test_cases/t20029_sequence_mermaid.svg new file mode 100644 index 00000000..1770faf7 --- /dev/null +++ b/docs/test_cases/t20029_sequence_mermaid.svg @@ -0,0 +1,202 @@ + + + + + encode_b64(std::string &&) + + + + + + ConnectionPool + + + + + + Retrier<ConnectionPool> + + + + + + Encoder<Retrier<ConnectionPool>> + + + + + + tmain() + + + + + + + + encode_b64(std::string &&) + + + + + + + + + ConnectionPool + + + + + + + + + Retrier<ConnectionPool> + + + + + + + + + Encoder<Retrier<ConnectionPool>> + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + alt + + ​ + + + + + + + + + loop + + ​ + + + + + + + + + alt + + ​ + + + + + + + + + loop + + ​ + + + connect() + + [send(std::string &&)] + + encode(std::string &&) + + ​ + + ​ + + ​ + + send(std::string &&) + + [send(const std::string &)] + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20030.md b/docs/test_cases/t20030.md index f6c9be4a..7a6c45ee 100644 --- a/docs/test_cases/t20030.md +++ b/docs/test_cases/t20030.md @@ -72,15 +72,17 @@ int tmain(bool f, int a) } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20030_sequence](./t20030_sequence.svg "Constructor and operator call test case") +## Generated Mermaid diagrams +![t20030_sequence](./t20030_sequence_mermaid.svg "Constructor and operator call test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20030_sequence", @@ -187,7 +189,7 @@ int tmain(bool f, int a) "participant_name": "clanguml::t20030::tmain(int)" }, "name": "operator+=(int)", - "return_type": "clanguml::t20030::A &", + "return_type": "A &", "scope": "normal", "source_location": { "column": 5, @@ -308,7 +310,7 @@ int tmain(bool f, int a) "participant_name": "clanguml::t20030::tmain(bool,int)" }, "name": "operator+=(int)", - "return_type": "clanguml::t20030::A &", + "return_type": "A &", "scope": "normal", "source_location": { "column": 5, @@ -353,7 +355,7 @@ int tmain(bool f, int a) "participant_name": "clanguml::t20030::tmain(bool,int)" }, "name": "operator=(const A &)", - "return_type": "clanguml::t20030::A &", + "return_type": "A &", "scope": "normal", "source_location": { "column": 5, diff --git a/docs/test_cases/t20030_sequence.svg b/docs/test_cases/t20030_sequence.svg index d636e258..965125e2 100644 --- a/docs/test_cases/t20030_sequence.svg +++ b/docs/test_cases/t20030_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,81 +9,81 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + tmain(int) - + tmain(int) - - + + magic() - + magic() - - + + A - + A - - + + tmain(bool,int) - + tmain(bool,int) - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + A(int) - + operator+=(int) - + @@ -92,36 +92,36 @@ - + A() - + create() - + A() - + create() - + operator+=(int) - + @@ -130,12 +130,12 @@ - + operator=(const A &) - + @@ -144,7 +144,7 @@ - + value() const diff --git a/docs/test_cases/t20030_sequence_mermaid.svg b/docs/test_cases/t20030_sequence_mermaid.svg new file mode 100644 index 00000000..42b85e10 --- /dev/null +++ b/docs/test_cases/t20030_sequence_mermaid.svg @@ -0,0 +1,181 @@ + + + + + tmain(bool,int) + + + + + + A + + + + + + magic() + + + + + + tmain(int) + + + + + + + + tmain(bool,int) + + + + + + + + + A + + + + + + + + + magic() + + + + + + + + + tmain(int) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ​ + + ​ + + A(int) + + operator+=(int) + + add(int) + + ​ + + A() + + create() + + A() + + create() + + operator+=(int) + + add(int) + + ​ + + operator=(const A &) + + set(int) + + ​ + + value() const + + ​ + + diff --git a/docs/test_cases/t20031.md b/docs/test_cases/t20031.md index 5ee55c41..1f44c5c6 100644 --- a/docs/test_cases/t20031.md +++ b/docs/test_cases/t20031.md @@ -88,15 +88,17 @@ int tmain(bool f, int a) } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20031_sequence](./t20031_sequence.svg "Callee type sequence diagram filter test case") +## Generated Mermaid diagrams +![t20031_sequence](./t20031_sequence_mermaid.svg "Callee type sequence diagram filter test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20031_sequence", diff --git a/docs/test_cases/t20031_sequence.svg b/docs/test_cases/t20031_sequence.svg index 545558e5..94405af3 100644 --- a/docs/test_cases/t20031_sequence.svg +++ b/docs/test_cases/t20031_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,64 +9,64 @@ - - - - - + + + + + - - + + tmain(int) - + tmain(int) - - + + magic() - + magic() - - + + tmain(bool,int) - + tmain(bool,int) - - + + execute(std::function<int ()>) - + execute(std::function<int ()>) - - + + A - + A - - - - - - + + + + + + - + - + value() const diff --git a/docs/test_cases/t20031_sequence_mermaid.svg b/docs/test_cases/t20031_sequence_mermaid.svg new file mode 100644 index 00000000..481ab8ce --- /dev/null +++ b/docs/test_cases/t20031_sequence_mermaid.svg @@ -0,0 +1,142 @@ + + + + + A + + + + + + execute(std::function<int ()>) + + + + + + tmain(bool,int) + + + + + + magic() + + + + + + tmain(int) + + + + + + + + A + + + + + + + + + execute(std::function<int ()>) + + + + + + + + + tmain(bool,int) + + + + + + + + + magic() + + + + + + + + + tmain(int) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ​ + + ​ + + ​ + + ​ + + value() const + + ​ + + diff --git a/docs/test_cases/t20032.md b/docs/test_cases/t20032.md index 9acdcd66..f68ef59a 100644 --- a/docs/test_cases/t20032.md +++ b/docs/test_cases/t20032.md @@ -48,15 +48,17 @@ void tmain(int argc, char **argv) } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20032_sequence](./t20032_sequence.svg "Return type generation option sequence diagram test case") +## Generated Mermaid diagrams +![t20032_sequence](./t20032_sequence_mermaid.svg "Return type generation option sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20032_sequence", diff --git a/docs/test_cases/t20032_sequence.svg b/docs/test_cases/t20032_sequence.svg index fa734a6e..4b33839c 100644 --- a/docs/test_cases/t20032_sequence.svg +++ b/docs/test_cases/t20032_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - - - - + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + B - + B - - + + A - + A - - - - - - - - + + + + + + + + b(int) - + a1(int) @@ -60,12 +60,12 @@ int - + b(double) - + a2(double) @@ -76,12 +76,12 @@ double - + b(const char *) - + a3(const char *) diff --git a/docs/test_cases/t20032_sequence_mermaid.svg b/docs/test_cases/t20032_sequence_mermaid.svg new file mode 100644 index 00000000..31dd5e89 --- /dev/null +++ b/docs/test_cases/t20032_sequence_mermaid.svg @@ -0,0 +1,130 @@ + + + + + A + + + + + + B + + + + + + tmain(int,char **) + + + + + + + + A + + + + + + + + + B + + + + + + + + + tmain(int,char **) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + b(int) + + a1(int) + + int + + int + + b(double) + + a2(double) + + double + + double + + b(const char *) + + a3(const char *) + + const char * + + const char * + + diff --git a/docs/test_cases/t20033.md b/docs/test_cases/t20033.md index 289783cc..b1c0bf36 100644 --- a/docs/test_cases/t20033.md +++ b/docs/test_cases/t20033.md @@ -86,15 +86,17 @@ int tmain() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20033_sequence](./t20033_sequence.svg "Control statement text in sequence diagram test case") +## Generated Mermaid diagrams +![t20033_sequence](./t20033_sequence_mermaid.svg "Control statement text in sequence diagram test case") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20033_sequence", diff --git a/docs/test_cases/t20033_sequence.svg b/docs/test_cases/t20033_sequence.svg index 1214f325..9bd688b8 100644 --- a/docs/test_cases/t20033_sequence.svg +++ b/docs/test_cases/t20033_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,73 +9,73 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - + + + + + - + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + alt [false] [reinterpret_cast<uint64_t>(&a) % 100 == 0ULL] - + a1() @@ -84,7 +84,7 @@ [reinterpret_cast<uint64_t>(&a) % 64 == 0ULL] - + a2() @@ -93,7 +93,7 @@ [a.a2() == 2 && a.a3() == 3] - + [ @@ -102,7 +102,7 @@ - + [ @@ -111,7 +111,7 @@ - + a3() @@ -119,7 +119,7 @@ - + a4() @@ -130,7 +130,7 @@ alt [int i = a.a2(); i != 2] - + [ @@ -139,7 +139,7 @@ - + a3() @@ -150,7 +150,7 @@ loop [int i = 0; i < a.a2(); i++] - + [ @@ -159,14 +159,14 @@ - + a3() - + a3() @@ -177,7 +177,7 @@ loop [retry_count--] - + a2() @@ -188,14 +188,14 @@ loop [retry_count++ < a.a3()] - + a4() - + [ @@ -208,7 +208,7 @@ alt [a.a4() % 6] - + [ @@ -222,7 +222,7 @@ loop [ints] - + a4() diff --git a/docs/test_cases/t20033_sequence_mermaid.svg b/docs/test_cases/t20033_sequence_mermaid.svg new file mode 100644 index 00000000..0eb7a5c5 --- /dev/null +++ b/docs/test_cases/t20033_sequence_mermaid.svg @@ -0,0 +1,284 @@ + + + + + A + + + + + + tmain() + + + + + + + + A + + + + + + + + + tmain() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + alt + + [false] + + [reinterpret_cast<uint6- + 4_t>(&a) % 100 == + 0ULL] + [reinterpret_cast<uint6- + 4_t>(&a) % 64 == + 0ULL] + [a.a2() == 2 && + a.a3() == 3] + + + + + + + + + + + + + + alt + + [int i = a.a2(); + + + i != 2] + + + + + + + + + + + + + + + loop + + [int i = 0; i < + + + a.a2(); i++] + + + + + + + + + + + + + + + loop + + [retry_count--] + + + + + + + + + + + + + + + loop + + [retry_count++ < + + + a.a3()] + + + + + + + + + + + + + alt + + [a.a4() % 6] + + + + + + + + + + + + loop + + [ints] + + + a1() + + ​ + + a2() + + ​ + + [a2()] + + ​ + + [a3()] + + ​ + + a3() + + ​ + + a4() + + ​ + + [a2()] + + ​ + + a3() + + ​ + + [a2()] + + ​ + + a3() + + ​ + + a3() + + ​ + + a2() + + ​ + + a4() + + ​ + + [a3()] + + ​ + + [a4()] + + ​ + + a4() + + ​ + + diff --git a/docs/test_cases/t20034.md b/docs/test_cases/t20034.md index 3f779b2b..5ab64a79 100644 --- a/docs/test_cases/t20034.md +++ b/docs/test_cases/t20034.md @@ -92,15 +92,17 @@ void B::b4() } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20034_sequence](./t20034_sequence.svg "Test case for rendering all call chains from one activity to another (from_to)") +## Generated Mermaid diagrams +![t20034_sequence](./t20034_sequence_mermaid.svg "Test case for rendering all call chains from one activity to another (from_to)") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20034_sequence", @@ -182,35 +184,13 @@ void B::b4() "activity_name": "clanguml::t20034::D::d2()", "participant_id": "272777525372220260" }, - "name": "c3()", + "name": "c2()", "return_type": "void", "scope": "normal", "source_location": { "column": 9, "file": "../../tests/t20034/t20034.cc", - "line": 51, - "translation_unit": "../../tests/t20034/t20034.cc" - }, - "to": { - "activity_id": "2116989777037608337", - "activity_name": "clanguml::t20034::C::c3()", - "participant_id": "2153793652884753477" - }, - "type": "message" - }, - { - "from": { - "activity_id": "2116989777037608337", - "activity_name": "clanguml::t20034::C::c3()", - "participant_id": "2153793652884753477" - }, - "name": "c2()", - "return_type": "void", - "scope": "normal", - "source_location": { - "column": 13, - "file": "../../tests/t20034/t20034.cc", - "line": 36, + "line": 50, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { @@ -266,168 +246,6 @@ void B::b4() } ] }, - { - "messages": [ - { - "from": { - "activity_id": "1707514178726476738", - "activity_name": "clanguml::t20034::D::d2()", - "participant_id": "272777525372220260" - }, - "name": "c1()", - "return_type": "void", - "scope": "normal", - "source_location": { - "column": 9, - "file": "../../tests/t20034/t20034.cc", - "line": 48, - "translation_unit": "../../tests/t20034/t20034.cc" - }, - "to": { - "activity_id": "148530508384958711", - "activity_name": "clanguml::t20034::C::c1()", - "participant_id": "2153793652884753477" - }, - "type": "message" - }, - { - "from": { - "activity_id": "148530508384958711", - "activity_name": "clanguml::t20034::C::c1()", - "participant_id": "2153793652884753477" - }, - "name": "b1()", - "return_type": "void", - "scope": "normal", - "source_location": { - "column": 17, - "file": "../../tests/t20034/t20034.cc", - "line": 29, - "translation_unit": "../../tests/t20034/t20034.cc" - }, - "to": { - "activity_id": "289899516984058785", - "activity_name": "clanguml::t20034::B::b1()", - "participant_id": "1214895773389400008" - }, - "type": "message" - }, - { - "from": { - "activity_id": "289899516984058785", - "activity_name": "clanguml::t20034::B::b1()", - "participant_id": "1214895773389400008" - }, - "name": "a2()", - "return_type": "void", - "scope": "normal", - "source_location": { - "column": 9, - "file": "../../tests/t20034/t20034.cc", - "line": 17, - "translation_unit": "../../tests/t20034/t20034.cc" - }, - "to": { - "activity_id": "1307188853155365430", - "activity_name": "clanguml::t20034::A::a2()", - "participant_id": "1029414747563549012" - }, - "type": "message" - } - ] - }, - { - "messages": [ - { - "from": { - "activity_id": "1707514178726476738", - "activity_name": "clanguml::t20034::D::d2()", - "participant_id": "272777525372220260" - }, - "name": "c4()", - "return_type": "void", - "scope": "normal", - "source_location": { - "column": 9, - "file": "../../tests/t20034/t20034.cc", - "line": 54, - "translation_unit": "../../tests/t20034/t20034.cc" - }, - "to": { - "activity_id": "395720534444062628", - "activity_name": "clanguml::t20034::C::c4()", - "participant_id": "2153793652884753477" - }, - "type": "message" - }, - { - "from": { - "activity_id": "395720534444062628", - "activity_name": "clanguml::t20034::C::c4()", - "participant_id": "2153793652884753477" - }, - "name": "b4()", - "return_type": "void", - "scope": "normal", - "source_location": { - "column": 17, - "file": "../../tests/t20034/t20034.cc", - "line": 39, - "translation_unit": "../../tests/t20034/t20034.cc" - }, - "to": { - "activity_id": "1774155279072101253", - "activity_name": "clanguml::t20034::B::b4()", - "participant_id": "1214895773389400008" - }, - "type": "message" - }, - { - "from": { - "activity_id": "1774155279072101253", - "activity_name": "clanguml::t20034::B::b4()", - "participant_id": "1214895773389400008" - }, - "name": "b2()", - "return_type": "void", - "scope": "normal", - "source_location": { - "column": 5, - "file": "../../tests/t20034/t20034.cc", - "line": 68, - "translation_unit": "../../tests/t20034/t20034.cc" - }, - "to": { - "activity_id": "1034410188120190919", - "activity_name": "clanguml::t20034::B::b2()", - "participant_id": "1214895773389400008" - }, - "type": "message" - }, - { - "from": { - "activity_id": "1034410188120190919", - "activity_name": "clanguml::t20034::B::b2()", - "participant_id": "1214895773389400008" - }, - "name": "a2()", - "return_type": "void", - "scope": "normal", - "source_location": { - "column": 17, - "file": "../../tests/t20034/t20034.cc", - "line": 19, - "translation_unit": "../../tests/t20034/t20034.cc" - }, - "to": { - "activity_id": "1307188853155365430", - "activity_name": "clanguml::t20034::A::a2()", - "participant_id": "1029414747563549012" - }, - "type": "message" - } - ] - }, { "messages": [ { @@ -510,13 +328,197 @@ void B::b4() "activity_name": "clanguml::t20034::D::d2()", "participant_id": "272777525372220260" }, - "name": "c2()", + "name": "c4()", "return_type": "void", "scope": "normal", "source_location": { "column": 9, "file": "../../tests/t20034/t20034.cc", - "line": 50, + "line": 54, + "translation_unit": "../../tests/t20034/t20034.cc" + }, + "to": { + "activity_id": "395720534444062628", + "activity_name": "clanguml::t20034::C::c4()", + "participant_id": "2153793652884753477" + }, + "type": "message" + }, + { + "from": { + "activity_id": "395720534444062628", + "activity_name": "clanguml::t20034::C::c4()", + "participant_id": "2153793652884753477" + }, + "name": "b4()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 17, + "file": "../../tests/t20034/t20034.cc", + "line": 39, + "translation_unit": "../../tests/t20034/t20034.cc" + }, + "to": { + "activity_id": "1774155279072101253", + "activity_name": "clanguml::t20034::B::b4()", + "participant_id": "1214895773389400008" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1774155279072101253", + "activity_name": "clanguml::t20034::B::b4()", + "participant_id": "1214895773389400008" + }, + "name": "b2()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 5, + "file": "../../tests/t20034/t20034.cc", + "line": 68, + "translation_unit": "../../tests/t20034/t20034.cc" + }, + "to": { + "activity_id": "1034410188120190919", + "activity_name": "clanguml::t20034::B::b2()", + "participant_id": "1214895773389400008" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1034410188120190919", + "activity_name": "clanguml::t20034::B::b2()", + "participant_id": "1214895773389400008" + }, + "name": "a2()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 17, + "file": "../../tests/t20034/t20034.cc", + "line": 19, + "translation_unit": "../../tests/t20034/t20034.cc" + }, + "to": { + "activity_id": "1307188853155365430", + "activity_name": "clanguml::t20034::A::a2()", + "participant_id": "1029414747563549012" + }, + "type": "message" + } + ] + }, + { + "messages": [ + { + "from": { + "activity_id": "1707514178726476738", + "activity_name": "clanguml::t20034::D::d2()", + "participant_id": "272777525372220260" + }, + "name": "c1()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 9, + "file": "../../tests/t20034/t20034.cc", + "line": 48, + "translation_unit": "../../tests/t20034/t20034.cc" + }, + "to": { + "activity_id": "148530508384958711", + "activity_name": "clanguml::t20034::C::c1()", + "participant_id": "2153793652884753477" + }, + "type": "message" + }, + { + "from": { + "activity_id": "148530508384958711", + "activity_name": "clanguml::t20034::C::c1()", + "participant_id": "2153793652884753477" + }, + "name": "b1()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 17, + "file": "../../tests/t20034/t20034.cc", + "line": 29, + "translation_unit": "../../tests/t20034/t20034.cc" + }, + "to": { + "activity_id": "289899516984058785", + "activity_name": "clanguml::t20034::B::b1()", + "participant_id": "1214895773389400008" + }, + "type": "message" + }, + { + "from": { + "activity_id": "289899516984058785", + "activity_name": "clanguml::t20034::B::b1()", + "participant_id": "1214895773389400008" + }, + "name": "a2()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 9, + "file": "../../tests/t20034/t20034.cc", + "line": 17, + "translation_unit": "../../tests/t20034/t20034.cc" + }, + "to": { + "activity_id": "1307188853155365430", + "activity_name": "clanguml::t20034::A::a2()", + "participant_id": "1029414747563549012" + }, + "type": "message" + } + ] + }, + { + "messages": [ + { + "from": { + "activity_id": "1707514178726476738", + "activity_name": "clanguml::t20034::D::d2()", + "participant_id": "272777525372220260" + }, + "name": "c3()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 9, + "file": "../../tests/t20034/t20034.cc", + "line": 51, + "translation_unit": "../../tests/t20034/t20034.cc" + }, + "to": { + "activity_id": "2116989777037608337", + "activity_name": "clanguml::t20034::C::c3()", + "participant_id": "2153793652884753477" + }, + "type": "message" + }, + { + "from": { + "activity_id": "2116989777037608337", + "activity_name": "clanguml::t20034::C::c3()", + "participant_id": "2153793652884753477" + }, + "name": "c2()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 13, + "file": "../../tests/t20034/t20034.cc", + "line": 36, "translation_unit": "../../tests/t20034/t20034.cc" }, "to": { diff --git a/docs/test_cases/t20034_sequence.svg b/docs/test_cases/t20034_sequence.svg index 890c9ce7..933e690d 100644 --- a/docs/test_cases/t20034_sequence.svg +++ b/docs/test_cases/t20034_sequence.svg @@ -1,6 +1,6 @@ - + @@ -14,154 +14,154 @@ - - + + D - + D - - + + C - + C - - + + B - + B - - + + A - + A - - + + D::d2()::(lambda ../../tests/t20034/t20034.cc:56:18) - + D::d2()::(lambda ../../tests/t20034/t20034.cc:56:18) d2() - + - c3() + c2() - - - - - - c2() + + + + b2() - - - - b2() + + + + a2() - - - - a2() + + + + + + d2() + + + + a2() - - - - - - d2() - - - - c1() + + + + + + d2() + + + + operator()() - - - - b1() + + + + a2() - - - - a2() + + + + + + d2() + + + + c4() - - - - - - d2() - - - - c4() + + + + b4() - - - - b4() + + + + + + b2() - - - - - - b2() + + + + a2() - - - - a2() + + + + + + d2() + + + + c1() - - - - - - d2() - - - - a2() + + + + b1() - - - - - - d2() - - - - operator()() + + + + a2() - - - - a2() + + + + + + d2() + + + + c3() - - - - - - d2() - - - - c2() + + + + + + c2() - + b2() - + a2() diff --git a/docs/test_cases/t20034_sequence_mermaid.svg b/docs/test_cases/t20034_sequence_mermaid.svg new file mode 100644 index 00000000..6dca9ae3 --- /dev/null +++ b/docs/test_cases/t20034_sequence_mermaid.svg @@ -0,0 +1,176 @@ + + + + + D::d2()::(lambda ../../tests/t20034/t20034.cc:56:18) + + + + + + A + + + + + + B + + + + + + C + + + + + + D + + + + + + * + + + + + + + + D::d2()::(lambda ../../tests/t20034/t20034.cc:56:18) + + + + + + + + + A + + + + + + + + + B + + + + + + + + + C + + + + + + + + + D + + + + + + + + + * + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + d2() + + c2() + + b2() + + a2() + + d2() + + a2() + + d2() + + operator()() + + a2() + + d2() + + c4() + + b4() + + b2() + + a2() + + d2() + + c1() + + b1() + + a2() + + d2() + + c3() + + c2() + + b2() + + a2() + + diff --git a/docs/test_cases/t20035.md b/docs/test_cases/t20035.md index 608bae86..1b60a073 100644 --- a/docs/test_cases/t20035.md +++ b/docs/test_cases/t20035.md @@ -35,15 +35,17 @@ int tmain(int argc, char **argv) { return a(argc); } } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20035_sequence](./t20035_sequence.svg "from_to sequence diagram test case with free functions") +## Generated Mermaid diagrams +![t20035_sequence](./t20035_sequence_mermaid.svg "from_to sequence diagram test case with free functions") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20035_sequence", diff --git a/docs/test_cases/t20035_sequence.svg b/docs/test_cases/t20035_sequence.svg index a49e0818..544c821b 100644 --- a/docs/test_cases/t20035_sequence.svg +++ b/docs/test_cases/t20035_sequence.svg @@ -1,6 +1,6 @@ - + @@ -13,39 +13,39 @@ - - + + tmain(int,char **) - + tmain(int,char **) - - + + a(int) - + a(int) - - + + b1(int) - + b1(int) - - + + c(int) - + c(int) - + - + - + diff --git a/docs/test_cases/t20035_sequence_mermaid.svg b/docs/test_cases/t20035_sequence_mermaid.svg new file mode 100644 index 00000000..f56672df --- /dev/null +++ b/docs/test_cases/t20035_sequence_mermaid.svg @@ -0,0 +1,106 @@ + + + + + c(int) + + + + + + b1(int) + + + + + + a(int) + + + + + + tmain(int,char **) + + + + + + + + c(int) + + + + + + + + + b1(int) + + + + + + + + + a(int) + + + + + + + + + tmain(int,char **) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ​ + + ​ + + ​ + + diff --git a/docs/test_cases/t20036.md b/docs/test_cases/t20036.md index 32ca367e..74179e91 100644 --- a/docs/test_cases/t20036.md +++ b/docs/test_cases/t20036.md @@ -64,15 +64,17 @@ struct D { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t20036_sequence](./t20036_sequence.svg "Test case for rendering all call chains leading to an activity (to)") +## Generated Mermaid diagrams +![t20036_sequence](./t20036_sequence_mermaid.svg "Test case for rendering all call chains leading to an activity (to)") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t20036_sequence", @@ -129,17 +131,65 @@ struct D { "messages": [ { "from": { - "activity_id": "1523531372012294984", - "activity_name": "clanguml::t20036::C::c3()", + "activity_id": "1742507735898803374", + "activity_name": "clanguml::t20036::C::c1()", "participant_id": "589458700000736705" }, + "name": "b1()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 17, + "file": "../../tests/t20036/t20036.cc", + "line": 20, + "translation_unit": "../../tests/t20036/t20036.cc" + }, + "to": { + "activity_id": "203660950902052846", + "activity_name": "clanguml::t20036::B::b1()", + "participant_id": "607147607288902300" + }, + "type": "message" + }, + { + "from": { + "activity_id": "203660950902052846", + "activity_name": "clanguml::t20036::B::b1()", + "participant_id": "607147607288902300" + }, + "name": "a2()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 17, + "file": "../../tests/t20036/t20036.cc", + "line": 12, + "translation_unit": "../../tests/t20036/t20036.cc" + }, + "to": { + "activity_id": "2124074228514438863", + "activity_name": "clanguml::t20036::A::a2()", + "participant_id": "399722216848214287" + }, + "type": "message" + } + ] + }, + { + "messages": [ + { + "from": { + "activity_id": "701488875613014930", + "activity_name": "clanguml::t20036::D::d1()", + "participant_id": "847434467114564641" + }, "name": "c2()", "return_type": "void", "scope": "normal", "source_location": { - "column": 13, + "column": 17, "file": "../../tests/t20036/t20036.cc", - "line": 27, + "line": 36, "translation_unit": "../../tests/t20036/t20036.cc" }, "to": { @@ -195,54 +245,6 @@ struct D { } ] }, - { - "messages": [ - { - "from": { - "activity_id": "1735839766717973272", - "activity_name": "clanguml::t20036::C::c4()", - "participant_id": "589458700000736705" - }, - "name": "b2()", - "return_type": "void", - "scope": "normal", - "source_location": { - "column": 17, - "file": "../../tests/t20036/t20036.cc", - "line": 30, - "translation_unit": "../../tests/t20036/t20036.cc" - }, - "to": { - "activity_id": "1726094580455938498", - "activity_name": "clanguml::t20036::B::b2()", - "participant_id": "607147607288902300" - }, - "type": "message" - }, - { - "from": { - "activity_id": "1726094580455938498", - "activity_name": "clanguml::t20036::B::b2()", - "participant_id": "607147607288902300" - }, - "name": "a2()", - "return_type": "void", - "scope": "normal", - "source_location": { - "column": 17, - "file": "../../tests/t20036/t20036.cc", - "line": 13, - "translation_unit": "../../tests/t20036/t20036.cc" - }, - "to": { - "activity_id": "2124074228514438863", - "activity_name": "clanguml::t20036::A::a2()", - "participant_id": "399722216848214287" - }, - "type": "message" - } - ] - }, { "messages": [ { @@ -273,17 +275,65 @@ struct D { "messages": [ { "from": { - "activity_id": "701488875613014930", - "activity_name": "clanguml::t20036::D::d1()", - "participant_id": "847434467114564641" + "activity_id": "1735839766717973272", + "activity_name": "clanguml::t20036::C::c4()", + "participant_id": "589458700000736705" }, - "name": "c2()", + "name": "b2()", "return_type": "void", "scope": "normal", "source_location": { "column": 17, "file": "../../tests/t20036/t20036.cc", - "line": 36, + "line": 30, + "translation_unit": "../../tests/t20036/t20036.cc" + }, + "to": { + "activity_id": "1726094580455938498", + "activity_name": "clanguml::t20036::B::b2()", + "participant_id": "607147607288902300" + }, + "type": "message" + }, + { + "from": { + "activity_id": "1726094580455938498", + "activity_name": "clanguml::t20036::B::b2()", + "participant_id": "607147607288902300" + }, + "name": "a2()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 17, + "file": "../../tests/t20036/t20036.cc", + "line": 13, + "translation_unit": "../../tests/t20036/t20036.cc" + }, + "to": { + "activity_id": "2124074228514438863", + "activity_name": "clanguml::t20036::A::a2()", + "participant_id": "399722216848214287" + }, + "type": "message" + } + ] + }, + { + "messages": [ + { + "from": { + "activity_id": "1523531372012294984", + "activity_name": "clanguml::t20036::C::c3()", + "participant_id": "589458700000736705" + }, + "name": "c2()", + "return_type": "void", + "scope": "normal", + "source_location": { + "column": 13, + "file": "../../tests/t20036/t20036.cc", + "line": 27, "translation_unit": "../../tests/t20036/t20036.cc" }, "to": { @@ -408,54 +458,6 @@ struct D { "type": "message" } ] - }, - { - "messages": [ - { - "from": { - "activity_id": "1742507735898803374", - "activity_name": "clanguml::t20036::C::c1()", - "participant_id": "589458700000736705" - }, - "name": "b1()", - "return_type": "void", - "scope": "normal", - "source_location": { - "column": 17, - "file": "../../tests/t20036/t20036.cc", - "line": 20, - "translation_unit": "../../tests/t20036/t20036.cc" - }, - "to": { - "activity_id": "203660950902052846", - "activity_name": "clanguml::t20036::B::b1()", - "participant_id": "607147607288902300" - }, - "type": "message" - }, - { - "from": { - "activity_id": "203660950902052846", - "activity_name": "clanguml::t20036::B::b1()", - "participant_id": "607147607288902300" - }, - "name": "a2()", - "return_type": "void", - "scope": "normal", - "source_location": { - "column": 17, - "file": "../../tests/t20036/t20036.cc", - "line": 12, - "translation_unit": "../../tests/t20036/t20036.cc" - }, - "to": { - "activity_id": "2124074228514438863", - "activity_name": "clanguml::t20036::A::a2()", - "participant_id": "399722216848214287" - }, - "type": "message" - } - ] } ], "to": { diff --git a/docs/test_cases/t20036_sequence.svg b/docs/test_cases/t20036_sequence.svg index a9b86b38..f1a32b05 100644 --- a/docs/test_cases/t20036_sequence.svg +++ b/docs/test_cases/t20036_sequence.svg @@ -1,6 +1,6 @@ - + @@ -13,131 +13,131 @@ - - + + C - + C - - + + B - + B - - + + A - + A - - + + D - + D - c3() - - - - - - c2() + c1() + + + + b1() - - - - b2() + + + + a2() - - - - a2() + + + + + + d1() + + + + c2() - - - - - - c4() - - - - b2() + + + + b2() - - - - a2() + + + + a2() - - - - - - d3() - - - - a2() + + + + + + d3() + + + + a2() - - - - - - d1() - - - - c2() + + + + + + c4() + + + + b2() - - - - b2() + + + + a2() - - - - a2() + + + + + + c3() + + + + + + c2() - - - - - - d2() - - - - c2() + + + + b2() - - - - b2() + + + + a2() - - - - a2() + + + + + + d2() + + + + c2() - - - - - - c1() - + - b1() + b2() - + a2() diff --git a/docs/test_cases/t20036_sequence_mermaid.svg b/docs/test_cases/t20036_sequence_mermaid.svg new file mode 100644 index 00000000..22edc641 --- /dev/null +++ b/docs/test_cases/t20036_sequence_mermaid.svg @@ -0,0 +1,155 @@ + + + + + D + + + + + + A + + + + + + B + + + + + + * + + + + + + C + + + + + + + + D + + + + + + + + + A + + + + + + + + + B + + + + + + + + + * + + + + + + + + + C + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + c1() + + b1() + + a2() + + d1() + + c2() + + b2() + + a2() + + d3() + + a2() + + c4() + + b2() + + a2() + + c3() + + c2() + + b2() + + a2() + + d2() + + c2() + + b2() + + a2() + + diff --git a/docs/test_cases/t30001.md b/docs/test_cases/t30001.md index 8006c1b7..f2faafa3 100644 --- a/docs/test_cases/t30001.md +++ b/docs/test_cases/t30001.md @@ -56,8 +56,10 @@ namespace BB { } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t30001_package](./t30001_package.svg "Basic package diagram test case") +## Generated Mermaid diagrams +![t30001_package](./t30001_package_mermaid.svg "Basic package diagram test case") ## Generated JSON models ```json { @@ -239,8 +241,8 @@ namespace BB { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t30001_package", diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index 0e6e77d6..2a1765af 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -9,63 +9,63 @@ - - + + A - - + + AA - - + + B - - + + AA - - + + AAA - - + + BBB - - + + BB - - + + AAA - - + + BBB - - + + BB - + A AAA note... - + This is namespace AA in namespace A - + This is namespace AA in namespace B diff --git a/docs/test_cases/t30001_package_mermaid.svg b/docs/test_cases/t30001_package_mermaid.svg new file mode 100644 index 00000000..852d0490 --- /dev/null +++ b/docs/test_cases/t30001_package_mermaid.svg @@ -0,0 +1 @@ +
B
AA
AAA
BBB
BB
A
AA
AAA
BBB
BB
\ No newline at end of file diff --git a/docs/test_cases/t30002.md b/docs/test_cases/t30002.md index 5e53ed7f..d696f817 100644 --- a/docs/test_cases/t30002.md +++ b/docs/test_cases/t30002.md @@ -143,8 +143,10 @@ template std::map> cm() } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t30002_package](./t30002_package.svg "Package dependency test case") +## Generated Mermaid diagrams +![t30002_package](./t30002_package_mermaid.svg "Package dependency test case") ## Generated JSON models ```json { @@ -487,8 +489,8 @@ template std::map> cm() } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t30002_package", diff --git a/docs/test_cases/t30002_package.svg b/docs/test_cases/t30002_package.svg index 848b1352..7d3a56da 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,118 +9,118 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + A16 - - + + A17 - - + + A18 - - + + BBB diff --git a/docs/test_cases/t30002_package_mermaid.svg b/docs/test_cases/t30002_package_mermaid.svg new file mode 100644 index 00000000..56382431 --- /dev/null +++ b/docs/test_cases/t30002_package_mermaid.svg @@ -0,0 +1 @@ +
B
A
BB
AA
BBB
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A13
A14
A15
A16
A17
A18
\ No newline at end of file diff --git a/docs/test_cases/t30003.md b/docs/test_cases/t30003.md index 09d30327..babd591e 100644 --- a/docs/test_cases/t30003.md +++ b/docs/test_cases/t30003.md @@ -48,8 +48,10 @@ class B : public ns1::ns2::Anon { }; } // namespace t30003 } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t30003_package](./t30003_package.svg "Package deprecated attribute test case") +## Generated Mermaid diagrams +![t30003_package](./t30003_package_mermaid.svg "Package deprecated attribute test case") ## Generated JSON models ```json { @@ -169,8 +171,8 @@ class B : public ns1::ns2::Anon { }; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t30003_package", diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index 9d3ad2cc..79b28858 100644 --- a/docs/test_cases/t30003_package.svg +++ b/docs/test_cases/t30003_package.svg @@ -1,6 +1,6 @@ - + @@ -9,35 +9,35 @@ - - + + ns1 - - + + ns3 «deprecated» - - + + ns1 - - + + ns2_v1_0_0 - - + + ns2_v0_9_0 «deprecated» - - + + ns2 diff --git a/docs/test_cases/t30003_package_mermaid.svg b/docs/test_cases/t30003_package_mermaid.svg new file mode 100644 index 00000000..673e9942 --- /dev/null +++ b/docs/test_cases/t30003_package_mermaid.svg @@ -0,0 +1 @@ +
ns1
ns3
ns2_v1_0_0
ns2
ns2_v0_9_0
\ No newline at end of file diff --git a/docs/test_cases/t30004.md b/docs/test_cases/t30004.md index 2303e078..f72e4147 100644 --- a/docs/test_cases/t30004.md +++ b/docs/test_cases/t30004.md @@ -56,8 +56,10 @@ namespace CCC { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t30004_package](./t30004_package.svg "PlantUML package decorators test case") +## Generated Mermaid diagrams +![t30004_package](./t30004_package_mermaid.svg "PlantUML package decorators test case") ## Generated JSON models ```json { @@ -180,8 +182,8 @@ namespace CCC { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t30004_package", diff --git a/docs/test_cases/t30004_package.svg b/docs/test_cases/t30004_package.svg index 5d90b82e..02ca4a35 100644 --- a/docs/test_cases/t30004_package.svg +++ b/docs/test_cases/t30004_package.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - + Package AAA. - + Package BBB. - + CCCC package note. - + We skipped DDD. - - + + AAA - - + + BBB - - + + CCC - - + + EEE diff --git a/docs/test_cases/t30004_package_mermaid.svg b/docs/test_cases/t30004_package_mermaid.svg new file mode 100644 index 00000000..35259c3a --- /dev/null +++ b/docs/test_cases/t30004_package_mermaid.svg @@ -0,0 +1 @@ +
A
AAA
Package AAA.
Package BBB.
BBB
CCCC package note.
CCC
We skipped DDD.
EEE
\ No newline at end of file diff --git a/docs/test_cases/t30005.md b/docs/test_cases/t30005.md index 2231e69f..c466ed22 100644 --- a/docs/test_cases/t30005.md +++ b/docs/test_cases/t30005.md @@ -48,8 +48,10 @@ struct C2 { } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t30005_package](./t30005_package.svg "Package namespace alias test case") +## Generated Mermaid diagrams +![t30005_package](./t30005_package_mermaid.svg "Package namespace alias test case") ## Generated JSON models ```json { @@ -214,8 +216,8 @@ struct C2 { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t30005_package", diff --git a/docs/test_cases/t30005_package.svg b/docs/test_cases/t30005_package.svg index 866752fd..e57b27ff 100644 --- a/docs/test_cases/t30005_package.svg +++ b/docs/test_cases/t30005_package.svg @@ -1,6 +1,6 @@ - + @@ -9,48 +9,48 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + C - - + + CC - - + + AAA - - + + BBB - - + + CCC diff --git a/docs/test_cases/t30005_package_mermaid.svg b/docs/test_cases/t30005_package_mermaid.svg new file mode 100644 index 00000000..b1188274 --- /dev/null +++ b/docs/test_cases/t30005_package_mermaid.svg @@ -0,0 +1 @@ +
C
B
A
CC
BB
AA
CCC
BBB
AAA
\ No newline at end of file diff --git a/docs/test_cases/t30006.md b/docs/test_cases/t30006.md index 62c2fcb4..aff0dee5 100644 --- a/docs/test_cases/t30006.md +++ b/docs/test_cases/t30006.md @@ -48,8 +48,10 @@ struct A2 { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t30006_package](./t30006_package.svg "Package split namespace test case") +## Generated Mermaid diagrams +![t30006_package](./t30006_package_mermaid.svg "Package split namespace test case") ## Generated JSON models ```json { @@ -128,8 +130,8 @@ struct A2 { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t30006_package", diff --git a/docs/test_cases/t30006_package.svg b/docs/test_cases/t30006_package.svg index ecef1104..8801d95e 100644 --- a/docs/test_cases/t30006_package.svg +++ b/docs/test_cases/t30006_package.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - + + B - - + + A - - + + C - + Top A note. diff --git a/docs/test_cases/t30006_package_mermaid.svg b/docs/test_cases/t30006_package_mermaid.svg new file mode 100644 index 00000000..d5456be9 --- /dev/null +++ b/docs/test_cases/t30006_package_mermaid.svg @@ -0,0 +1 @@ +
Top A note.
A
B
C
\ No newline at end of file diff --git a/docs/test_cases/t30007.md b/docs/test_cases/t30007.md index 88407edb..da096382 100644 --- a/docs/test_cases/t30007.md +++ b/docs/test_cases/t30007.md @@ -56,8 +56,10 @@ struct A2 { } } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t30007_package](./t30007_package.svg "Package diagram layout hints test case") +## Generated Mermaid diagrams +![t30007_package](./t30007_package_mermaid.svg "Package diagram layout hints test case") ## Generated JSON models ```json { @@ -151,8 +153,8 @@ struct A2 { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t30007_package", diff --git a/docs/test_cases/t30007_package.svg b/docs/test_cases/t30007_package.svg index f765832b..d6438159 100644 --- a/docs/test_cases/t30007_package.svg +++ b/docs/test_cases/t30007_package.svg @@ -1,6 +1,6 @@ - + @@ -9,27 +9,27 @@ - - + + A - - + + B - - + + AA - - + + C - + Compare layout with t30006. diff --git a/docs/test_cases/t30007_package_mermaid.svg b/docs/test_cases/t30007_package_mermaid.svg new file mode 100644 index 00000000..3f233bd2 --- /dev/null +++ b/docs/test_cases/t30007_package_mermaid.svg @@ -0,0 +1 @@ +
A
AA
Compare layout with t30006.
B
C
\ No newline at end of file diff --git a/docs/test_cases/t30008.md b/docs/test_cases/t30008.md index c6b305da..98045c7f 100644 --- a/docs/test_cases/t30008.md +++ b/docs/test_cases/t30008.md @@ -66,8 +66,10 @@ struct FF { } // namespace t30008 } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t30008_package](./t30008_package.svg "Dependants and dependencies package diagram filter test") +## Generated Mermaid diagrams +![t30008_package](./t30008_package_mermaid.svg "Dependants and dependencies package diagram filter test") ## Generated JSON models ```json { @@ -211,8 +213,8 @@ struct FF { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t30008_package", diff --git a/docs/test_cases/t30008_package.svg b/docs/test_cases/t30008_package.svg index 743da6ce..dca2d131 100644 --- a/docs/test_cases/t30008_package.svg +++ b/docs/test_cases/t30008_package.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - - + + dependants - - + + dependencies - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F diff --git a/docs/test_cases/t30008_package_mermaid.svg b/docs/test_cases/t30008_package_mermaid.svg new file mode 100644 index 00000000..43c5c8f5 --- /dev/null +++ b/docs/test_cases/t30008_package_mermaid.svg @@ -0,0 +1 @@ +
dependencies
D
E
F
dependants
A
B
C
\ No newline at end of file diff --git a/docs/test_cases/t30009.md b/docs/test_cases/t30009.md index 2e1eea17..1430109c 100644 --- a/docs/test_cases/t30009.md +++ b/docs/test_cases/t30009.md @@ -46,8 +46,10 @@ namespace D { } ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t30009_package](./t30009_package.svg "Together layout hint test") +## Generated Mermaid diagrams +![t30009_package](./t30009_package_mermaid.svg "Together layout hint test") ## Generated JSON models ```json { @@ -217,8 +219,8 @@ namespace D { } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t30009_package", diff --git a/docs/test_cases/t30009_package.svg b/docs/test_cases/t30009_package.svg index d13e74cb..ea607186 100644 --- a/docs/test_cases/t30009_package.svg +++ b/docs/test_cases/t30009_package.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - + + One - - + + Two - - + + B - - + + D - - + + A - - + + C - - + + A - - + + B - - + + C - - + + D diff --git a/docs/test_cases/t30009_package_mermaid.svg b/docs/test_cases/t30009_package_mermaid.svg new file mode 100644 index 00000000..f264109b --- /dev/null +++ b/docs/test_cases/t30009_package_mermaid.svg @@ -0,0 +1 @@ +
Two
A
B
C
D
One
B
D
A
C
\ No newline at end of file diff --git a/docs/test_cases/t30010.md b/docs/test_cases/t30010.md index d46dceba..f3dab758 100644 --- a/docs/test_cases/t30010.md +++ b/docs/test_cases/t30010.md @@ -32,8 +32,10 @@ App app; } // namespace clanguml ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t30010_package](./t30010_package.svg "Package diagram with packages from directory structure") +## Generated Mermaid diagrams +![t30010_package](./t30010_package_mermaid.svg "Package diagram with packages from directory structure") ## Generated JSON models ```json { @@ -85,8 +87,8 @@ App app; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t30010_package", diff --git a/docs/test_cases/t30010_package_mermaid.svg b/docs/test_cases/t30010_package_mermaid.svg new file mode 100644 index 00000000..b00c9104 --- /dev/null +++ b/docs/test_cases/t30010_package_mermaid.svg @@ -0,0 +1 @@ +
libraries
lib1
lib2
lib3
lib4
app
\ No newline at end of file diff --git a/docs/test_cases/t30011.md b/docs/test_cases/t30011.md index ad929ae9..35c0399e 100644 --- a/docs/test_cases/t30011.md +++ b/docs/test_cases/t30011.md @@ -22,8 +22,10 @@ File t30011.c struct t30011_App app; ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t30011_package](./t30011_package.svg "Package diagram with packages from directory structure for plain C") +## Generated Mermaid diagrams +![t30011_package](./t30011_package_mermaid.svg "Package diagram with packages from directory structure for plain C") ## Generated JSON models ```json { @@ -75,8 +77,8 @@ struct t30011_App app; } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t30011_package", diff --git a/docs/test_cases/t30011_package_mermaid.svg b/docs/test_cases/t30011_package_mermaid.svg new file mode 100644 index 00000000..b00c9104 --- /dev/null +++ b/docs/test_cases/t30011_package_mermaid.svg @@ -0,0 +1 @@ +
libraries
lib1
lib2
lib3
lib4
app
\ No newline at end of file diff --git a/docs/test_cases/t40001.md b/docs/test_cases/t40001.md index bb63aacf..cae2696f 100644 --- a/docs/test_cases/t40001.md +++ b/docs/test_cases/t40001.md @@ -24,10 +24,16 @@ diagrams: after: - 'note right of {{ alias("include/lib1") }}: This is a lib1 include dir' - 'note right of {{ alias("include/t40001_include1.h") }}: This is a t40001_include1.h include file' + mermaid: + after: + - 'N_00001(This is a lib1 include dir)-.-{{ alias("include/lib1") }}' + - 'N_00002(This is a lib1 include dir)-.-{{ alias("include/t40001_include1.h") }}' ``` ## Source code -## Generated UML diagrams +## Generated PlantUML diagrams ![t40001_include](./t40001_include.svg "Basic include graph diagram test case") +## Generated Mermaid diagrams +![t40001_include](./t40001_include_mermaid.svg "Basic include graph diagram test case") ## Generated JSON models ```json { @@ -101,8 +107,8 @@ diagrams: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t40001_include", diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index cbbc804d..e949b94a 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - + src - + include - + lib1 - - + + t40001.cc - - + + t40001_include1.h - - + + lib1.h - + string - + vector - + yaml-cpp/yaml.h - + This is a lib1 include dir - + This is a t40001_include1.h include file diff --git a/docs/test_cases/t40001_include_mermaid.svg b/docs/test_cases/t40001_include_mermaid.svg new file mode 100644 index 00000000..db0830db --- /dev/null +++ b/docs/test_cases/t40001_include_mermaid.svg @@ -0,0 +1 @@ +
include
src
lib1
t40001_include1.h
lib1.h
t40001.cc
string
vector
yaml-cpp/yaml.h
This is a lib1 include dir
This is a lib1 include dir
\ No newline at end of file diff --git a/docs/test_cases/t40002.md b/docs/test_cases/t40002.md index 78585bb8..15a0c02d 100644 --- a/docs/test_cases/t40002.md +++ b/docs/test_cases/t40002.md @@ -27,8 +27,10 @@ diagrams: - "' t40002 test include diagram" ``` ## Source code -## Generated UML diagrams +## Generated PlantUML diagrams ![t40002_include](./t40002_include.svg "Cyclic include graph diagram test case") +## Generated Mermaid diagrams +![t40002_include](./t40002_include_mermaid.svg "Cyclic include graph diagram test case") ## Generated JSON models ```json { @@ -119,8 +121,8 @@ diagrams: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t40002_include", diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index 2755b479..0d1f74de 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - + src - + lib1 - + lib2 - + include - + lib1 - + lib2 - - + + t40002.cc - - + + lib1.cc - - + + lib2.cc - - + + lib1.h - - + + lib2.h diff --git a/docs/test_cases/t40002_include_mermaid.svg b/docs/test_cases/t40002_include_mermaid.svg new file mode 100644 index 00000000..6373a988 --- /dev/null +++ b/docs/test_cases/t40002_include_mermaid.svg @@ -0,0 +1 @@ +
include
src
lib1
lib2
lib1
lib2
lib2.h
lib1.h
t40002.cc
lib2.cc
lib1.cc
\ No newline at end of file diff --git a/docs/test_cases/t40003.md b/docs/test_cases/t40003.md index 0e6349e7..08d9074d 100644 --- a/docs/test_cases/t40003.md +++ b/docs/test_cases/t40003.md @@ -25,8 +25,10 @@ diagrams: - "' t40003 test include diagram" ``` ## Source code -## Generated UML diagrams +## Generated PlantUML diagrams ![t40003_include](./t40003_include.svg "Dependants and dependencies include diagram filter test") +## Generated Mermaid diagrams +![t40003_include](./t40003_include_mermaid.svg "Dependants and dependencies include diagram filter test") ## Generated JSON models ```json { @@ -145,8 +147,8 @@ diagrams: } ], "metadata": { - "clang_uml_version": "0.3.8-32-ge830195", - "llvm_version": "Ubuntu clang version 15.0.7", + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, "name": "t40003_include", diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index 10c317c6..8a548f14 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,66 +9,66 @@ - + src - + dependants - + dependencies - + include - + dependants - + dependencies - - + + t1.cc - - + + t2.cc - - + + t3.h - - + + t2.h - - + + t1.h - - + + t3.h - - + + t2.h - - + + t1.h - - + + t5.h diff --git a/docs/test_cases/t40003_include_mermaid.svg b/docs/test_cases/t40003_include_mermaid.svg new file mode 100644 index 00000000..a6907de6 --- /dev/null +++ b/docs/test_cases/t40003_include_mermaid.svg @@ -0,0 +1 @@ +
include
src
dependants
dependencies
dependants
dependencies
t3.h
t2.h
t1.h
t5.h
t3.h
t2.h
t1.h
t2.cc
t1.cc
\ No newline at end of file diff --git a/docs/test_cases/t90000.md b/docs/test_cases/t90000.md index aca68865..4ae6d9c9 100644 --- a/docs/test_cases/t90000.md +++ b/docs/test_cases/t90000.md @@ -21,6 +21,18 @@ diagrams: - 'class "Boo" as C_002' - 'class C_002 {' - '}' + mermaid: + before: + - 'class C_001["Foo"]' + - 'class C_001 {' + - ' +int value' + - '}' + - 'C_001 <|-- ArrayList' + - 'note for C_001 "This is a very important class."' + - 'note "This is a\nfloating note"' + - 'class C_002["Boo"]' + - 'class C_002 {' + - '}' ``` ## Source code @@ -28,6 +40,21 @@ File t90000.cc ```cpp ``` -## Generated UML diagrams +## Generated PlantUML diagrams ![t90000_class](./t90000_class.svg "Basic config test") +## Generated Mermaid diagrams +![t90000_class](./t90000_class_mermaid.svg "Basic config test") ## Generated JSON models +```json +{ + "diagram_type": "class", + "elements": [], + "metadata": { + "clang_uml_version": "0.3.9-11-g4a19c8b", + "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", + "schema_version": 1 + }, + "name": "t90000_class", + "relationships": [] +} +``` diff --git a/docs/test_cases/t90000_class_mermaid.svg b/docs/test_cases/t90000_class_mermaid.svg new file mode 100644 index 00000000..41704b50 --- /dev/null +++ b/docs/test_cases/t90000_class_mermaid.svg @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + +
+ +
+
+ +
+ Foo +
+
+ +
+ +int value +
+
+
+
+ + + + + + +
+ +
+
+ +
+ ArrayList +
+
+
+
+ + + + + + +
+ +
+
+ +
+ Boo +
+
+
+
+ + + + + +
+ This is a very important class. +
+
+
+
+ + + + + +
+ This is a
floating note
+
+
+
+
+
+
+
+
diff --git a/util/format_svg.py b/util/format_svg.py index 32904cea..0b2f24f6 100755 --- a/util/format_svg.py +++ b/util/format_svg.py @@ -37,8 +37,10 @@ def main(argv): tree = etree.fromstring(bytes(xml, encoding='utf8')) # Add style color for links - defs = tree.xpath('//svg:defs', namespaces={'svg':'http://www.w3.org/2000/svg'})[0] - style = etree.SubElement(defs, 'style') + defs = tree.xpath('//svg:defs', namespaces={'svg':'http://www.w3.org/2000/svg'}) + if not defs: + continue + style = etree.SubElement(defs[0], 'style') style.text = 'a:hover { text-decoration: underline; }' style.set('type', 'text/css') diff --git a/util/generate_mermaid.py b/util/generate_mermaid.py index a7843dd3..45e6366a 100644 --- a/util/generate_mermaid.py +++ b/util/generate_mermaid.py @@ -20,12 +20,28 @@ import sys import subprocess +from concurrent.futures import ThreadPoolExecutor from pathlib import Path def print_usage(): print(f'Usage: ./generate_mermaid.py file1.mmd file2.mmd ...') +def generate_mermaid_diagram(f): + try: + print(f'Generating Mermaid diagram from {f}') + f_svg = Path(f).with_suffix('.svg').name + target = Path(f).parent.absolute() + target = target.joinpath('mermaid') + target = target.joinpath(f_svg) + subprocess.check_call(['mmdc', '-i', f, '-o', target]) + except subprocess.CalledProcessError: + print(f'ERROR: Generating Mermaid diagram from {f} failed') + return False + + return True + + files = sys.argv[1:] @@ -35,16 +51,9 @@ if not files: ok = 0 -for f in files: - try: - print(f'Generating Mermaid diagram from {f}') - f_svg = Path(f).with_suffix('.svg').name - target = Path(f).parent.absolute() - target = target.joinpath('mermaid') - target = target.joinpath(f_svg) - subprocess.check_call(['mmdc', '-i', f, '-o', target]) - except subprocess.CalledProcessError: - ok = 1 - print(f'ERROR: Generating Mermaid diagram from {f} failed') + +with ThreadPoolExecutor(max_workers=10) as executor: + result = all(executor.map(generate_mermaid_diagram, files)) + sys.exit(ok) From de5625a4741778245def1563ae9378b934b3a030 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sun, 10 Sep 2023 13:26:58 +0200 Subject: [PATCH 12/24] Fixed Mermaid SVG image width attribute --- Makefile | 2 +- util/format_svg.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f87939cb..e776c9bd 100644 --- a/Makefile +++ b/Makefile @@ -157,7 +157,7 @@ docs: doxygen: docs cp CONTRIBUTING.md docs/contributing.md cp CHANGELOG.md docs/changelog.md - cp docs/diagrams/*.svg docs/doxygen/html/ + cp docs/diagrams/plantuml/*.svg docs/doxygen/html/ mkdir -p docs/doxygen/html/test_cases cp docs/test_cases/*.svg docs/doxygen/html/test_cases/ ../doxygen/_build/bin/doxygen diff --git a/util/format_svg.py b/util/format_svg.py index 0b2f24f6..dd244066 100755 --- a/util/format_svg.py +++ b/util/format_svg.py @@ -36,6 +36,10 @@ def main(argv): # Parse SVG XML tree = etree.fromstring(bytes(xml, encoding='utf8')) + if not tree.attrib['width'] or tree.attrib['width'].endswith('%'): + # Make sure the width is equal to the viewBox width + tree.attrib['width'] = tree.attrib['viewBox'].split(' ')[2] + # Add style color for links defs = tree.xpath('//svg:defs', namespaces={'svg':'http://www.w3.org/2000/svg'}) if not defs: From eb00cd21c34487dfaa1d97cbaec2a210b6303738 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 12 Sep 2023 00:55:05 +0200 Subject: [PATCH 13/24] Added mermaid test cases for class diagrams --- docs/test_cases/t00002_class_mermaid.svg | 2 +- .../mermaid/class_diagram_generator.cc | 90 ++++-- src/common/generators/mermaid/generator.cc | 2 +- tests/catch.h | 7 +- tests/t00002/test_case.h | 35 +++ tests/t00003/test_case.h | 40 +++ tests/t00004/test_case.h | 26 ++ tests/t00005/test_case.h | 32 +++ tests/t00006/test_case.h | 122 +++++--- tests/t00007/test_case.h | 39 ++- tests/t00008/test_case.h | 61 ++-- tests/t00009/test_case.h | 64 +++-- tests/t00010/test_case.h | 49 ++-- tests/t00011/test_case.h | 35 ++- tests/t00012/test_case.h | 38 ++- tests/t00013/test_case.h | 86 ++++-- tests/t00014/test_case.h | 247 +++++++++++----- tests/t00015/test_case.h | 32 ++- tests/t00016/test_case.h | 52 ++-- tests/t00017/test_case.h | 106 ++++--- tests/t00018/test_case.h | 33 ++- tests/t00019/test_case.h | 83 ++++-- tests/t00020/test_case.h | 45 +-- tests/t00021/test_case.h | 39 ++- tests/t00022/test_case.h | 26 +- tests/t00023/test_case.h | 27 +- tests/t00024/test_case.h | 39 ++- tests/t00025/test_case.h | 56 ++-- tests/t00026/test_case.h | 35 ++- tests/t00027/test_case.h | 67 +++-- tests/t00028/test_case.h | 65 +++-- tests/t00029/test_case.h | 65 +++-- tests/t00030/test_case.h | 47 ++-- tests/t00031/test_case.h | 40 +-- tests/t00032/test_case.h | 75 +++-- tests/t00033/test_case.h | 57 ++-- tests/t00034/test_case.h | 41 ++- tests/t00035/test_case.h | 40 +-- tests/t00036/test_case.h | 50 ++-- tests/t00037/test_case.h | 37 ++- tests/t00038/test_case.h | 111 ++++++-- tests/t00039/test_case.h | 92 ++++-- tests/t00040/test_case.h | 40 ++- tests/t00041/test_case.h | 91 ++++-- tests/t00042/test_case.h | 26 +- tests/t00043/test_case.h | 94 +++++-- tests/t00044/test_case.h | 65 +++-- tests/t00045/test_case.h | 83 ++++-- tests/t00046/test_case.h | 41 ++- tests/t00047/test_case.h | 32 ++- tests/t00048/test_case.h | 47 +++- tests/t00049/test_case.h | 60 ++-- tests/t00050/test_case.h | 56 ++-- tests/t00051/test_case.h | 82 ++++-- tests/t00052/test_case.h | 42 ++- tests/t00053/test_case.h | 61 ++-- tests/t00054/test_case.h | 72 +++-- tests/t00055/test_case.h | 64 +++-- tests/t00056/test_case.h | 159 ++++++++--- tests/t00057/test_case.h | 75 +++-- tests/t00058/test_case.h | 72 +++-- tests/t00059/test_case.h | 111 ++++++-- tests/t00060/test_case.h | 44 ++- tests/t00061/test_case.h | 27 +- tests/t00062/test_case.h | 137 ++++++--- tests/t00063/test_case.h | 27 +- tests/t00064/test_case.h | 100 +++++-- tests/t00065/test_case.h | 42 +-- tests/t00066/test_case.h | 94 +++++-- tests/t00067/test_case.h | 39 ++- tests/test_cases.h | 266 ++++++++++++++++++ 71 files changed, 3189 insertions(+), 1295 deletions(-) diff --git a/docs/test_cases/t00002_class_mermaid.svg b/docs/test_cases/t00002_class_mermaid.svg index 89855b06..c2e3f998 100644 --- a/docs/test_cases/t00002_class_mermaid.svg +++ b/docs/test_cases/t00002_class_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/src/class_diagram/generators/mermaid/class_diagram_generator.cc b/src/class_diagram/generators/mermaid/class_diagram_generator.cc index 59b69050..a142d6e8 100644 --- a/src/class_diagram/generators/mermaid/class_diagram_generator.cc +++ b/src/class_diagram/generators/mermaid/class_diagram_generator.cc @@ -236,7 +236,27 @@ void generator::generate_method( } ostr << ")"; - ostr << " : " << render_name(type); + ostr << " : "; + + std::vector method_mods; + if (m.is_defaulted()) { + method_mods.push_back("default"); + } + if (m.is_const()) { + method_mods.push_back("const"); + } + if (m.is_constexpr()) { + method_mods.push_back("constexpr"); + } + if (m.is_consteval()) { + method_mods.push_back("consteval"); + } + + if (!method_mods.empty()) { + ostr << fmt::format("[{}] ", fmt::join(method_mods, ",")); + } + + ostr << render_name(type); if (m.is_pure_virtual()) ostr << "*"; @@ -389,14 +409,15 @@ void generator::generate_relationships( try { destination = r.destination(); - std::string puml_relation; - if (!r.multiplicity_source().empty()) - puml_relation += "\"" + r.multiplicity_source() + "\" "; + std::string relation_str; - puml_relation += mermaid_common::to_mermaid(r.type(), r.style()); + if (!r.multiplicity_source().empty()) + relation_str += "\"" + r.multiplicity_source() + "\" "; + + relation_str += mermaid_common::to_mermaid(r.type(), r.style()); if (!r.multiplicity_destination().empty()) - puml_relation += " \"" + r.multiplicity_destination() + "\""; + relation_str += " \"" + r.multiplicity_destination() + "\""; std::string target_alias; try { @@ -411,17 +432,20 @@ void generator::generate_relationships( m_generated_aliases.end()) continue; - relstr << indent(1) << c.alias() << " " << puml_relation << " " - << target_alias; - - if (!r.label().empty()) { - relstr << " : " << mermaid_common::to_mermaid(r.access()) - << r.label(); - rendered_relations.emplace(r.label()); + if (r.type() == relationship_t::kContainment) { + relstr << indent(1) << target_alias << " " << relation_str + << " " << c.alias(); + } + else { + relstr << indent(1) << c.alias() << " " << relation_str << " " + << target_alias; } - if (r.type() == relationship_t::kContainment) { - relstr << " : [nested]\n"; + relstr << " : "; + + if (!r.label().empty()) { + relstr << mermaid_common::to_mermaid(r.access()) << r.label(); + rendered_relations.emplace(r.label()); } if (unique_relations.count(relstr.str()) == 0) { @@ -514,12 +538,19 @@ void generator::generate_relationships( m_generated_aliases.end()) continue; - relstr << indent(1) << c.alias() << " " << puml_relation << " " - << target_alias; + if (r.type() == relationship_t::kContainment) { + relstr << indent(1) << target_alias << " " << puml_relation + << " " << c.alias(); + } + else { + relstr << indent(1) << c.alias() << " " << puml_relation << " " + << target_alias; + } + + relstr << " : "; if (!r.label().empty()) { - relstr << " : " << mermaid_common::to_mermaid(r.access()) - << r.label(); + relstr << mermaid_common::to_mermaid(r.access()) << r.label(); rendered_relations.emplace(r.label()); } @@ -561,13 +592,20 @@ void generator::generate_relationships(const enum_ &e, std::ostream &ostr) const m_generated_aliases.end()) continue; - relstr << indent(1) << e.alias() << " " - << clanguml::common::generators::mermaid::to_mermaid( - r.type(), r.style()) - << " " << target_alias; + if (r.type() == relationship_t::kContainment) { + relstr << indent(1) << target_alias << " " + << clanguml::common::generators::mermaid::to_mermaid( + r.type(), r.style()) + << " " << e.alias(); + } + else { + relstr << indent(1) << e.alias() << " " + << clanguml::common::generators::mermaid::to_mermaid( + r.type(), r.style()) + << " " << target_alias; + } - if (!r.label().empty()) - relstr << " : " << r.label(); + relstr << " : " << r.label(); relstr << '\n'; @@ -589,7 +627,7 @@ void generator::generate(const enum_ &e, std::ostream &ostr) const ostr << " {" << '\n'; - ostr << indent(2) << "<>\n"; + ostr << indent(2) << "<>\n"; for (const auto &enum_constant : e.constants()) { ostr << indent(2) << enum_constant << '\n'; diff --git a/src/common/generators/mermaid/generator.cc b/src/common/generators/mermaid/generator.cc index d0ba2d08..f7b270c4 100644 --- a/src/common/generators/mermaid/generator.cc +++ b/src/common/generators/mermaid/generator.cc @@ -28,7 +28,7 @@ std::string to_mermaid(relationship_t r, const std::string & /*style*/) case relationship_t::kAggregation: return "o--"; case relationship_t::kContainment: - return "--"; + return "()--"; case relationship_t::kAssociation: return "-->"; case relationship_t::kInstantiation: diff --git a/tests/catch.h b/tests/catch.h index c3237aad..8e780a2d 100644 --- a/tests/catch.h +++ b/tests/catch.h @@ -13299,13 +13299,14 @@ RegexMatcher::RegexMatcher( bool RegexMatcher::match(std::string const &matchee) const { - auto flags = std::regex::ECMAScript; // ECMAScript is the default syntax - // option anyway + auto flags = std::regex::ECMAScript | + std::regex::multiline; // ECMAScript is the default syntax + // option anyway if (m_caseSensitivity == CaseSensitive::Choice::No) { flags |= std::regex::icase; } auto reg = std::regex(m_regex, flags); - return std::regex_match(matchee, reg); + return std::regex_search(matchee, reg); } std::string RegexMatcher::describe() const diff --git a/tests/t00002/test_case.h b/tests/t00002/test_case.h index b376de34..796e8ef2 100644 --- a/tests/t00002/test_case.h +++ b/tests/t00002/test_case.h @@ -109,6 +109,41 @@ TEST_CASE("t00002", "[test-case][class]") { auto mmd = generate_class_mermaid(diagram, *model); + mermaid::AliasMatcher _A(mmd); + + REQUIRE_THAT(mmd, StartsWith("classDiagram")); + REQUIRE_THAT(mmd, mermaid::IsAbstractClass(_A("A"))); + REQUIRE_THAT(mmd, IsClass(_A("B"))); + REQUIRE_THAT(mmd, IsClass(_A("C"))); + REQUIRE_THAT(mmd, IsClass(_A("D"))); + REQUIRE_THAT(mmd, IsBaseClass(_A("A"), _A("B"))); + REQUIRE_THAT(mmd, IsBaseClass(_A("A"), _A("C"))); + REQUIRE_THAT(mmd, IsBaseClass(_A("B"), _A("D"))); + REQUIRE_THAT(mmd, IsBaseClass(_A("C"), _A("D"))); + + REQUIRE_THAT(mmd, IsAssociation(_A("D"), _A("A"), "-as")); + + REQUIRE_THAT(mmd, (mermaid::IsMethod("foo_a"))); + REQUIRE_THAT(mmd, (mermaid::IsMethod("foo_c"))); + + // REQUIRE_THAT(mmd, HasNote(_A("A"), "left", "This is class + // A")); REQUIRE_THAT(mmd, HasNote(_A("B"), "top", "This is class + // B")); + + REQUIRE_THAT(mmd, + mermaid::HasLink(_A("A"), + fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" + "t00002/t00002.cc#L7", + clanguml::util::get_git_commit()), + "This is class A")); + + REQUIRE_THAT(mmd, + mermaid::HasLink(_A("B"), + fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" + "t00002/t00002.cc#L16", + clanguml::util::get_git_commit()), + "This is class B")); + save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } } \ No newline at end of file diff --git a/tests/t00003/test_case.h b/tests/t00003/test_case.h index 102ec684..d58bd6a1 100644 --- a/tests/t00003/test_case.h +++ b/tests/t00003/test_case.h @@ -96,6 +96,46 @@ TEST_CASE("t00003", "[test-case][class]") } { auto mmd = generate_class_mermaid(diagram, *model); + mermaid::AliasMatcher _A(mmd); + + REQUIRE_THAT(mmd, IsClass(_A("A"))); + + REQUIRE_THAT(mmd, !IsDependency(_A("A"), _A("A"))); + + REQUIRE_THAT(mmd, (mermaid::IsMethod("A"))); + REQUIRE_THAT( + mmd, (mermaid::IsMethod("A", "void", "A &&"))); + REQUIRE_THAT(mmd, + (mermaid::IsMethod("A", "void", "const A &"))); + + REQUIRE_THAT(mmd, (mermaid::IsMethod("~A"))); + + REQUIRE_THAT(mmd, (mermaid::IsMethod("basic_method"))); + REQUIRE_THAT( + mmd, (mermaid::IsMethod("static_method", "int"))); + REQUIRE_THAT(mmd, (mermaid::IsMethod("const_method"))); + REQUIRE_THAT(mmd, + (mermaid::IsMethod("default_int", "int", "int i = 12"))); + REQUIRE_THAT(mmd, + (mermaid::IsMethod("default_string", "std::string", + "int i, std::string s = \"abc\""))); + + REQUIRE_THAT(mmd, + (mermaid::IsMethod( + "size", "std::size_t"))); + + REQUIRE_THAT(mmd, (mermaid::IsMethod("protected_method"))); + REQUIRE_THAT(mmd, (mermaid::IsMethod("private_method"))); + + REQUIRE_THAT(mmd, (IsField("public_member", "int"))); + REQUIRE_THAT(mmd, (IsField("protected_member", "int"))); + REQUIRE_THAT(mmd, (IsField("private_member", "int"))); + REQUIRE_THAT(mmd, + (IsField("auto_member", "const unsigned long"))); + + REQUIRE_THAT(mmd, (IsField("a_", "int"))); + REQUIRE_THAT(mmd, (IsField("b_", "int"))); + REQUIRE_THAT(mmd, (IsField("c_", "int"))); save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } diff --git a/tests/t00004/test_case.h b/tests/t00004/test_case.h index 1fa72940..c0f54989 100644 --- a/tests/t00004/test_case.h +++ b/tests/t00004/test_case.h @@ -92,6 +92,32 @@ TEST_CASE("t00004", "[test-case][class]") } { auto mmd = generate_class_mermaid(diagram, *model); + mermaid::AliasMatcher _A(mmd); + + REQUIRE_THAT(mmd, IsClass(_A("A"))); + REQUIRE_THAT(mmd, IsClass(_A("A::AA"))); + REQUIRE_THAT(mmd, IsClass(_A("A::AA::AAA"))); + REQUIRE_THAT(mmd, mermaid::IsEnum(_A("B::AA"))); + REQUIRE_THAT(mmd, mermaid::IsEnum(_A("A::AA::Lights"))); + REQUIRE_THAT(mmd, mermaid::IsInnerClass(_A("A"), _A("A::AA"))); + REQUIRE_THAT(mmd, mermaid::IsInnerClass(_A("A::AA"), _A("A::AA::AAA"))); + REQUIRE_THAT( + mmd, mermaid::IsInnerClass(_A("A::AA"), _A("A::AA::Lights"))); + + REQUIRE_THAT(mmd, IsClass(_A("C"))); + REQUIRE_THAT(mmd, mermaid::IsInnerClass(_A("C"), _A("C::AA"))); + REQUIRE_THAT(mmd, mermaid::IsInnerClass(_A("C::AA"), _A("C::AA::AAA"))); + REQUIRE_THAT(mmd, mermaid::IsInnerClass(_A("C"), _A("C::CC"))); + REQUIRE_THAT(mmd, mermaid::IsInnerClass(_A("C::AA"), _A("C::AA::CCC"))); + + REQUIRE_THAT(mmd, mermaid::IsInnerClass(_A("C"), _A("C::B"))); + REQUIRE_THAT(mmd, IsAggregation(_A("C"), _A("C::B"), "+b_int")); + REQUIRE_THAT(mmd, !mermaid::IsInnerClass(_A("C"), _A("C::B"))); + REQUIRE_THAT(mmd, IsInstantiation(_A("C::B"), _A("C::B"))); + + REQUIRE_THAT(mmd, IsClass(_A("detail::D"))); + REQUIRE_THAT(mmd, IsClass(_A("detail::D::DD"))); + REQUIRE_THAT(mmd, mermaid::IsEnum(_A("detail::D::AA"))); save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } diff --git a/tests/t00005/test_case.h b/tests/t00005/test_case.h index 375bf307..7912b25d 100644 --- a/tests/t00005/test_case.h +++ b/tests/t00005/test_case.h @@ -101,6 +101,38 @@ TEST_CASE("t00005", "[test-case][class]") } { auto mmd = generate_class_mermaid(diagram, *model); + mermaid::AliasMatcher _A(mmd); + + REQUIRE_THAT(mmd, StartsWith("classDiagram")); + REQUIRE_THAT(mmd, IsClass(_A("A"))); + REQUIRE_THAT(mmd, IsClass(_A("B"))); + REQUIRE_THAT(mmd, IsClass(_A("C"))); + REQUIRE_THAT(mmd, IsClass(_A("D"))); + REQUIRE_THAT(mmd, IsClass(_A("E"))); + REQUIRE_THAT(mmd, IsClass(_A("F"))); + REQUIRE_THAT(mmd, IsClass(_A("G"))); + REQUIRE_THAT(mmd, IsClass(_A("H"))); + REQUIRE_THAT(mmd, IsClass(_A("I"))); + REQUIRE_THAT(mmd, IsClass(_A("J"))); + REQUIRE_THAT(mmd, IsClass(_A("K"))); + REQUIRE_THAT(mmd, IsClass(_A("R"))); + + REQUIRE_THAT(mmd, (IsField("some_int", "int"))); + REQUIRE_THAT(mmd, (IsField("some_int_pointer", "int *"))); + REQUIRE_THAT( + mmd, (IsField("some_int_pointer_pointer", "int **"))); + + REQUIRE_THAT(mmd, IsAggregation(_A("R"), _A("A"), "+a")); + REQUIRE_THAT(mmd, IsAssociation(_A("R"), _A("B"), "+b")); + REQUIRE_THAT(mmd, IsAssociation(_A("R"), _A("C"), "+c")); + REQUIRE_THAT(mmd, IsAssociation(_A("R"), _A("D"), "+d")); + REQUIRE_THAT(mmd, IsAssociation(_A("R"), _A("E"), "+e")); + REQUIRE_THAT(mmd, IsAggregation(_A("R"), _A("F"), "+f")); + REQUIRE_THAT(mmd, IsAssociation(_A("R"), _A("G"), "+g")); + REQUIRE_THAT(mmd, IsAssociation(_A("R"), _A("H"), "+h")); + REQUIRE_THAT(mmd, IsAssociation(_A("R"), _A("I"), "+i")); + REQUIRE_THAT(mmd, IsAssociation(_A("R"), _A("J"), "+j")); + REQUIRE_THAT(mmd, IsAssociation(_A("R"), _A("K"), "+k")); save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); } diff --git a/tests/t00006/test_case.h b/tests/t00006/test_case.h index dc676dac..2c28e1c1 100644 --- a/tests/t00006/test_case.h +++ b/tests/t00006/test_case.h @@ -29,51 +29,51 @@ TEST_CASE("t00006", "[test-case][class]") REQUIRE(model->name() == "t00006_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClass(_A("E"))); - REQUIRE_THAT(puml, IsClass(_A("F"))); - REQUIRE_THAT(puml, IsClass(_A("G"))); - REQUIRE_THAT(puml, IsClass(_A("H"))); - REQUIRE_THAT(puml, IsClass(_A("I"))); - REQUIRE_THAT(puml, IsClass(_A("J"))); - REQUIRE_THAT(puml, IsClass(_A("K"))); - REQUIRE_THAT(puml, IsClass(_A("L"))); - REQUIRE_THAT(puml, IsClass(_A("M"))); - REQUIRE_THAT(puml, IsClass(_A("N"))); - REQUIRE_THAT(puml, IsClass(_A("NN"))); - REQUIRE_THAT(puml, IsClass(_A("NNN"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("G"))); + REQUIRE_THAT(src, IsClass(_A("H"))); + REQUIRE_THAT(src, IsClass(_A("I"))); + REQUIRE_THAT(src, IsClass(_A("J"))); + REQUIRE_THAT(src, IsClass(_A("K"))); + REQUIRE_THAT(src, IsClass(_A("L"))); + REQUIRE_THAT(src, IsClass(_A("M"))); + REQUIRE_THAT(src, IsClass(_A("N"))); + REQUIRE_THAT(src, IsClass(_A("NN"))); + REQUIRE_THAT(src, IsClass(_A("NNN"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation( _A("custom_container"), _A("custom_container"))); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("A"), "+a")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("B"), "+b")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("C"), "+c")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("D"), "+d")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("A"), "+a")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("B"), "+b")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("C"), "+c")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("D"), "+d")); REQUIRE_THAT( - puml, IsAggregation(_A("R"), _A("custom_container"), "+e")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("F"), "+f")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("G"), "+g")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("H"), "+h")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("I"), "+i")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("J"), "+j")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("K"), "+k")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("L"), "+lm")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("M"), "+lm")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("N"), "+ns")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("NN"), "+ns")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("NNN"), "+ns")); + src, IsAggregation(_A("R"), _A("custom_container"), "+e")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("F"), "+f")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("G"), "+g")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("H"), "+h")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("I"), "+i")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("J"), "+j")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("K"), "+k")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("L"), "+lm")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("M"), "+lm")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("N"), "+ns")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("NN"), "+ns")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("NNN"), "+ns")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -106,8 +106,50 @@ TEST_CASE("t00006", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); + using mermaid::AliasMatcher; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("G"))); + REQUIRE_THAT(src, IsClass(_A("H"))); + REQUIRE_THAT(src, IsClass(_A("I"))); + REQUIRE_THAT(src, IsClass(_A("J"))); + REQUIRE_THAT(src, IsClass(_A("K"))); + REQUIRE_THAT(src, IsClass(_A("L"))); + REQUIRE_THAT(src, IsClass(_A("M"))); + REQUIRE_THAT(src, IsClass(_A("N"))); + REQUIRE_THAT(src, IsClass(_A("NN"))); + REQUIRE_THAT(src, IsClass(_A("NNN"))); + + REQUIRE_THAT(src, + IsInstantiation( + _A("custom_container"), _A("custom_container"))); + + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("A"), "+a")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("B"), "+b")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("C"), "+c")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("D"), "+d")); + REQUIRE_THAT( + src, IsAggregation(_A("R"), _A("custom_container"), "+e")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("F"), "+f")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("G"), "+g")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("H"), "+h")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("I"), "+i")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("J"), "+j")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("K"), "+k")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("L"), "+lm")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("M"), "+lm")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("N"), "+ns")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("NN"), "+ns")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("NNN"), "+ns")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00007/test_case.h b/tests/t00007/test_case.h index 0155b4d7..eaa3102f 100644 --- a/tests/t00007/test_case.h +++ b/tests/t00007/test_case.h @@ -29,21 +29,21 @@ TEST_CASE("t00007", "[test-case][class]") REQUIRE(model->name() == "t00007_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("R"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("R"))); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("A"), "+a")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("B"), "+b")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("C"), "+c")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("A"), "+a")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("B"), "+b")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("C"), "+c")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -61,8 +61,19 @@ TEST_CASE("t00007", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("A"), "+a")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("B"), "+b")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("C"), "+c")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00008/test_case.h b/tests/t00008/test_case.h index 189cc2da..c0a03a36 100644 --- a/tests/t00008/test_case.h +++ b/tests/t00008/test_case.h @@ -29,34 +29,34 @@ TEST_CASE("t00008", "[test-case][class]") REQUIRE(model->name() == "t00008_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // TODO: add option to resolve using declared types // REQUIRE_THAT(puml, IsClassTemplate("A", "T, P, bool (*)(int, int), // int N")); - REQUIRE_THAT(puml, IsClassTemplate("A", "T,P=T,CMP=nullptr,int N=3")); - REQUIRE_THAT(puml, IsClassTemplate("B", "T,C<>")); + REQUIRE_THAT(src, IsClassTemplate("A", "T,P=T,CMP=nullptr,int N=3")); + REQUIRE_THAT(src, IsClassTemplate("B", "T,C<>")); - REQUIRE_THAT(puml, (IsField("value", "T"))); - REQUIRE_THAT(puml, (IsField("pointer", "T *"))); - REQUIRE_THAT(puml, (IsField("reference", "T &"))); - REQUIRE_THAT(puml, (IsField("values", "std::vector

"))); - REQUIRE_THAT(puml, (IsField("ints", "std::array"))); + REQUIRE_THAT(src, (IsField("value", "T"))); + REQUIRE_THAT(src, (IsField("pointer", "T *"))); + REQUIRE_THAT(src, (IsField("reference", "T &"))); + REQUIRE_THAT(src, (IsField("values", "std::vector

"))); + REQUIRE_THAT(src, (IsField("ints", "std::array"))); // TODO: add option to resolve using declared types // REQUIRE_THAT(puml, IsField(Public("bool (*)(int, int) comparator"))); - REQUIRE_THAT(puml, (IsField("comparator", "CMP"))); + REQUIRE_THAT(src, (IsField("comparator", "CMP"))); - REQUIRE_THAT(puml, !IsClass(_A("E::nested_template"))); - REQUIRE_THAT(puml, IsClassTemplate("E::nested_template", "ET")); - REQUIRE_THAT(puml, IsClassTemplate("E::nested_template", "char")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, !IsClass(_A("E::nested_template"))); + REQUIRE_THAT(src, IsClassTemplate("E::nested_template", "ET")); + REQUIRE_THAT(src, IsClassTemplate("E::nested_template", "char")); + REQUIRE_THAT(src, IsInstantiation( _A("E::nested_template"), _A("E::nested_template"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -75,8 +75,31 @@ TEST_CASE("t00008", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + using mermaid::IsField; + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B>"))); + + REQUIRE_THAT(src, (IsField("value", "T"))); + REQUIRE_THAT(src, (IsField("pointer", "T *"))); + REQUIRE_THAT(src, (IsField("reference", "T &"))); + REQUIRE_THAT(src, (IsField("values", "std::vector

"))); + REQUIRE_THAT(src, (IsField("ints", "std::array"))); + // TODO: add option to resolve using declared types + // REQUIRE_THAT(puml, IsField(Public("bool (*)(int, int) comparator"))); + REQUIRE_THAT(src, (IsField("comparator", "CMP"))); + + REQUIRE_THAT(src, !IsClass(_A("E::nested_template"))); + REQUIRE_THAT(src, IsClass(_A("E::nested_template"))); + REQUIRE_THAT(src, IsClass(_A("E::nested_template"))); + REQUIRE_THAT(src, + IsInstantiation( + _A("E::nested_template"), _A("E::nested_template"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00009/test_case.h b/tests/t00009/test_case.h index d0d0b413..1946f432 100644 --- a/tests/t00009/test_case.h +++ b/tests/t00009/test_case.h @@ -29,31 +29,31 @@ TEST_CASE("t00009", "[test-case][class]") REQUIRE(model->name() == "t00009_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClassTemplate("A", "T")); - REQUIRE_THAT(puml, IsClass(_A("B"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClassTemplate("A", "T")); + REQUIRE_THAT(src, IsClass(_A("B"))); - REQUIRE_THAT(puml, (IsField("value", "T"))); - REQUIRE_THAT(puml, (IsField("aint", "A"))); - REQUIRE_THAT(puml, (IsField("astring", "A *"))); - REQUIRE_THAT(puml, - (IsField("avector", "A> &"))); - - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); - - REQUIRE_THAT(puml, IsAggregation(_A("B"), _A("A"), "+aint")); + REQUIRE_THAT(src, (IsField("value", "T"))); + REQUIRE_THAT(src, (IsField("aint", "A"))); + REQUIRE_THAT(src, (IsField("astring", "A *"))); REQUIRE_THAT( - puml, IsAssociation(_A("B"), _A("A"), "+astring")); - REQUIRE_THAT(puml, + src, (IsField("avector", "A> &"))); + + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + + REQUIRE_THAT(src, IsAggregation(_A("B"), _A("A"), "+aint")); + REQUIRE_THAT( + src, IsAssociation(_A("B"), _A("A"), "+astring")); + REQUIRE_THAT(src, IsAssociation( _A("B"), _A("A>"), "+avector")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -73,8 +73,30 @@ TEST_CASE("t00009", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsField; + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + + REQUIRE_THAT(src, (IsField("value", "T"))); + REQUIRE_THAT(src, (IsField("aint", "A"))); + REQUIRE_THAT(src, (IsField("astring", "A *"))); + REQUIRE_THAT( + src, (IsField("avector", "A> &"))); + + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + + REQUIRE_THAT(src, IsAggregation(_A("B"), _A("A"), "+aint")); + REQUIRE_THAT( + src, IsAssociation(_A("B"), _A("A"), "+astring")); + REQUIRE_THAT(src, + IsAssociation( + _A("B"), _A("A>"), "+avector")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00010/test_case.h b/tests/t00010/test_case.h index c6d77578..cd86ec6a 100644 --- a/tests/t00010/test_case.h +++ b/tests/t00010/test_case.h @@ -29,26 +29,26 @@ TEST_CASE("t00010", "[test-case][class]") REQUIRE(model->name() == "t00010_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClassTemplate("A", "T,P")); - REQUIRE_THAT(puml, IsClassTemplate("B", "T")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClassTemplate("A", "T,P")); + REQUIRE_THAT(src, IsClassTemplate("B", "T")); - REQUIRE_THAT(puml, (IsField("astring", "A"))); - REQUIRE_THAT(puml, (IsField("aintstring", "B"))); + REQUIRE_THAT(src, (IsField("astring", "A"))); + REQUIRE_THAT(src, (IsField("aintstring", "B"))); REQUIRE_THAT( - puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("B"), _A("B"))); + src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("B"), _A("B"))); - REQUIRE_THAT(puml, - IsAggregation(_A("B"), _A("A"), "+astring")); - REQUIRE_THAT(puml, IsAggregation(_A("C"), _A("B"), "+aintstring")); + REQUIRE_THAT( + src, IsAggregation(_A("B"), _A("A"), "+astring")); + REQUIRE_THAT(src, IsAggregation(_A("C"), _A("B"), "+aintstring")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -66,8 +66,25 @@ TEST_CASE("t00010", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsField; + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + + REQUIRE_THAT(src, (IsField("astring", "A"))); + REQUIRE_THAT(src, (IsField("aintstring", "B"))); + + REQUIRE_THAT( + src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("B"), _A("B"))); + + REQUIRE_THAT( + src, IsAggregation(_A("B"), _A("A"), "+astring")); + REQUIRE_THAT(src, IsAggregation(_A("C"), _A("B"), "+aintstring")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00011/test_case.h b/tests/t00011/test_case.h index fd44377b..cc3554ff 100644 --- a/tests/t00011/test_case.h +++ b/tests/t00011/test_case.h @@ -29,21 +29,19 @@ TEST_CASE("t00011", "[test-case][class]") REQUIRE(model->name() == "t00011_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, !IsClass(_A("external::C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, !IsClass(_A("external::C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsAssociation(_A("B"), _A("A"))); - REQUIRE_THAT(puml, IsFriend(_A("A"), _A("B"))); + REQUIRE_THAT(src, IsAssociation(_A("B"), _A("A"))); + REQUIRE_THAT(src, IsFriend(_A("A"), _A("B"))); // REQUIRE_THAT(puml, IsFriend(_A("A"), _A("D"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -58,8 +56,19 @@ TEST_CASE("t00011", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, !IsClass(_A("external::C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + + REQUIRE_THAT(src, IsAssociation(_A("B"), _A("A"))); + REQUIRE_THAT(src, IsFriend(_A("A"), _A("B"))); + // REQUIRE_THAT(puml, IsFriend(_A("A"), _A("D"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00012/test_case.h b/tests/t00012/test_case.h index dd108370..3145eda6 100644 --- a/tests/t00012/test_case.h +++ b/tests/t00012/test_case.h @@ -29,24 +29,24 @@ TEST_CASE("t00012", "[test-case][class]") REQUIRE(model->name() == "t00012_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClassTemplate("A", "T,Ts...")); - REQUIRE_THAT(puml, IsClassTemplate("B", "int... Is")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClassTemplate("A", "T,Ts...")); + REQUIRE_THAT(src, IsClassTemplate("B", "int... Is")); - REQUIRE_THAT(puml, IsInstantiation(_A("B"), _A("B<3,2,1>"))); + REQUIRE_THAT(src, IsInstantiation(_A("B"), _A("B<3,2,1>"))); REQUIRE_THAT( - puml, IsInstantiation(_A("B"), _A("B<1,1,1,1>"))); - REQUIRE_THAT(puml, + src, IsInstantiation(_A("B"), _A("B<1,1,1,1>"))); + REQUIRE_THAT(src, IsInstantiation(_A("C"), _A("C>>>,3,3," "3>"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -64,8 +64,22 @@ TEST_CASE("t00012", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + + REQUIRE_THAT(src, IsInstantiation(_A("B"), _A("B<3,2,1>"))); + REQUIRE_THAT( + src, IsInstantiation(_A("B"), _A("B<1,1,1,1>"))); + REQUIRE_THAT(src, + IsInstantiation(_A("C"), + _A("C>>>,3,3," + "3>"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00013/test_case.h b/tests/t00013/test_case.h index aa1868bf..9dfd2281 100644 --- a/tests/t00013/test_case.h +++ b/tests/t00013/test_case.h @@ -29,40 +29,40 @@ TEST_CASE("t00013", "[test-case][class]") REQUIRE(model->name() == "t00013_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClassTemplate("E", "T")); - REQUIRE_THAT(puml, IsClassTemplate("G", "T,Args...")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClassTemplate("E", "T")); + REQUIRE_THAT(src, IsClassTemplate("G", "T,Args...")); - REQUIRE_THAT(puml, !IsDependency(_A("R"), _A("R"))); - REQUIRE_THAT(puml, IsDependency(_A("R"), _A("A"))); - REQUIRE_THAT(puml, IsDependency(_A("R"), _A("B"))); - REQUIRE_THAT(puml, IsDependency(_A("R"), _A("C"))); - REQUIRE_THAT(puml, IsDependency(_A("R"), _A("D"))); - REQUIRE_THAT(puml, IsDependency(_A("D"), _A("R"))); - REQUIRE_THAT(puml, IsDependency(_A("R"), _A("E"))); - REQUIRE_THAT(puml, IsDependency(_A("R"), _A("E"))); - REQUIRE_THAT(puml, IsInstantiation(_A("E"), _A("E"))); - REQUIRE_THAT(puml, IsInstantiation(_A("E"), _A("E"))); + REQUIRE_THAT(src, !IsDependency(_A("R"), _A("R"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("A"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("B"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("C"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("D"))); + REQUIRE_THAT(src, IsDependency(_A("D"), _A("R"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("E"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("E"))); + REQUIRE_THAT(src, IsInstantiation(_A("E"), _A("E"))); + REQUIRE_THAT(src, IsInstantiation(_A("E"), _A("E"))); REQUIRE_THAT( - puml, IsAggregation(_A("R"), _A("E"), "-estring")); - REQUIRE_THAT(puml, IsDependency(_A("R"), _A("ABCD::F"))); + src, IsAggregation(_A("R"), _A("E"), "-estring")); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("ABCD::F"))); REQUIRE_THAT( - puml, IsInstantiation(_A("ABCD::F"), _A("ABCD::F"))); - REQUIRE_THAT(puml, IsDependency(_A("R"), _A("ABCD::F"))); + src, IsInstantiation(_A("ABCD::F"), _A("ABCD::F"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("ABCD::F"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation( _A("G"), _A("G"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -85,8 +85,38 @@ TEST_CASE("t00013", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("G"))); + + REQUIRE_THAT(src, !IsDependency(_A("R"), _A("R"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("A"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("B"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("C"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("D"))); + REQUIRE_THAT(src, IsDependency(_A("D"), _A("R"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("E"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("E"))); + REQUIRE_THAT(src, IsInstantiation(_A("E"), _A("E"))); + REQUIRE_THAT(src, IsInstantiation(_A("E"), _A("E"))); + REQUIRE_THAT( + src, IsAggregation(_A("R"), _A("E"), "-estring")); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("ABCD::F"))); + REQUIRE_THAT( + src, IsInstantiation(_A("ABCD::F"), _A("ABCD::F"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("ABCD::F"))); + + REQUIRE_THAT(src, + IsInstantiation( + _A("G"), _A("G"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00014/test_case.h b/tests/t00014/test_case.h index 5a68b6ed..50ab931f 100644 --- a/tests/t00014/test_case.h +++ b/tests/t00014/test_case.h @@ -29,124 +29,121 @@ TEST_CASE("t00014", "[test-case][class]") REQUIRE(model->name() == "t00014_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, !Contains("type-parameter-")); + REQUIRE_THAT(src, !Contains("type-parameter-")); - REQUIRE_THAT(puml, IsClassTemplate("A", "T,P")); - REQUIRE_THAT(puml, IsClassTemplate("A", "T,std::string")); + REQUIRE_THAT(src, IsClassTemplate("A", "T,P")); + REQUIRE_THAT(src, IsClassTemplate("A", "T,std::string")); REQUIRE_THAT( - puml, IsClassTemplate("A", "T,std::unique_ptr")); - REQUIRE_THAT(puml, IsClassTemplate("A", "double,T")); + src, IsClassTemplate("A", "T,std::unique_ptr")); + REQUIRE_THAT(src, IsClassTemplate("A", "double,T")); // TODO: Figure out how to handle the same templates with different // template // parameter names // REQUIRE_THAT(puml, !IsClassTemplate("A", "long,U")); - REQUIRE_THAT(puml, IsClassTemplate("A", "long,T")); - REQUIRE_THAT(puml, IsClassTemplate("A", "long,bool")); - REQUIRE_THAT(puml, IsClassTemplate("A", "double,bool")); - REQUIRE_THAT(puml, IsClassTemplate("A", "long,float")); - REQUIRE_THAT(puml, IsClassTemplate("A", "double,float")); - REQUIRE_THAT(puml, IsClassTemplate("A", "bool,std::string")); - REQUIRE_THAT(puml, IsClassTemplate("A", "std::string,std::string")); - REQUIRE_THAT(puml, IsClassTemplate("A", "char,std::string")); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClassTemplate("R", "T")); + REQUIRE_THAT(src, IsClassTemplate("A", "long,T")); + REQUIRE_THAT(src, IsClassTemplate("A", "long,bool")); + REQUIRE_THAT(src, IsClassTemplate("A", "double,bool")); + REQUIRE_THAT(src, IsClassTemplate("A", "long,float")); + REQUIRE_THAT(src, IsClassTemplate("A", "double,float")); + REQUIRE_THAT(src, IsClassTemplate("A", "bool,std::string")); + REQUIRE_THAT(src, IsClassTemplate("A", "std::string,std::string")); + REQUIRE_THAT(src, IsClassTemplate("A", "char,std::string")); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClassTemplate("R", "T")); - REQUIRE_THAT(puml, IsField("bapair", "PairPairBA")); - REQUIRE_THAT(puml, IsField("abool", "APtr")); - REQUIRE_THAT(puml, IsField("aboolfloat", "AAPtr")); - REQUIRE_THAT(puml, IsField("afloat", "ASharedPtr")); + REQUIRE_THAT(src, IsField("bapair", "PairPairBA")); + REQUIRE_THAT(src, IsField("abool", "APtr")); + REQUIRE_THAT(src, IsField("aboolfloat", "AAPtr")); + REQUIRE_THAT(src, IsField("afloat", "ASharedPtr")); REQUIRE_THAT( - puml, IsField("boolstring", "A")); - REQUIRE_THAT( - puml, IsField("floatstring", "AStringPtr")); - REQUIRE_THAT(puml, IsField("atfloat", "AAPtr")); + src, IsField("boolstring", "A")); + REQUIRE_THAT(src, IsField("floatstring", "AStringPtr")); + REQUIRE_THAT(src, IsField("atfloat", "AAPtr")); - REQUIRE_THAT(puml, IsField("intstring", "AIntString")); - REQUIRE_THAT(puml, IsField("stringstring", "AStringString")); - REQUIRE_THAT(puml, IsField("bstringstring", "BStringString")); + REQUIRE_THAT(src, IsField("intstring", "AIntString")); + REQUIRE_THAT(src, IsField("stringstring", "AStringString")); + REQUIRE_THAT(src, IsField("bstringstring", "BStringString")); - REQUIRE_THAT(puml, IsField("bs", "BVector")); + REQUIRE_THAT(src, IsField("bs", "BVector")); - REQUIRE_THAT( - puml, IsField("cb", "SimpleCallback")); + REQUIRE_THAT(src, IsField("cb", "SimpleCallback")); #if LLVM_VERSION_MAJOR >= 16 REQUIRE_THAT( - puml, IsField("gcb", "GenericCallback")); + src, IsField("gcb", "GenericCallback")); #else REQUIRE_THAT( - puml, IsField("gcb", "GenericCallback")); + src, IsField("gcb", "GenericCallback")); #endif - REQUIRE_THAT(puml, IsField("vcb", "VoidCallback")); - - REQUIRE_THAT(puml, - !IsClassTemplate("std::std::function", "void(T...,int),int)")); + REQUIRE_THAT(src, IsField("vcb", "VoidCallback")); REQUIRE_THAT( - puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT( - puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT( - puml, IsInstantiation(_A("A"), _A("A"))); + src, !IsClassTemplate("std::std::function", "void(T...,int),int)")); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT( + src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT( + src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); // REQUIRE_THAT(puml, !IsInstantiation(_A("A"), // _A("A"))); REQUIRE_THAT( - puml, IsInstantiation(_A("A"), _A("A"))); + src, IsInstantiation(_A("A"), _A("A"))); REQUIRE_THAT( - puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); + src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); REQUIRE_THAT( - puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, + src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation( _A("A"), _A("A"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation(_A("A>"), _A("A>"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation( _A("A"), _A("A>"))); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("B"), "+vps")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("B"), "-bapair")); - REQUIRE_THAT(puml, - IsAggregation(_A("R"), _A("A"), "-aboolfloat")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("B"), "+vps")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("B"), "-bapair")); REQUIRE_THAT( - puml, IsAggregation(_A("R"), _A("A"), "-bapair")); - REQUIRE_THAT(puml, + src, IsAggregation(_A("R"), _A("A"), "-aboolfloat")); + REQUIRE_THAT( + src, IsAggregation(_A("R"), _A("A"), "-bapair")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("A"), "-aboolfloat")); REQUIRE_THAT( - puml, IsAggregation(_A("R"), _A("A"), "-atfloat")); + src, IsAggregation(_A("R"), _A("A"), "-atfloat")); REQUIRE_THAT( - puml, IsAggregation(_A("R"), _A("A"), "-atfloat")); + src, IsAggregation(_A("R"), _A("A"), "-atfloat")); REQUIRE_THAT( - puml, IsAssociation(_A("R"), _A("A"), "-afloat")); - REQUIRE_THAT(puml, + src, IsAssociation(_A("R"), _A("A"), "-afloat")); + REQUIRE_THAT(src, IsAggregation( _A("R"), _A("A"), "-boolstring")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("A>"), "-floatstring")); #if !defined(__APPLE__) // TODO(#176) - REQUIRE_THAT(puml, IsDependency(_A("R"), _A("A"))); + REQUIRE_THAT(src, IsDependency(_A("R"), _A("A"))); REQUIRE_THAT( - puml, IsDependency(_A("R"), _A("A"))); + src, IsDependency(_A("R"), _A("A"))); #endif - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -171,8 +168,118 @@ TEST_CASE("t00014", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsField; + + REQUIRE_THAT(src, !Contains("type-parameter-")); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A>"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + // TODO: Figure out how to handle the same templates with different + // template + // parameter names + // REQUIRE_THAT(puml, !IsClass("A", "long,U")); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + + REQUIRE_THAT(src, IsField("bapair", "PairPairBA")); + REQUIRE_THAT(src, IsField("abool", "APtr")); + REQUIRE_THAT(src, IsField("aboolfloat", "AAPtr")); + REQUIRE_THAT(src, IsField("afloat", "ASharedPtr")); + REQUIRE_THAT( + src, IsField("boolstring", "A")); + REQUIRE_THAT(src, IsField("floatstring", "AStringPtr")); + REQUIRE_THAT(src, IsField("atfloat", "AAPtr")); + + REQUIRE_THAT(src, IsField("intstring", "AIntString")); + REQUIRE_THAT(src, IsField("stringstring", "AStringString")); + REQUIRE_THAT(src, IsField("bstringstring", "BStringString")); + + REQUIRE_THAT(src, IsField("bs", "BVector")); + + REQUIRE_THAT(src, IsField("cb", "SimpleCallback")); +#if LLVM_VERSION_MAJOR >= 16 + REQUIRE_THAT( + src, IsField("gcb", "GenericCallback")); +#else + REQUIRE_THAT( + src, IsField("gcb", "GenericCallback")); +#endif + REQUIRE_THAT(src, IsField("vcb", "VoidCallback")); + + REQUIRE_THAT( + src, !IsClassTemplate("std::std::function", "void(T...,int),int)")); + + REQUIRE_THAT( + src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT( + src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + // REQUIRE_THAT(puml, !IsInstantiation(_A("A"), + // _A("A"))); + REQUIRE_THAT( + src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT( + src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT( + src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, + IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, + IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, + IsInstantiation( + _A("A"), _A("A"))); + + REQUIRE_THAT(src, + IsInstantiation(_A("A>"), + _A("A>"))); + REQUIRE_THAT(src, + IsInstantiation( + _A("A"), _A("A>"))); + + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("B"), "+vps")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("B"), "-bapair")); + REQUIRE_THAT( + src, IsAggregation(_A("R"), _A("A"), "-aboolfloat")); + REQUIRE_THAT( + src, IsAggregation(_A("R"), _A("A"), "-bapair")); + REQUIRE_THAT(src, + IsAggregation(_A("R"), _A("A"), "-aboolfloat")); + REQUIRE_THAT( + src, IsAggregation(_A("R"), _A("A"), "-atfloat")); + REQUIRE_THAT( + src, IsAggregation(_A("R"), _A("A"), "-atfloat")); + REQUIRE_THAT( + src, IsAssociation(_A("R"), _A("A"), "-afloat")); + REQUIRE_THAT(src, + IsAggregation( + _A("R"), _A("A"), "-boolstring")); + REQUIRE_THAT(src, + IsAggregation(_A("R"), + _A("A>"), "-floatstring")); +#if !defined(__APPLE__) + // TODO(#176) + REQUIRE_THAT(src, IsDependency(_A("R"), _A("A"))); + REQUIRE_THAT( + src, IsDependency(_A("R"), _A("A"))); +#endif + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00015/test_case.h b/tests/t00015/test_case.h index 5c087886..17e930d6 100644 --- a/tests/t00015/test_case.h +++ b/tests/t00015/test_case.h @@ -29,18 +29,18 @@ TEST_CASE("t00015", "[test-case][class]") REQUIRE(model->name() == "t00015_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("ns1::A"))); - REQUIRE_THAT(puml, IsClass(_A("ns1::ns2_v0_9_0::A"))); - REQUIRE_THAT(puml, IsClass(_A("ns1::Anon"))); - REQUIRE_THAT(puml, IsClass(_A("ns3::ns1::ns2::Anon"))); - REQUIRE_THAT(puml, IsClass(_A("ns3::B"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClass(_A("ns1::A"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2_v0_9_0::A"))); + REQUIRE_THAT(src, IsClass(_A("ns1::Anon"))); + REQUIRE_THAT(src, IsClass(_A("ns3::ns1::ns2::Anon"))); + REQUIRE_THAT(src, IsClass(_A("ns3::B"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -56,8 +56,16 @@ TEST_CASE("t00015", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("ns1::A"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2_v0_9_0::A"))); + REQUIRE_THAT(src, IsClass(_A("ns1::Anon"))); + REQUIRE_THAT(src, IsClass(_A("ns3::ns1::ns2::Anon"))); + REQUIRE_THAT(src, IsClass(_A("ns3::B"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00016/test_case.h b/tests/t00016/test_case.h index 7acf4419..bbafe446 100644 --- a/tests/t00016/test_case.h +++ b/tests/t00016/test_case.h @@ -29,30 +29,30 @@ TEST_CASE("t00016", "[test-case][class]") REQUIRE(model->name() == "t00016_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClassTemplate("is_numeric", "typename")); - REQUIRE_THAT(puml, IsClassTemplate("is_numeric", "int")); - REQUIRE_THAT(puml, IsClassTemplate("is_numeric", "bool")); - REQUIRE_THAT(puml, IsClassTemplate("is_numeric", "char")); - REQUIRE_THAT(puml, IsClassTemplate("is_numeric", "float")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClassTemplate("is_numeric", "typename")); + REQUIRE_THAT(src, IsClassTemplate("is_numeric", "int")); + REQUIRE_THAT(src, IsClassTemplate("is_numeric", "bool")); + REQUIRE_THAT(src, IsClassTemplate("is_numeric", "char")); + REQUIRE_THAT(src, IsClassTemplate("is_numeric", "float")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation(_A("is_numeric"), _A("is_numeric"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation( _A("is_numeric"), _A("is_numeric"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation( _A("is_numeric"), _A("is_numeric"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation( _A("is_numeric"), _A("is_numeric"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -68,8 +68,28 @@ TEST_CASE("t00016", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("is_numeric"))); + REQUIRE_THAT(src, IsClass(_A("is_numeric"))); + REQUIRE_THAT(src, IsClass(_A("is_numeric"))); + REQUIRE_THAT(src, IsClass(_A("is_numeric"))); + REQUIRE_THAT(src, IsClass(_A("is_numeric"))); + + REQUIRE_THAT(src, + IsInstantiation(_A("is_numeric"), _A("is_numeric"))); + REQUIRE_THAT(src, + IsInstantiation( + _A("is_numeric"), _A("is_numeric"))); + REQUIRE_THAT(src, + IsInstantiation( + _A("is_numeric"), _A("is_numeric"))); + REQUIRE_THAT(src, + IsInstantiation( + _A("is_numeric"), _A("is_numeric"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00017/test_case.h b/tests/t00017/test_case.h index af74548e..f41b6b5a 100644 --- a/tests/t00017/test_case.h +++ b/tests/t00017/test_case.h @@ -29,46 +29,46 @@ TEST_CASE("t00017", "[test-case][class]") REQUIRE(model->name() == "t00017_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClass(_A("E"))); - REQUIRE_THAT(puml, IsClass(_A("F"))); - REQUIRE_THAT(puml, IsClass(_A("G"))); - REQUIRE_THAT(puml, IsClass(_A("H"))); - REQUIRE_THAT(puml, IsClass(_A("I"))); - REQUIRE_THAT(puml, IsClass(_A("J"))); - REQUIRE_THAT(puml, IsClass(_A("K"))); - REQUIRE_THAT(puml, IsClass(_A("R"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("G"))); + REQUIRE_THAT(src, IsClass(_A("H"))); + REQUIRE_THAT(src, IsClass(_A("I"))); + REQUIRE_THAT(src, IsClass(_A("J"))); + REQUIRE_THAT(src, IsClass(_A("K"))); + REQUIRE_THAT(src, IsClass(_A("R"))); - REQUIRE_THAT(puml, (IsField("some_int", "int"))); - REQUIRE_THAT(puml, (IsField("some_int_pointer", "int *"))); + REQUIRE_THAT(src, (IsField("some_int", "int"))); + REQUIRE_THAT(src, (IsField("some_int_pointer", "int *"))); REQUIRE_THAT( - puml, (IsField("some_int_pointer_pointer", "int **"))); + src, (IsField("some_int_pointer_pointer", "int **"))); // Relationship members should not be rendered as part of this testcase - REQUIRE_THAT(puml, !(IsField("a", _A("A")))); - REQUIRE_THAT(puml, !(IsField("b", _A("B")))); + REQUIRE_THAT(src, !(IsField("a", _A("A")))); + REQUIRE_THAT(src, !(IsField("b", _A("B")))); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("A"), "-a")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("B"), "-b")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("C"), "-c")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("D"), "-d")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("E"), "-e")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("F"), "-f")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("G"), "-g")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("H"), "-h")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("I"), "-i")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("J"), "-j")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("K"), "-k")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("A"), "-a")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("B"), "-b")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("C"), "-c")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("D"), "-d")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("E"), "-e")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("F"), "-f")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("G"), "-g")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("H"), "-h")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("I"), "-i")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("J"), "-j")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("K"), "-k")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -91,8 +91,44 @@ TEST_CASE("t00017", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); + using mermaid::IsField; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("G"))); + REQUIRE_THAT(src, IsClass(_A("H"))); + REQUIRE_THAT(src, IsClass(_A("I"))); + REQUIRE_THAT(src, IsClass(_A("J"))); + REQUIRE_THAT(src, IsClass(_A("K"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + + REQUIRE_THAT(src, (IsField("some_int", "int"))); + REQUIRE_THAT(src, (IsField("some_int_pointer", "int *"))); + REQUIRE_THAT( + src, (IsField("some_int_pointer_pointer", "int **"))); + + // Relationship members should not be rendered as part of this testcase + REQUIRE_THAT(src, !(IsField("a", _A("A")))); + REQUIRE_THAT(src, !(IsField("b", _A("B")))); + + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("A"), "-a")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("B"), "-b")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("C"), "-c")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("D"), "-d")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("E"), "-e")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("F"), "-f")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("G"), "-g")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("H"), "-h")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("I"), "-i")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("J"), "-j")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("K"), "-k")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00018/test_case.h b/tests/t00018/test_case.h index e19d434e..9f3f2f0f 100644 --- a/tests/t00018/test_case.h +++ b/tests/t00018/test_case.h @@ -29,20 +29,20 @@ TEST_CASE("t00018", "[test-case][class]") REQUIRE(model->name() == "t00018_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("widget"))); - REQUIRE_THAT(puml, IsClass(_A("impl::widget"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClass(_A("widget"))); + REQUIRE_THAT(src, IsClass(_A("impl::widget"))); REQUIRE_THAT( - puml, IsAggregation(_A("widget"), _A("impl::widget"), "-pImpl")); - REQUIRE_THAT(puml, IsDependency(_A("impl::widget"), _A("widget"))); - REQUIRE_THAT(puml, !IsDependency(_A("widget"), _A("widget"))); + src, IsAggregation(_A("widget"), _A("impl::widget"), "-pImpl")); + REQUIRE_THAT(src, IsDependency(_A("impl::widget"), _A("widget"))); + REQUIRE_THAT(src, !IsDependency(_A("widget"), _A("widget"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -56,8 +56,17 @@ TEST_CASE("t00018", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, IsClass(_A("widget"))); + REQUIRE_THAT(src, IsClass(_A("impl::widget"))); + + REQUIRE_THAT( + src, IsAggregation(_A("widget"), _A("impl::widget"), "-pImpl")); + REQUIRE_THAT(src, IsDependency(_A("impl::widget"), _A("widget"))); + REQUIRE_THAT(src, !IsDependency(_A("widget"), _A("widget"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00019/test_case.h b/tests/t00019/test_case.h index 90636ddd..b8b4dc35 100644 --- a/tests/t00019/test_case.h +++ b/tests/t00019/test_case.h @@ -29,47 +29,47 @@ TEST_CASE("t00019", "[test-case][class]") REQUIRE(model->name() == "t00019_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("Base"))); - REQUIRE_THAT(puml, IsClassTemplate("Layer1", "LowerLayer")); - REQUIRE_THAT(puml, IsClassTemplate("Layer2", "LowerLayer")); - REQUIRE_THAT(puml, IsClassTemplate("Layer3", "LowerLayer")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClass(_A("Base"))); + REQUIRE_THAT(src, IsClassTemplate("Layer1", "LowerLayer")); + REQUIRE_THAT(src, IsClassTemplate("Layer2", "LowerLayer")); + REQUIRE_THAT(src, IsClassTemplate("Layer3", "LowerLayer")); - REQUIRE_THAT(puml, IsBaseClass(_A("Base"), _A("Layer3"))); - REQUIRE_THAT(puml, !IsDependency(_A("Base"), _A("Layer3"))); + REQUIRE_THAT(src, IsBaseClass(_A("Base"), _A("Layer3"))); + REQUIRE_THAT(src, !IsDependency(_A("Base"), _A("Layer3"))); REQUIRE_THAT( - puml, IsBaseClass(_A("Layer3"), _A("Layer2>"))); - REQUIRE_THAT(puml, - !IsDependency(_A("Layer3"), _A("Layer2>"))); + src, IsBaseClass(_A("Layer3"), _A("Layer2>"))); + REQUIRE_THAT( + src, !IsDependency(_A("Layer3"), _A("Layer2>"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsBaseClass(_A("Layer2>"), _A("Layer1>>"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, !IsDependency(_A("Layer2>"), _A("Layer1>>"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAggregation( _A("A"), _A("Layer1>>"), "+layers")); REQUIRE_THAT( - puml, !IsDependency(_A("A"), _A("Layer1>>"))); + src, !IsDependency(_A("A"), _A("Layer1>>"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, !IsAggregation(_A("A"), _A("Layer2>"), "+layers")); REQUIRE_THAT( - puml, !IsAggregation(_A("A"), _A("Layer3"), "+layers")); + src, !IsAggregation(_A("A"), _A("Layer3"), "+layers")); - REQUIRE_THAT(puml, !IsAggregation(_A("A"), _A("Base"), "+layers")); + REQUIRE_THAT(src, !IsAggregation(_A("A"), _A("Base"), "+layers")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -84,8 +84,45 @@ TEST_CASE("t00019", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("Base"))); + REQUIRE_THAT(src, IsClass(_A("Layer1"))); + REQUIRE_THAT(src, IsClass(_A("Layer2"))); + REQUIRE_THAT(src, IsClass(_A("Layer3"))); + + REQUIRE_THAT(src, IsBaseClass(_A("Base"), _A("Layer3"))); + REQUIRE_THAT(src, !IsDependency(_A("Base"), _A("Layer3"))); + + REQUIRE_THAT( + src, IsBaseClass(_A("Layer3"), _A("Layer2>"))); + REQUIRE_THAT( + src, !IsDependency(_A("Layer3"), _A("Layer2>"))); + + REQUIRE_THAT(src, + IsBaseClass(_A("Layer2>"), + _A("Layer1>>"))); + + REQUIRE_THAT(src, + !IsDependency(_A("Layer2>"), + _A("Layer1>>"))); + + REQUIRE_THAT(src, + IsAggregation( + _A("A"), _A("Layer1>>"), "+layers")); + REQUIRE_THAT( + src, !IsDependency(_A("A"), _A("Layer1>>"))); + + REQUIRE_THAT(src, + !IsAggregation(_A("A"), _A("Layer2>"), "+layers")); + + REQUIRE_THAT( + src, !IsAggregation(_A("A"), _A("Layer3"), "+layers")); + + REQUIRE_THAT(src, !IsAggregation(_A("A"), _A("Base"), "+layers")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00020/test_case.h b/tests/t00020/test_case.h index 4a67463b..e64a9463 100644 --- a/tests/t00020/test_case.h +++ b/tests/t00020/test_case.h @@ -29,22 +29,22 @@ TEST_CASE("t00020", "[test-case][class]") REQUIRE(model->name() == "t00020_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsAbstractClass(_A("ProductA"))); - REQUIRE_THAT(puml, IsAbstractClass(_A("ProductB"))); - REQUIRE_THAT(puml, IsClass(_A("ProductA1"))); - REQUIRE_THAT(puml, IsClass(_A("ProductA2"))); - REQUIRE_THAT(puml, IsClass(_A("ProductB1"))); - REQUIRE_THAT(puml, IsClass(_A("ProductB2"))); - REQUIRE_THAT(puml, IsAbstractClass(_A("AbstractFactory"))); - REQUIRE_THAT(puml, IsClass(_A("Factory1"))); - REQUIRE_THAT(puml, IsClass(_A("Factory2"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsAbstractClass(_A("ProductA"))); + REQUIRE_THAT(src, IsAbstractClass(_A("ProductB"))); + REQUIRE_THAT(src, IsClass(_A("ProductA1"))); + REQUIRE_THAT(src, IsClass(_A("ProductA2"))); + REQUIRE_THAT(src, IsClass(_A("ProductB1"))); + REQUIRE_THAT(src, IsClass(_A("ProductB2"))); + REQUIRE_THAT(src, IsAbstractClass(_A("AbstractFactory"))); + REQUIRE_THAT(src, IsClass(_A("Factory1"))); + REQUIRE_THAT(src, IsClass(_A("Factory2"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -60,8 +60,21 @@ TEST_CASE("t00020", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsAbstractClass; + + REQUIRE_THAT(src, IsAbstractClass(_A("ProductA"))); + REQUIRE_THAT(src, IsAbstractClass(_A("ProductB"))); + REQUIRE_THAT(src, IsClass(_A("ProductA1"))); + REQUIRE_THAT(src, IsClass(_A("ProductA2"))); + REQUIRE_THAT(src, IsClass(_A("ProductB1"))); + REQUIRE_THAT(src, IsClass(_A("ProductB2"))); + REQUIRE_THAT(src, IsAbstractClass(_A("AbstractFactory"))); + REQUIRE_THAT(src, IsClass(_A("Factory1"))); + REQUIRE_THAT(src, IsClass(_A("Factory2"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00021/test_case.h b/tests/t00021/test_case.h index f951d5dc..1451d2ec 100644 --- a/tests/t00021/test_case.h +++ b/tests/t00021/test_case.h @@ -29,20 +29,20 @@ TEST_CASE("t00021", "[test-case][class]") REQUIRE(model->name() == "t00021_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsAbstractClass(_A("Item"))); - REQUIRE_THAT(puml, IsAbstractClass(_A("Visitor"))); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("Visitor1"))); - REQUIRE_THAT(puml, IsClass(_A("Visitor2"))); - REQUIRE_THAT(puml, IsClass(_A("Visitor3"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsAbstractClass(_A("Item"))); + REQUIRE_THAT(src, IsAbstractClass(_A("Visitor"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("Visitor1"))); + REQUIRE_THAT(src, IsClass(_A("Visitor2"))); + REQUIRE_THAT(src, IsClass(_A("Visitor3"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -56,8 +56,19 @@ TEST_CASE("t00021", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsAbstractClass; + + REQUIRE_THAT(src, IsAbstractClass(_A("Item"))); + REQUIRE_THAT(src, IsAbstractClass(_A("Visitor"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("Visitor1"))); + REQUIRE_THAT(src, IsClass(_A("Visitor2"))); + REQUIRE_THAT(src, IsClass(_A("Visitor3"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00022/test_case.h b/tests/t00022/test_case.h index 0d536a20..3294ce30 100644 --- a/tests/t00022/test_case.h +++ b/tests/t00022/test_case.h @@ -29,16 +29,16 @@ TEST_CASE("t00022", "[test-case][class]") REQUIRE(model->name() == "t00022_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsAbstractClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("A1"))); - REQUIRE_THAT(puml, IsClass(_A("A2"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsAbstractClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A1"))); + REQUIRE_THAT(src, IsClass(_A("A2"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -52,8 +52,14 @@ TEST_CASE("t00022", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); + using mermaid::IsAbstractClass; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, IsAbstractClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A1"))); + REQUIRE_THAT(src, IsClass(_A("A2"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t00023/test_case.h b/tests/t00023/test_case.h index 245065fa..c76f72eb 100644 --- a/tests/t00023/test_case.h +++ b/tests/t00023/test_case.h @@ -29,16 +29,16 @@ TEST_CASE("t00023", "[test-case][class]") REQUIRE(model->name() == "t00023_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsAbstractClass(_A("Strategy"))); - REQUIRE_THAT(puml, IsClass(_A("StrategyA"))); - REQUIRE_THAT(puml, IsClass(_A("StrategyB"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsAbstractClass(_A("Strategy"))); + REQUIRE_THAT(src, IsClass(_A("StrategyA"))); + REQUIRE_THAT(src, IsClass(_A("StrategyB"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -52,8 +52,15 @@ TEST_CASE("t00023", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsAbstractClass; + + REQUIRE_THAT(src, IsAbstractClass(_A("Strategy"))); + REQUIRE_THAT(src, IsClass(_A("StrategyA"))); + REQUIRE_THAT(src, IsClass(_A("StrategyB"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00024/test_case.h b/tests/t00024/test_case.h index d6f568de..1d30537d 100644 --- a/tests/t00024/test_case.h +++ b/tests/t00024/test_case.h @@ -29,20 +29,20 @@ TEST_CASE("t00024", "[test-case][class]") REQUIRE(model->name() == "t00024_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsAbstractClass(_A("Target"))); - REQUIRE_THAT(puml, IsClass(_A("Target1"))); - REQUIRE_THAT(puml, IsClass(_A("Target2"))); - REQUIRE_THAT(puml, IsClass(_A("Proxy"))); - REQUIRE_THAT(puml, IsBaseClass(_A("Target"), _A("Target1"))); - REQUIRE_THAT(puml, IsBaseClass(_A("Target"), _A("Target2"))); - REQUIRE_THAT(puml, IsBaseClass(_A("Target"), _A("Proxy"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsAbstractClass(_A("Target"))); + REQUIRE_THAT(src, IsClass(_A("Target1"))); + REQUIRE_THAT(src, IsClass(_A("Target2"))); + REQUIRE_THAT(src, IsClass(_A("Proxy"))); + REQUIRE_THAT(src, IsBaseClass(_A("Target"), _A("Target1"))); + REQUIRE_THAT(src, IsBaseClass(_A("Target"), _A("Target2"))); + REQUIRE_THAT(src, IsBaseClass(_A("Target"), _A("Proxy"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -59,8 +59,19 @@ TEST_CASE("t00024", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsAbstractClass; + + REQUIRE_THAT(src, IsAbstractClass(_A("Target"))); + REQUIRE_THAT(src, IsClass(_A("Target1"))); + REQUIRE_THAT(src, IsClass(_A("Target2"))); + REQUIRE_THAT(src, IsClass(_A("Proxy"))); + REQUIRE_THAT(src, IsBaseClass(_A("Target"), _A("Target1"))); + REQUIRE_THAT(src, IsBaseClass(_A("Target"), _A("Target2"))); + REQUIRE_THAT(src, IsBaseClass(_A("Target"), _A("Proxy"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00025/test_case.h b/tests/t00025/test_case.h index e4ee2950..061dfb95 100644 --- a/tests/t00025/test_case.h +++ b/tests/t00025/test_case.h @@ -29,30 +29,30 @@ TEST_CASE("t00025", "[test-case][class]") REQUIRE(model->name() == "t00025_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("Target1"))); - REQUIRE_THAT(puml, IsClass(_A("Target2"))); - REQUIRE_THAT(puml, IsClassTemplate("Proxy", "T")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClass(_A("Target1"))); + REQUIRE_THAT(src, IsClass(_A("Target2"))); + REQUIRE_THAT(src, IsClassTemplate("Proxy", "T")); REQUIRE_THAT( - puml, IsInstantiation(_A("Proxy"), _A("Proxy"))); + src, IsInstantiation(_A("Proxy"), _A("Proxy"))); REQUIRE_THAT( - puml, IsInstantiation(_A("Proxy"), _A("Proxy"))); - REQUIRE_THAT(puml, + src, IsInstantiation(_A("Proxy"), _A("Proxy"))); + REQUIRE_THAT(src, IsAggregation(_A("ProxyHolder"), _A("Proxy"), "+proxy1")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAggregation(_A("ProxyHolder"), _A("Proxy"), "+proxy2")); REQUIRE_THAT( - puml, !IsAggregation(_A("ProxyHolder"), _A("Target1"), "+proxy1")); + src, !IsAggregation(_A("ProxyHolder"), _A("Target1"), "+proxy1")); REQUIRE_THAT( - puml, !IsAggregation(_A("ProxyHolder"), _A("Target2"), "+proxy2")); - REQUIRE_THAT(puml, IsDependency(_A("Proxy"), _A("Target1"))); - REQUIRE_THAT(puml, IsDependency(_A("Proxy"), _A("Target2"))); + src, !IsAggregation(_A("ProxyHolder"), _A("Target2"), "+proxy2")); + REQUIRE_THAT(src, IsDependency(_A("Proxy"), _A("Target1"))); + REQUIRE_THAT(src, IsDependency(_A("Proxy"), _A("Target2"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -68,8 +68,28 @@ TEST_CASE("t00025", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("Target1"))); + REQUIRE_THAT(src, IsClass(_A("Target2"))); + REQUIRE_THAT(src, IsClass(_A("Proxy"))); + REQUIRE_THAT( + src, IsInstantiation(_A("Proxy"), _A("Proxy"))); + REQUIRE_THAT( + src, IsInstantiation(_A("Proxy"), _A("Proxy"))); + REQUIRE_THAT(src, + IsAggregation(_A("ProxyHolder"), _A("Proxy"), "+proxy1")); + REQUIRE_THAT(src, + IsAggregation(_A("ProxyHolder"), _A("Proxy"), "+proxy2")); + REQUIRE_THAT( + src, !IsAggregation(_A("ProxyHolder"), _A("Target1"), "+proxy1")); + REQUIRE_THAT( + src, !IsAggregation(_A("ProxyHolder"), _A("Target2"), "+proxy2")); + REQUIRE_THAT(src, IsDependency(_A("Proxy"), _A("Target1"))); + REQUIRE_THAT(src, IsDependency(_A("Proxy"), _A("Target2"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00026/test_case.h b/tests/t00026/test_case.h index 070789ff..4b1ffdc6 100644 --- a/tests/t00026/test_case.h +++ b/tests/t00026/test_case.h @@ -29,21 +29,21 @@ TEST_CASE("t00026", "[test-case][class]") REQUIRE(model->name() == "t00026_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClassTemplate("Memento", "T")); - REQUIRE_THAT(puml, IsClassTemplate("Originator", "T")); - REQUIRE_THAT(puml, IsClassTemplate("Caretaker", "T")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClassTemplate("Memento", "T")); + REQUIRE_THAT(src, IsClassTemplate("Originator", "T")); + REQUIRE_THAT(src, IsClassTemplate("Caretaker", "T")); + REQUIRE_THAT(src, IsInstantiation( _A("Originator"), _A("Originator"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation(_A("Caretaker"), _A("Caretaker"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -57,8 +57,19 @@ TEST_CASE("t00026", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("Memento"))); + REQUIRE_THAT(src, IsClass(_A("Originator"))); + REQUIRE_THAT(src, IsClass(_A("Caretaker"))); + REQUIRE_THAT(src, + IsInstantiation( + _A("Originator"), _A("Originator"))); + REQUIRE_THAT(src, + IsInstantiation(_A("Caretaker"), _A("Caretaker"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00027/test_case.h b/tests/t00027/test_case.h index 02fa5290..df0534a6 100644 --- a/tests/t00027/test_case.h +++ b/tests/t00027/test_case.h @@ -29,34 +29,34 @@ TEST_CASE("t00027", "[test-case][class]") REQUIRE(model->name() == "t00027_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsAbstractClass(_A("Shape"))); - REQUIRE_THAT(puml, IsAbstractClass(_A("ShapeDecorator"))); - REQUIRE_THAT(puml, IsClassTemplate("Line", "T<>...")); - REQUIRE_THAT(puml, IsClassTemplate("Text", "T<>...")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsAbstractClass(_A("Shape"))); + REQUIRE_THAT(src, IsAbstractClass(_A("ShapeDecorator"))); + REQUIRE_THAT(src, IsClassTemplate("Line", "T<>...")); + REQUIRE_THAT(src, IsClassTemplate("Text", "T<>...")); REQUIRE_THAT( - puml, IsInstantiation(_A("Line...>"), _A("Line"))); - REQUIRE_THAT(puml, - IsInstantiation(_A("Line...>"), _A("Line"))); + src, IsInstantiation(_A("Line...>"), _A("Line"))); REQUIRE_THAT( - puml, IsInstantiation(_A("Text...>"), _A("Text"))); - REQUIRE_THAT(puml, - IsInstantiation(_A("Text...>"), _A("Text"))); + src, IsInstantiation(_A("Line...>"), _A("Line"))); + REQUIRE_THAT( + src, IsInstantiation(_A("Text...>"), _A("Text"))); + REQUIRE_THAT( + src, IsInstantiation(_A("Text...>"), _A("Text"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAggregation(_A("Window"), _A("Line"), "+border")); REQUIRE_THAT( - puml, IsAggregation(_A("Window"), _A("Line"), "+divider")); - REQUIRE_THAT(puml, + src, IsAggregation(_A("Window"), _A("Line"), "+divider")); + REQUIRE_THAT(src, IsAggregation(_A("Window"), _A("Text"), "+title")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAggregation(_A("Window"), _A("Text"), "+description")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -77,8 +77,33 @@ TEST_CASE("t00027", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsAbstractClass; + + REQUIRE_THAT(src, IsAbstractClass(_A("Shape"))); + REQUIRE_THAT(src, IsAbstractClass(_A("ShapeDecorator"))); + REQUIRE_THAT(src, IsClass(_A("Line...>"))); + REQUIRE_THAT(src, IsClass(_A("Text...>"))); + REQUIRE_THAT( + src, IsInstantiation(_A("Line...>"), _A("Line"))); + REQUIRE_THAT( + src, IsInstantiation(_A("Line...>"), _A("Line"))); + REQUIRE_THAT( + src, IsInstantiation(_A("Text...>"), _A("Text"))); + REQUIRE_THAT( + src, IsInstantiation(_A("Text...>"), _A("Text"))); + + REQUIRE_THAT(src, + IsAggregation(_A("Window"), _A("Line"), "+border")); + REQUIRE_THAT( + src, IsAggregation(_A("Window"), _A("Line"), "+divider")); + REQUIRE_THAT(src, + IsAggregation(_A("Window"), _A("Text"), "+title")); + REQUIRE_THAT(src, + IsAggregation(_A("Window"), _A("Text"), "+description")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00028/test_case.h b/tests/t00028/test_case.h index 1e0cf880..2ebe094f 100644 --- a/tests/t00028/test_case.h +++ b/tests/t00028/test_case.h @@ -29,41 +29,41 @@ TEST_CASE("t00028", "[test-case][class]") REQUIRE(model->name() == "t00028_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClassTemplate("E", "T")); - REQUIRE_THAT(puml, IsEnum(_A("F"))); - REQUIRE_THAT(puml, IsClass(_A("R"))); - REQUIRE_THAT(puml, HasNote(_A("A"), "top", "A class note.")); - REQUIRE_THAT(puml, HasNote(_A("B"), "left", "B class note.")); - REQUIRE_THAT(puml, HasNote(_A("C"), "bottom", "C class note.")); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClassTemplate("E", "T")); + REQUIRE_THAT(src, IsEnum(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + REQUIRE_THAT(src, HasNote(_A("A"), "top", "A class note.")); + REQUIRE_THAT(src, HasNote(_A("B"), "left", "B class note.")); + REQUIRE_THAT(src, HasNote(_A("C"), "bottom", "C class note.")); const auto d_note = R"( D class note.)"; - REQUIRE_THAT(puml, HasNote(_A("D"), "left", d_note)); + REQUIRE_THAT(src, HasNote(_A("D"), "left", d_note)); REQUIRE_THAT( - puml, HasNote(_A("E"), "left", "E template class note.")); - REQUIRE_THAT(puml, HasNote(_A("F"), "bottom", "F enum note.")); - REQUIRE_THAT(puml, !HasNote(_A("G"), "left", "G class note.")); - REQUIRE_THAT(puml, HasNote(_A("R"), "right", "R class note.")); - REQUIRE_THAT(puml, + src, HasNote(_A("E"), "left", "E template class note.")); + REQUIRE_THAT(src, HasNote(_A("F"), "bottom", "F enum note.")); + REQUIRE_THAT(src, !HasNote(_A("G"), "left", "G class note.")); + REQUIRE_THAT(src, HasNote(_A("R"), "right", "R class note.")); + REQUIRE_THAT(src, HasMemberNote( _A("R"), "aaa", "left", "R contains an instance of A.")); REQUIRE_THAT( - puml, !HasMemberNote(_A("R"), "bbb", "right", "R class note.")); + src, !HasMemberNote(_A("R"), "bbb", "right", "R class note.")); REQUIRE_THAT( - puml, HasMemberNote(_A("R"), "ccc", "left", "Reference to C.")); + src, HasMemberNote(_A("R"), "ccc", "left", "Reference to C.")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -73,8 +73,23 @@ note.)"; save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsEnum; + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsEnum(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + // REQUIRE_THAT(src, HasNote(_A("A"), "top", "A class note.")); + // REQUIRE_THAT(src, HasNote(_A("B"), "left", "B class note.")); + // REQUIRE_THAT(src, HasNote(_A("C"), "bottom", "C class + // note.")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00029/test_case.h b/tests/t00029/test_case.h index e7481ffa..de139312 100644 --- a/tests/t00029/test_case.h +++ b/tests/t00029/test_case.h @@ -29,31 +29,31 @@ TEST_CASE("t00029", "[test-case][class]") REQUIRE(model->name() == "t00029_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, !IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClassTemplate("C", "T")); - REQUIRE_THAT(puml, !IsClassTemplate("D", "T")); - REQUIRE_THAT(puml, IsEnum(_A("E"))); - REQUIRE_THAT(puml, !IsEnum(_A("F"))); - REQUIRE_THAT(puml, IsClass(_A("G1"))); - REQUIRE_THAT(puml, IsClass(_A("G2"))); - REQUIRE_THAT(puml, IsClass(_A("G3"))); - REQUIRE_THAT(puml, IsClass(_A("G4"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, !IsClass(_A("B"))); + REQUIRE_THAT(src, IsClassTemplate("C", "T")); + REQUIRE_THAT(src, !IsClassTemplate("D", "T")); + REQUIRE_THAT(src, IsEnum(_A("E"))); + REQUIRE_THAT(src, !IsEnum(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("G1"))); + REQUIRE_THAT(src, IsClass(_A("G2"))); + REQUIRE_THAT(src, IsClass(_A("G3"))); + REQUIRE_THAT(src, IsClass(_A("G4"))); - REQUIRE_THAT(puml, IsClass(_A("R"))); + REQUIRE_THAT(src, IsClass(_A("R"))); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("G1"), "+g1")); - REQUIRE_THAT(puml, !IsAggregation(_A("R"), _A("G2"), "+g2")); - REQUIRE_THAT(puml, !IsAggregation(_A("R"), _A("G3"), "+g3")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("G4"), "+g4")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("G1"), "+g1")); + REQUIRE_THAT(src, !IsAggregation(_A("R"), _A("G2"), "+g2")); + REQUIRE_THAT(src, !IsAggregation(_A("R"), _A("G3"), "+g3")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("G4"), "+g4")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -65,8 +65,29 @@ TEST_CASE("t00029", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsEnum; + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, !IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, !IsClass(_A("D"))); + REQUIRE_THAT(src, IsEnum(_A("E"))); + REQUIRE_THAT(src, !IsEnum(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("G1"))); + REQUIRE_THAT(src, IsClass(_A("G2"))); + REQUIRE_THAT(src, IsClass(_A("G3"))); + REQUIRE_THAT(src, IsClass(_A("G4"))); + + REQUIRE_THAT(src, IsClass(_A("R"))); + + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("G1"), "+g1")); + REQUIRE_THAT(src, !IsAggregation(_A("R"), _A("G2"), "+g2")); + REQUIRE_THAT(src, !IsAggregation(_A("R"), _A("G3"), "+g3")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("G4"), "+g4")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00030/test_case.h b/tests/t00030/test_case.h index 42195fd4..cb4ca72c 100644 --- a/tests/t00030/test_case.h +++ b/tests/t00030/test_case.h @@ -29,26 +29,26 @@ TEST_CASE("t00030", "[test-case][class]") REQUIRE(model->name() == "t00030_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("A"), "+aaa")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("A"), "+aaa")); REQUIRE_THAT( - puml, IsComposition(_A("R"), _A("B"), "+bbb", "0..1", "1..*")); + src, IsComposition(_A("R"), _A("B"), "+bbb", "0..1", "1..*")); REQUIRE_THAT( - puml, IsAggregation(_A("R"), _A("C"), "+ccc", "0..1", "1..5")); - REQUIRE_THAT(puml, IsAssociation(_A("R"), _A("D"), "+ddd", "", "1")); - REQUIRE_THAT(puml, IsAggregation(_A("R"), _A("E"), "+eee", "", "1")); + src, IsAggregation(_A("R"), _A("C"), "+ccc", "0..1", "1..5")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("D"), "+ddd", "", "1")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("E"), "+eee", "", "1")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -60,8 +60,23 @@ TEST_CASE("t00030", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("A"), "+aaa")); + REQUIRE_THAT( + src, IsComposition(_A("R"), _A("B"), "+bbb", "0..1", "1..*")); + REQUIRE_THAT( + src, IsAggregation(_A("R"), _A("C"), "+ccc", "0..1", "1..5")); + REQUIRE_THAT(src, IsAssociation(_A("R"), _A("D"), "+ddd", "", "1")); + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("E"), "+eee", "", "1")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00031/test_case.h b/tests/t00031/test_case.h index b5d573ee..921a4293 100644 --- a/tests/t00031/test_case.h +++ b/tests/t00031/test_case.h @@ -29,32 +29,32 @@ TEST_CASE("t00031", "[test-case][class]") REQUIRE(model->name() == "t00031_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsEnum(_A("B"))); - REQUIRE_THAT(puml, IsClassTemplate("C", "T")); - REQUIRE_THAT(puml, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsEnum(_A("B"))); + REQUIRE_THAT(src, IsClassTemplate("C", "T")); + REQUIRE_THAT(src, IsClass(_A("D"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAssociationWithStyle( _A("R"), _A("A"), "+aaa", "#red,dashed,thickness=2")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsCompositionWithStyle( _A("R"), _A("B"), "+bbb", "#green,dashed,thickness=4")); - REQUIRE_THAT(puml, IsDependency(_A("R"), _A("B"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency(_A("R"), _A("B"))); + REQUIRE_THAT(src, IsAggregationWithStyle( _A("R"), _A("C"), "+ccc", "#blue,dotted,thickness=8")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAssociationWithStyle( _A("R"), _A("D"), "+ddd", "#blue,plain,thickness=16")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -67,8 +67,16 @@ TEST_CASE("t00031", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsEnum; + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsEnum(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00032/test_case.h b/tests/t00032/test_case.h index 52b69bef..b444be75 100644 --- a/tests/t00032/test_case.h +++ b/tests/t00032/test_case.h @@ -29,40 +29,40 @@ TEST_CASE("t00032", "[test-case][class]") REQUIRE(model->name() == "t00032_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("Base"))); - REQUIRE_THAT(puml, IsClass(_A("TBase"))); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("R"))); + REQUIRE_THAT(src, IsClass(_A("Base"))); + REQUIRE_THAT(src, IsClass(_A("TBase"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("R"))); - REQUIRE_THAT(puml, IsClassTemplate("Overload", "T,L,Ts...")); + REQUIRE_THAT(src, IsClassTemplate("Overload", "T,L,Ts...")); - REQUIRE_THAT(puml, IsBaseClass(_A("Base"), _A("Overload"))); + REQUIRE_THAT(src, IsBaseClass(_A("Base"), _A("Overload"))); REQUIRE_THAT( - puml, IsBaseClass(_A("TBase"), _A("Overload"))); + src, IsBaseClass(_A("TBase"), _A("Overload"))); REQUIRE_THAT( - puml, IsBaseClass(_A("A"), _A("Overload"))); + src, IsBaseClass(_A("A"), _A("Overload"))); REQUIRE_THAT( - puml, IsBaseClass(_A("B"), _A("Overload"))); + src, IsBaseClass(_A("B"), _A("Overload"))); REQUIRE_THAT( - puml, IsBaseClass(_A("C"), _A("Overload"))); + src, IsBaseClass(_A("C"), _A("Overload"))); REQUIRE_THAT( - puml, !IsDependency(_A("Overload"), _A("TBase"))); + src, !IsDependency(_A("Overload"), _A("TBase"))); REQUIRE_THAT( - puml, !IsDependency(_A("Overload"), _A("A"))); + src, !IsDependency(_A("Overload"), _A("A"))); REQUIRE_THAT( - puml, !IsDependency(_A("Overload"), _A("B"))); + src, !IsDependency(_A("Overload"), _A("B"))); REQUIRE_THAT( - puml, !IsDependency(_A("Overload"), _A("C"))); + src, !IsDependency(_A("Overload"), _A("C"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -76,8 +76,37 @@ TEST_CASE("t00032", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("Base"))); + REQUIRE_THAT(src, IsClass(_A("TBase"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + + REQUIRE_THAT(src, IsClass(_A("Overload"))); + + REQUIRE_THAT(src, IsBaseClass(_A("Base"), _A("Overload"))); + REQUIRE_THAT( + src, IsBaseClass(_A("TBase"), _A("Overload"))); + REQUIRE_THAT( + src, IsBaseClass(_A("A"), _A("Overload"))); + REQUIRE_THAT( + src, IsBaseClass(_A("B"), _A("Overload"))); + REQUIRE_THAT( + src, IsBaseClass(_A("C"), _A("Overload"))); + REQUIRE_THAT( + src, !IsDependency(_A("Overload"), _A("TBase"))); + REQUIRE_THAT( + src, !IsDependency(_A("Overload"), _A("A"))); + REQUIRE_THAT( + src, !IsDependency(_A("Overload"), _A("B"))); + REQUIRE_THAT( + src, !IsDependency(_A("Overload"), _A("C"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00033/test_case.h b/tests/t00033/test_case.h index e5d6d658..f07ce69d 100644 --- a/tests/t00033/test_case.h +++ b/tests/t00033/test_case.h @@ -29,32 +29,32 @@ TEST_CASE("t00033", "[test-case][class]") REQUIRE(model->name() == "t00033_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClassTemplate("A", "T")); - REQUIRE_THAT(puml, IsClassTemplate("B", "T")); - REQUIRE_THAT(puml, IsClassTemplate("C", "T")); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClass(_A("R"))); + REQUIRE_THAT(src, IsClassTemplate("A", "T")); + REQUIRE_THAT(src, IsClassTemplate("B", "T")); + REQUIRE_THAT(src, IsClassTemplate("C", "T")); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("R"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency(_A("A>>>"), _A("B>>"))); REQUIRE_THAT( - puml, IsDependency(_A("B>>"), _A("C"))); - REQUIRE_THAT(puml, IsDependency(_A("C"), _A("D"))); + src, IsDependency(_A("B>>"), _A("C"))); + REQUIRE_THAT(src, IsDependency(_A("C"), _A("D"))); - REQUIRE_THAT(puml, IsInstantiation(_A("C"), _A("C"))); + REQUIRE_THAT(src, IsInstantiation(_A("C"), _A("C"))); REQUIRE_THAT( - puml, IsInstantiation(_A("B"), _A("B>>"))); - REQUIRE_THAT(puml, + src, IsInstantiation(_A("B"), _A("B>>"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A>>>"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -72,8 +72,29 @@ TEST_CASE("t00033", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + + REQUIRE_THAT(src, + IsDependency(_A("A>>>"), + _A("B>>"))); + REQUIRE_THAT( + src, IsDependency(_A("B>>"), _A("C"))); + REQUIRE_THAT(src, IsDependency(_A("C"), _A("D"))); + + REQUIRE_THAT(src, IsInstantiation(_A("C"), _A("C"))); + REQUIRE_THAT( + src, IsInstantiation(_A("B"), _A("B>>"))); + REQUIRE_THAT(src, + IsInstantiation(_A("A"), _A("A>>>"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00034/test_case.h b/tests/t00034/test_case.h index 84766a52..c6894e43 100644 --- a/tests/t00034/test_case.h +++ b/tests/t00034/test_case.h @@ -29,24 +29,24 @@ TEST_CASE("t00034", "[test-case][class]") REQUIRE(model->name() == "t00034_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClassTemplate("lift_void", "T")); - REQUIRE_THAT(puml, IsClassTemplate("drop_void", "T")); - REQUIRE_THAT(puml, IsClass(_A("Void"))); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("R"))); + REQUIRE_THAT(src, IsClassTemplate("lift_void", "T")); + REQUIRE_THAT(src, IsClassTemplate("drop_void", "T")); + REQUIRE_THAT(src, IsClass(_A("Void"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("R"))); REQUIRE_THAT( - puml, IsInstantiation(_A("lift_void"), _A("lift_void"))); + src, IsInstantiation(_A("lift_void"), _A("lift_void"))); REQUIRE_THAT( - puml, IsInstantiation(_A("drop_void"), _A("drop_void"))); + src, IsInstantiation(_A("drop_void"), _A("drop_void"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -59,8 +59,21 @@ TEST_CASE("t00034", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("lift_void"))); + REQUIRE_THAT(src, IsClass(_A("drop_void"))); + REQUIRE_THAT(src, IsClass(_A("Void"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + + REQUIRE_THAT( + src, IsInstantiation(_A("lift_void"), _A("lift_void"))); + REQUIRE_THAT( + src, IsInstantiation(_A("drop_void"), _A("drop_void"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00035/test_case.h b/tests/t00035/test_case.h index e280e3bf..59b9976b 100644 --- a/tests/t00035/test_case.h +++ b/tests/t00035/test_case.h @@ -29,24 +29,24 @@ TEST_CASE("t00035", "[test-case][class]") REQUIRE(model->name() == "t00035_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("Top"))); - REQUIRE_THAT(puml, IsClass(_A("Bottom"))); - REQUIRE_THAT(puml, IsClass(_A("Center"))); - REQUIRE_THAT(puml, IsClass(_A("Left"))); - REQUIRE_THAT(puml, IsClass(_A("Right"))); + REQUIRE_THAT(src, IsClass(_A("Top"))); + REQUIRE_THAT(src, IsClass(_A("Bottom"))); + REQUIRE_THAT(src, IsClass(_A("Center"))); + REQUIRE_THAT(src, IsClass(_A("Left"))); + REQUIRE_THAT(src, IsClass(_A("Right"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("Center"), "up", _A("Top"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("Center"), "left", _A("Left"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("Center"), "right", _A("Right"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("Center"), "down", _A("Bottom"))); + REQUIRE_THAT(src, IsLayoutHint(_A("Center"), "up", _A("Top"))); + REQUIRE_THAT(src, IsLayoutHint(_A("Center"), "left", _A("Left"))); + REQUIRE_THAT(src, IsLayoutHint(_A("Center"), "right", _A("Right"))); + REQUIRE_THAT(src, IsLayoutHint(_A("Center"), "down", _A("Bottom"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -62,8 +62,16 @@ TEST_CASE("t00035", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("Top"))); + REQUIRE_THAT(src, IsClass(_A("Bottom"))); + REQUIRE_THAT(src, IsClass(_A("Center"))); + REQUIRE_THAT(src, IsClass(_A("Left"))); + REQUIRE_THAT(src, IsClass(_A("Right"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00036/test_case.h b/tests/t00036/test_case.h index 8018919a..80643126 100644 --- a/tests/t00036/test_case.h +++ b/tests/t00036/test_case.h @@ -30,26 +30,26 @@ TEST_CASE("t00036", "[test-case][class]") REQUIRE(model->name() == "t00036_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClassTemplate("A", "T")); - REQUIRE_THAT(puml, IsClassTemplate("A", "int")); - REQUIRE_THAT(puml, IsEnum(_A("E"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, !IsClass(_A("DImpl"))); - REQUIRE_THAT(puml, IsPackage("ns111")); - REQUIRE_THAT(puml, IsPackage("ns22")); - REQUIRE_THAT(puml, !IsPackage("ns3")); - REQUIRE_THAT(puml, !IsPackage("ns33")); + REQUIRE_THAT(src, IsClassTemplate("A", "T")); + REQUIRE_THAT(src, IsClassTemplate("A", "int")); + REQUIRE_THAT(src, IsEnum(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, !IsClass(_A("DImpl"))); + REQUIRE_THAT(src, IsPackage("ns111")); + REQUIRE_THAT(src, IsPackage("ns22")); + REQUIRE_THAT(src, !IsPackage("ns3")); + REQUIRE_THAT(src, !IsPackage("ns33")); - REQUIRE_THAT(puml, IsAggregation(_A("B"), _A("A"), "+a_int")); + REQUIRE_THAT(src, IsAggregation(_A("B"), _A("A"), "+a_int")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -69,8 +69,22 @@ TEST_CASE("t00036", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsEnum; + + REQUIRE_THAT(src, IsClass(_A("ns1::ns11::A"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns11::A"))); + REQUIRE_THAT(src, IsEnum(_A("ns1::E"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns11::ns111::B"))); + REQUIRE_THAT(src, IsClass(_A("ns2::ns22::C"))); + REQUIRE_THAT(src, !IsClass(_A("DImpl"))); + + REQUIRE_THAT(src, + IsAggregation( + _A("ns1::ns11::ns111::B"), _A("ns1::ns11::A"), "+a_int")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00037/test_case.h b/tests/t00037/test_case.h index c622a63c..6742a1d1 100644 --- a/tests/t00037/test_case.h +++ b/tests/t00037/test_case.h @@ -30,22 +30,21 @@ TEST_CASE("t00037", "[test-case][class]") REQUIRE(model->name() == "t00037_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("ST"))); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("ST::(units)"))); - REQUIRE_THAT(puml, IsClass(_A("ST::(dimensions)"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsClass(_A("ST"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("ST::(units)"))); + REQUIRE_THAT(src, IsClass(_A("ST::(dimensions)"))); + REQUIRE_THAT(src, IsAggregation(_A("ST"), _A("ST::(dimensions)"), "+dimensions")); - REQUIRE_THAT( - puml, IsAggregation(_A("ST"), _A("ST::(units)"), "-units")); + REQUIRE_THAT(src, IsAggregation(_A("ST"), _A("ST::(units)"), "-units")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -61,8 +60,18 @@ TEST_CASE("t00037", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("ST"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("ST::(units)"))); + REQUIRE_THAT(src, IsClass(_A("ST::(dimensions)"))); + REQUIRE_THAT(src, + IsAggregation(_A("ST"), _A("ST::(dimensions)"), "+dimensions")); + REQUIRE_THAT(src, IsAggregation(_A("ST"), _A("ST::(units)"), "-units")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00038/test_case.h b/tests/t00038/test_case.h index cae0a9a2..b9d1e47c 100644 --- a/tests/t00038/test_case.h +++ b/tests/t00038/test_case.h @@ -30,73 +30,73 @@ TEST_CASE("t00038", "[test-case][class]") REQUIRE(model->name() == "t00038_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("thirdparty::ns1::E"))); - REQUIRE_THAT(puml, IsClass(_A("key_t"))); - REQUIRE_THAT(puml, IsClassTemplate("map", "T")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("thirdparty::ns1::E"))); + REQUIRE_THAT(src, IsClass(_A("key_t"))); + REQUIRE_THAT(src, IsClassTemplate("map", "T")); + REQUIRE_THAT(src, IsClassTemplate("map", "std::integral_constant")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsClassTemplate("map", "std::vector>")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsClassTemplate("map", "std::map>>")); - REQUIRE_THAT(puml, IsEnum(_A("property_t"))); + REQUIRE_THAT(src, IsEnum(_A("property_t"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation(_A("map"), _A("map>>>"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency(_A("map>"), _A("property_t"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency(_A("map<" "std::vector>>"), _A("property_t"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency( _A("map>>>"), _A("property_t"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency( _A("map>>>"), _A("key_t"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency( _A("map>"), _A("thirdparty::ns1::color_t"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsBaseClass(_A("thirdparty::ns1::E"), _A("map>"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -110,8 +110,71 @@ TEST_CASE("t00038", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsEnum; + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("thirdparty::ns1::E"))); + REQUIRE_THAT(src, IsClass(_A("key_t"))); + REQUIRE_THAT(src, IsClass(_A("map"))); + REQUIRE_THAT(src, + IsClass(_A("map>"))); + REQUIRE_THAT(src, + IsClass(_A( + "map>>"))); + REQUIRE_THAT(src, + IsClass(_A("map>>>"))); + + REQUIRE_THAT(src, IsEnum(_A("property_t"))); + + REQUIRE_THAT(src, + IsInstantiation(_A("map"), + _A("map>>>"))); + + REQUIRE_THAT(src, + IsDependency(_A("map>"), + _A("property_t"))); + + REQUIRE_THAT(src, + IsDependency(_A("map<" + "std::vector>>"), + _A("property_t"))); + + REQUIRE_THAT(src, + IsDependency( + _A("map>>>"), + _A("property_t"))); + + REQUIRE_THAT(src, + IsDependency( + _A("map>>>"), + _A("key_t"))); + + REQUIRE_THAT(src, + IsDependency( + _A("map>"), + _A("thirdparty::ns1::color_t"))); + + REQUIRE_THAT(src, + IsBaseClass(_A("thirdparty::ns1::E"), + _A("map>"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00039/test_case.h b/tests/t00039/test_case.h index 358af15c..d5edad61 100644 --- a/tests/t00039/test_case.h +++ b/tests/t00039/test_case.h @@ -29,41 +29,41 @@ TEST_CASE("t00039", "[test-case][class]") REQUIRE(model->name() == "t00039_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("AA"))); - REQUIRE_THAT(puml, IsClass(_A("AAA"))); - REQUIRE_THAT(puml, IsClass(_A("ns2::AAAA"))); - REQUIRE_THAT(puml, IsBaseClass(_A("A"), _A("AA"))); - REQUIRE_THAT(puml, IsBaseClass(_A("AA"), _A("AAA"))); - REQUIRE_THAT(puml, IsBaseClass(_A("AAA"), _A("ns2::AAAA"))); - REQUIRE_THAT(puml, !IsClass(_A("detail::AA"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("AA"))); + REQUIRE_THAT(src, IsClass(_A("AAA"))); + REQUIRE_THAT(src, IsClass(_A("ns2::AAAA"))); + REQUIRE_THAT(src, IsBaseClass(_A("A"), _A("AA"))); + REQUIRE_THAT(src, IsBaseClass(_A("AA"), _A("AAA"))); + REQUIRE_THAT(src, IsBaseClass(_A("AAA"), _A("ns2::AAAA"))); + REQUIRE_THAT(src, !IsClass(_A("detail::AA"))); - REQUIRE_THAT(puml, !IsClass(_A("B"))); - REQUIRE_THAT(puml, !IsClass(_A("ns1::BB"))); + REQUIRE_THAT(src, !IsClass(_A("B"))); + REQUIRE_THAT(src, !IsClass(_A("ns1::BB"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClass(_A("E"))); - REQUIRE_THAT(puml, IsBaseClass(_A("C"), _A("CD"))); - REQUIRE_THAT(puml, IsBaseClass(_A("D"), _A("CD"))); - REQUIRE_THAT(puml, IsBaseClass(_A("D"), _A("DE"))); - REQUIRE_THAT(puml, IsBaseClass(_A("E"), _A("DE"))); - REQUIRE_THAT(puml, IsBaseClass(_A("C"), _A("CDE"))); - REQUIRE_THAT(puml, IsBaseClass(_A("D"), _A("CDE"))); - REQUIRE_THAT(puml, IsBaseClass(_A("E"), _A("CDE"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsBaseClass(_A("C"), _A("CD"))); + REQUIRE_THAT(src, IsBaseClass(_A("D"), _A("CD"))); + REQUIRE_THAT(src, IsBaseClass(_A("D"), _A("DE"))); + REQUIRE_THAT(src, IsBaseClass(_A("E"), _A("DE"))); + REQUIRE_THAT(src, IsBaseClass(_A("C"), _A("CDE"))); + REQUIRE_THAT(src, IsBaseClass(_A("D"), _A("CDE"))); + REQUIRE_THAT(src, IsBaseClass(_A("E"), _A("CDE"))); - REQUIRE_THAT(puml, IsClassTemplate("ns3::F", "T")); - REQUIRE_THAT(puml, IsClassTemplate("ns3::FF", "T,M")); - REQUIRE_THAT(puml, IsClassTemplate("ns3::FE", "T,M")); - REQUIRE_THAT(puml, IsClassTemplate("ns3::FFF", "T,M,N")); + REQUIRE_THAT(src, IsClassTemplate("ns3::F", "T")); + REQUIRE_THAT(src, IsClassTemplate("ns3::FF", "T,M")); + REQUIRE_THAT(src, IsClassTemplate("ns3::FE", "T,M")); + REQUIRE_THAT(src, IsClassTemplate("ns3::FFF", "T,M,N")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -86,8 +86,38 @@ TEST_CASE("t00039", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("AA"))); + REQUIRE_THAT(src, IsClass(_A("AAA"))); + REQUIRE_THAT(src, IsClass(_A("ns2::AAAA"))); + REQUIRE_THAT(src, IsBaseClass(_A("A"), _A("AA"))); + REQUIRE_THAT(src, IsBaseClass(_A("AA"), _A("AAA"))); + REQUIRE_THAT(src, IsBaseClass(_A("AAA"), _A("ns2::AAAA"))); + REQUIRE_THAT(src, !IsClass(_A("detail::AA"))); + + REQUIRE_THAT(src, !IsClass(_A("B"))); + REQUIRE_THAT(src, !IsClass(_A("ns1::BB"))); + + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsBaseClass(_A("C"), _A("CD"))); + REQUIRE_THAT(src, IsBaseClass(_A("D"), _A("CD"))); + REQUIRE_THAT(src, IsBaseClass(_A("D"), _A("DE"))); + REQUIRE_THAT(src, IsBaseClass(_A("E"), _A("DE"))); + REQUIRE_THAT(src, IsBaseClass(_A("C"), _A("CDE"))); + REQUIRE_THAT(src, IsBaseClass(_A("D"), _A("CDE"))); + REQUIRE_THAT(src, IsBaseClass(_A("E"), _A("CDE"))); + + REQUIRE_THAT(src, IsClass(_A("ns3::F"))); + REQUIRE_THAT(src, IsClass(_A("ns3::FF"))); + REQUIRE_THAT(src, IsClass(_A("ns3::FE"))); + REQUIRE_THAT(src, IsClass(_A("ns3::FFF"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t00040/test_case.h b/tests/t00040/test_case.h index c2e48012..8305da37 100644 --- a/tests/t00040/test_case.h +++ b/tests/t00040/test_case.h @@ -29,23 +29,23 @@ TEST_CASE("t00040", "[test-case][class]") REQUIRE(model->name() == "t00040_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("AA"))); - REQUIRE_THAT(puml, IsClass(_A("AAA"))); - REQUIRE_THAT(puml, IsBaseClass(_A("A"), _A("AA"))); - REQUIRE_THAT(puml, IsBaseClass(_A("AA"), _A("AAA"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("AA"))); + REQUIRE_THAT(src, IsClass(_A("AAA"))); + REQUIRE_THAT(src, IsBaseClass(_A("A"), _A("AA"))); + REQUIRE_THAT(src, IsBaseClass(_A("AA"), _A("AAA"))); - REQUIRE_THAT(puml, !IsClass(_A("B"))); + REQUIRE_THAT(src, !IsClass(_A("B"))); - REQUIRE_THAT(puml, !IsDependency(_A("R"), _A("A"))); + REQUIRE_THAT(src, !IsDependency(_A("R"), _A("A"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -59,8 +59,20 @@ TEST_CASE("t00040", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("AA"))); + REQUIRE_THAT(src, IsClass(_A("AAA"))); + REQUIRE_THAT(src, IsBaseClass(_A("A"), _A("AA"))); + REQUIRE_THAT(src, IsBaseClass(_A("AA"), _A("AAA"))); + + REQUIRE_THAT(src, !IsClass(_A("B"))); + + REQUIRE_THAT(src, !IsDependency(_A("R"), _A("A"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00041/test_case.h b/tests/t00041/test_case.h index f84812d1..5d7f19cd 100644 --- a/tests/t00041/test_case.h +++ b/tests/t00041/test_case.h @@ -30,42 +30,42 @@ TEST_CASE("t00041", "[test-case][class]") REQUIRE(model->name() == "t00041_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, !IsClass(_A("A"))); - REQUIRE_THAT(puml, !IsClass(_A("AA"))); - REQUIRE_THAT(puml, !IsClass(_A("AAA"))); + REQUIRE_THAT(src, !IsClass(_A("A"))); + REQUIRE_THAT(src, !IsClass(_A("AA"))); + REQUIRE_THAT(src, !IsClass(_A("AAA"))); - REQUIRE_THAT(puml, !IsClass(_A("B"))); + REQUIRE_THAT(src, !IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClass(_A("E"))); - REQUIRE_THAT(puml, IsClass(_A("F"))); - REQUIRE_THAT(puml, IsClass(_A("R"))); - REQUIRE_THAT(puml, IsClass(_A("RR"))); - REQUIRE_THAT(puml, IsClass(_A("RRR"))); - REQUIRE_THAT(puml, !IsClass(_A("detail::G"))); - REQUIRE_THAT(puml, !IsClass(_A("H"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + REQUIRE_THAT(src, IsClass(_A("RR"))); + REQUIRE_THAT(src, IsClass(_A("RRR"))); + REQUIRE_THAT(src, !IsClass(_A("detail::G"))); + REQUIRE_THAT(src, !IsClass(_A("H"))); - REQUIRE_THAT(puml, IsBaseClass(_A("R"), _A("RR"))); - REQUIRE_THAT(puml, IsBaseClass(_A("RR"), _A("RRR"))); + REQUIRE_THAT(src, IsBaseClass(_A("R"), _A("RR"))); + REQUIRE_THAT(src, IsBaseClass(_A("RR"), _A("RRR"))); - REQUIRE_THAT(puml, IsAssociation(_A("D"), _A("RR"), "+rr")); - REQUIRE_THAT(puml, IsAssociation(_A("RR"), _A("E"), "+e")); - REQUIRE_THAT(puml, IsAssociation(_A("RR"), _A("F"), "+f")); - REQUIRE_THAT(puml, !IsDependency(_A("RR"), _A("H"))); + REQUIRE_THAT(src, IsAssociation(_A("D"), _A("RR"), "+rr")); + REQUIRE_THAT(src, IsAssociation(_A("RR"), _A("E"), "+e")); + REQUIRE_THAT(src, IsAssociation(_A("RR"), _A("F"), "+f")); + REQUIRE_THAT(src, !IsDependency(_A("RR"), _A("H"))); - REQUIRE_THAT(puml, IsClass(_A("ns1::N"))); - REQUIRE_THAT(puml, IsClass(_A("ns1::NN"))); - REQUIRE_THAT(puml, IsClass(_A("ns1::NM"))); - REQUIRE_THAT(puml, IsBaseClass(_A("ns1::N"), _A("ns1::NN"))); - REQUIRE_THAT(puml, IsBaseClass(_A("ns1::N"), _A("ns1::NM"))); + REQUIRE_THAT(src, IsClass(_A("ns1::N"))); + REQUIRE_THAT(src, IsClass(_A("ns1::NN"))); + REQUIRE_THAT(src, IsClass(_A("ns1::NM"))); + REQUIRE_THAT(src, IsBaseClass(_A("ns1::N"), _A("ns1::NN"))); + REQUIRE_THAT(src, IsBaseClass(_A("ns1::N"), _A("ns1::NM"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -85,8 +85,39 @@ TEST_CASE("t00041", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, !IsClass(_A("A"))); + REQUIRE_THAT(src, !IsClass(_A("AA"))); + REQUIRE_THAT(src, !IsClass(_A("AAA"))); + + REQUIRE_THAT(src, !IsClass(_A("B"))); + + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + REQUIRE_THAT(src, IsClass(_A("RR"))); + REQUIRE_THAT(src, IsClass(_A("RRR"))); + REQUIRE_THAT(src, !IsClass(_A("detail::G"))); + REQUIRE_THAT(src, !IsClass(_A("H"))); + + REQUIRE_THAT(src, IsBaseClass(_A("R"), _A("RR"))); + REQUIRE_THAT(src, IsBaseClass(_A("RR"), _A("RRR"))); + + REQUIRE_THAT(src, IsAssociation(_A("D"), _A("RR"), "+rr")); + REQUIRE_THAT(src, IsAssociation(_A("RR"), _A("E"), "+e")); + REQUIRE_THAT(src, IsAssociation(_A("RR"), _A("F"), "+f")); + REQUIRE_THAT(src, !IsDependency(_A("RR"), _A("H"))); + + REQUIRE_THAT(src, IsClass(_A("ns1::N"))); + REQUIRE_THAT(src, IsClass(_A("ns1::NN"))); + REQUIRE_THAT(src, IsClass(_A("ns1::NM"))); + REQUIRE_THAT(src, IsBaseClass(_A("ns1::N"), _A("ns1::NN"))); + REQUIRE_THAT(src, IsBaseClass(_A("ns1::N"), _A("ns1::NM"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00042/test_case.h b/tests/t00042/test_case.h index 3de29443..008cb13b 100644 --- a/tests/t00042/test_case.h +++ b/tests/t00042/test_case.h @@ -30,17 +30,17 @@ TEST_CASE("t00042", "[test-case][class]") REQUIRE(model->name() == "t00042_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClassTemplate("A", "T")); - REQUIRE_THAT(puml, IsClassTemplate("B", "T,K")); - REQUIRE_THAT(puml, !IsClassTemplate("C", "T")); + REQUIRE_THAT(src, IsClassTemplate("A", "T")); + REQUIRE_THAT(src, IsClassTemplate("B", "T,K")); + REQUIRE_THAT(src, !IsClassTemplate("C", "T")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -53,8 +53,14 @@ TEST_CASE("t00042", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, !IsClass(_A("C"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00043/test_case.h b/tests/t00043/test_case.h index b2fadaa2..5355d787 100644 --- a/tests/t00043/test_case.h +++ b/tests/t00043/test_case.h @@ -30,40 +30,40 @@ TEST_CASE("t00043", "[test-case][class]") REQUIRE(model->name() == "t00043_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check dependants filter - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("BB"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClass(_A("E"))); - REQUIRE_THAT(puml, !IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("BB"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, !IsClass(_A("F"))); - REQUIRE_THAT(puml, IsDependency(_A("B"), _A("A"))); - REQUIRE_THAT(puml, IsDependency(_A("BB"), _A("A"))); - REQUIRE_THAT(puml, IsDependency(_A("C"), _A("B"))); - REQUIRE_THAT(puml, IsDependency(_A("D"), _A("C"))); - REQUIRE_THAT(puml, IsDependency(_A("E"), _A("D"))); + REQUIRE_THAT(src, IsDependency(_A("B"), _A("A"))); + REQUIRE_THAT(src, IsDependency(_A("BB"), _A("A"))); + REQUIRE_THAT(src, IsDependency(_A("C"), _A("B"))); + REQUIRE_THAT(src, IsDependency(_A("D"), _A("C"))); + REQUIRE_THAT(src, IsDependency(_A("E"), _A("D"))); // Check dependencies filter - REQUIRE_THAT(puml, IsClass(_A("G"))); - REQUIRE_THAT(puml, IsClass(_A("GG"))); - REQUIRE_THAT(puml, IsClass(_A("H"))); - REQUIRE_THAT(puml, !IsClass(_A("HH"))); - REQUIRE_THAT(puml, IsClass(_A("I"))); - REQUIRE_THAT(puml, IsClass(_A("J"))); + REQUIRE_THAT(src, IsClass(_A("G"))); + REQUIRE_THAT(src, IsClass(_A("GG"))); + REQUIRE_THAT(src, IsClass(_A("H"))); + REQUIRE_THAT(src, !IsClass(_A("HH"))); + REQUIRE_THAT(src, IsClass(_A("I"))); + REQUIRE_THAT(src, IsClass(_A("J"))); - REQUIRE_THAT(puml, IsDependency(_A("H"), _A("G"))); - REQUIRE_THAT(puml, IsDependency(_A("H"), _A("GG"))); - REQUIRE_THAT(puml, IsDependency(_A("I"), _A("H"))); - REQUIRE_THAT(puml, IsDependency(_A("J"), _A("I"))); + REQUIRE_THAT(src, IsDependency(_A("H"), _A("G"))); + REQUIRE_THAT(src, IsDependency(_A("H"), _A("GG"))); + REQUIRE_THAT(src, IsDependency(_A("I"), _A("H"))); + REQUIRE_THAT(src, IsDependency(_A("J"), _A("I"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -87,8 +87,46 @@ TEST_CASE("t00043", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + // Check dependants filter + REQUIRE_THAT(src, IsClass(_A("dependants::A"))); + REQUIRE_THAT(src, IsClass(_A("dependants::B"))); + REQUIRE_THAT(src, IsClass(_A("dependants::BB"))); + REQUIRE_THAT(src, IsClass(_A("dependants::D"))); + REQUIRE_THAT(src, IsClass(_A("dependants::E"))); + REQUIRE_THAT(src, !IsClass(_A("dependants::F"))); + + REQUIRE_THAT( + src, IsDependency(_A("dependants::B"), _A("dependants::A"))); + REQUIRE_THAT( + src, IsDependency(_A("dependants::BB"), _A("dependants::A"))); + REQUIRE_THAT( + src, IsDependency(_A("dependants::C"), _A("dependants::B"))); + REQUIRE_THAT( + src, IsDependency(_A("dependants::D"), _A("dependants::C"))); + REQUIRE_THAT( + src, IsDependency(_A("dependants::E"), _A("dependants::D"))); + + // Check dependencies filter + REQUIRE_THAT(src, IsClass(_A("dependencies::G"))); + REQUIRE_THAT(src, IsClass(_A("dependencies::GG"))); + REQUIRE_THAT(src, IsClass(_A("dependencies::H"))); + REQUIRE_THAT(src, !IsClass(_A("dependencies::HH"))); + REQUIRE_THAT(src, IsClass(_A("dependencies::I"))); + REQUIRE_THAT(src, IsClass(_A("dependencies::J"))); + + REQUIRE_THAT( + src, IsDependency(_A("dependencies::H"), _A("dependencies::G"))); + REQUIRE_THAT( + src, IsDependency(_A("dependencies::H"), _A("dependencies::GG"))); + REQUIRE_THAT( + src, IsDependency(_A("dependencies::I"), _A("dependencies::H"))); + REQUIRE_THAT( + src, IsDependency(_A("dependencies::J"), _A("dependencies::I"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00044/test_case.h b/tests/t00044/test_case.h index 831a0d34..e20a1e6d 100644 --- a/tests/t00044/test_case.h +++ b/tests/t00044/test_case.h @@ -30,41 +30,41 @@ TEST_CASE("t00044", "[test-case][class]") REQUIRE(model->name() == "t00044_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, !Contains("type-parameter-")); + REQUIRE_THAT(src, !Contains("type-parameter-")); - REQUIRE_THAT(puml, IsClassTemplate("sink", "T")); - REQUIRE_THAT(puml, IsClassTemplate("signal_handler", "T,A")); + REQUIRE_THAT(src, IsClassTemplate("sink", "T")); + REQUIRE_THAT(src, IsClassTemplate("signal_handler", "T,A")); - REQUIRE_THAT(puml, IsClassTemplate("signal_handler", "Ret(Args...),A")); - REQUIRE_THAT(puml, IsClassTemplate("signal_handler", "void(int),bool")); + REQUIRE_THAT(src, IsClassTemplate("signal_handler", "Ret(Args...),A")); + REQUIRE_THAT(src, IsClassTemplate("signal_handler", "void(int),bool")); REQUIRE_THAT( - puml, IsClassTemplate("sink", "signal_handler")); + src, IsClassTemplate("sink", "signal_handler")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation( _A("sink"), _A("sink>"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation(_A("sink>"), _A("sink>"))); - REQUIRE_THAT(puml, IsClassTemplate("signal_handler", "T,A")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsClassTemplate("signal_handler", "T,A")); + REQUIRE_THAT(src, IsInstantiation(_A("signal_handler"), _A("signal_handler"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation(_A("signal_handler"), _A("signal_handler"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -82,8 +82,37 @@ TEST_CASE("t00044", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, !Contains("type-parameter-")); + + REQUIRE_THAT(src, IsClass(_A("sink"))); + REQUIRE_THAT(src, IsClass(_A("signal_handler"))); + + REQUIRE_THAT(src, IsClass(_A("signal_handler"))); + REQUIRE_THAT(src, IsClass(_A("signal_handler"))); + + REQUIRE_THAT(src, IsClass(_A("sink>"))); + + REQUIRE_THAT(src, + IsInstantiation( + _A("sink"), _A("sink>"))); + + REQUIRE_THAT(src, + IsInstantiation(_A("sink>"), + _A("sink>"))); + + REQUIRE_THAT(src, IsClass(_A("signal_handler"))); + REQUIRE_THAT(src, + IsInstantiation(_A("signal_handler"), + _A("signal_handler"))); + + REQUIRE_THAT(src, + IsInstantiation(_A("signal_handler"), + _A("signal_handler"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00045/test_case.h b/tests/t00045/test_case.h index 35965dd2..e91de811 100644 --- a/tests/t00045/test_case.h +++ b/tests/t00045/test_case.h @@ -29,44 +29,43 @@ TEST_CASE("t00045", "[test-case][class]") REQUIRE(model->name() == "t00045_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("ns1::A"))); - REQUIRE_THAT(puml, IsClass(_A("ns1::ns2::A"))); - REQUIRE_THAT(puml, IsClass(_A("ns1::ns2::B"))); - REQUIRE_THAT(puml, IsClass(_A("ns1::ns2::C"))); - REQUIRE_THAT(puml, IsClass(_A("ns1::ns2::D"))); - REQUIRE_THAT(puml, IsClass(_A("ns1::ns2::E"))); - REQUIRE_THAT(puml, IsClass(_A("ns1::ns2::R"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("ns1::A"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::A"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::B"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::C"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::D"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::E"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::R"))); - REQUIRE_THAT(puml, IsBaseClass(_A("ns1::ns2::A"), _A("ns1::ns2::B"))); - REQUIRE_THAT(puml, IsBaseClass(_A("ns1::A"), _A("ns1::ns2::C"))); - REQUIRE_THAT(puml, IsBaseClass(_A("ns1::ns2::A"), _A("ns1::ns2::D"))); - REQUIRE_THAT(puml, IsBaseClass(_A("A"), _A("ns1::ns2::E"))); + REQUIRE_THAT(src, IsBaseClass(_A("ns1::ns2::A"), _A("ns1::ns2::B"))); + REQUIRE_THAT(src, IsBaseClass(_A("ns1::A"), _A("ns1::ns2::C"))); + REQUIRE_THAT(src, IsBaseClass(_A("ns1::ns2::A"), _A("ns1::ns2::D"))); + REQUIRE_THAT(src, IsBaseClass(_A("A"), _A("ns1::ns2::E"))); REQUIRE_THAT( - puml, IsAssociation(_A("ns1::ns2::R"), _A("ns1::ns2::A"), "+a")); + src, IsAssociation(_A("ns1::ns2::R"), _A("ns1::ns2::A"), "+a")); REQUIRE_THAT( - puml, IsAssociation(_A("ns1::ns2::R"), _A("ns1::A"), "+ns1_a")); - REQUIRE_THAT(puml, + src, IsAssociation(_A("ns1::ns2::R"), _A("ns1::A"), "+ns1_a")); + REQUIRE_THAT(src, IsAssociation(_A("ns1::ns2::R"), _A("ns1::ns2::A"), "+ns1_ns2_a")); - REQUIRE_THAT( - puml, IsAssociation(_A("ns1::ns2::R"), _A("A"), "+root_a")); + REQUIRE_THAT(src, IsAssociation(_A("ns1::ns2::R"), _A("A"), "+root_a")); - REQUIRE_THAT(puml, IsDependency(_A("ns1::ns2::R"), _A("AA"))); + REQUIRE_THAT(src, IsDependency(_A("ns1::ns2::R"), _A("AA"))); - REQUIRE_THAT(puml, IsFriend(_A("ns1::ns2::R"), _A("AAA"))); + REQUIRE_THAT(src, IsFriend(_A("ns1::ns2::R"), _A("AAA"))); REQUIRE_THAT( - puml, !IsFriend(_A("ns1::ns2::R"), _A("ns1::ns2::AAA"))); + src, !IsFriend(_A("ns1::ns2::R"), _A("ns1::ns2::AAA"))); // TODO: // REQUIRE_THAT(puml, IsFriend(_A("ns1::ns2::R"), // _A("AAAA"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -87,8 +86,38 @@ TEST_CASE("t00045", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("ns1::A"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::A"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::B"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::C"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::D"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::E"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::R"))); + + REQUIRE_THAT(src, IsBaseClass(_A("ns1::ns2::A"), _A("ns1::ns2::B"))); + REQUIRE_THAT(src, IsBaseClass(_A("ns1::A"), _A("ns1::ns2::C"))); + REQUIRE_THAT(src, IsBaseClass(_A("ns1::ns2::A"), _A("ns1::ns2::D"))); + REQUIRE_THAT(src, IsBaseClass(_A("A"), _A("ns1::ns2::E"))); + + REQUIRE_THAT( + src, IsAssociation(_A("ns1::ns2::R"), _A("ns1::ns2::A"), "+a")); + REQUIRE_THAT( + src, IsAssociation(_A("ns1::ns2::R"), _A("ns1::A"), "+ns1_a")); + REQUIRE_THAT(src, + IsAssociation(_A("ns1::ns2::R"), _A("ns1::ns2::A"), "+ns1_ns2_a")); + REQUIRE_THAT(src, IsAssociation(_A("ns1::ns2::R"), _A("A"), "+root_a")); + + REQUIRE_THAT(src, IsDependency(_A("ns1::ns2::R"), _A("AA"))); + + REQUIRE_THAT(src, IsFriend(_A("ns1::ns2::R"), _A("AAA"))); + REQUIRE_THAT( + src, !IsFriend(_A("ns1::ns2::R"), _A("ns1::ns2::AAA"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00046/test_case.h b/tests/t00046/test_case.h index d79a5ee4..11272ee2 100644 --- a/tests/t00046/test_case.h +++ b/tests/t00046/test_case.h @@ -29,21 +29,21 @@ TEST_CASE("t00046", "[test-case][class]") REQUIRE(model->name() == "t00046_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClass(_A("E"))); - REQUIRE_THAT(puml, IsClass(_A("R"))); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("R"))); - REQUIRE_THAT(puml, IsField("i", "std::vector")); + REQUIRE_THAT(src, IsField("i", "std::vector")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -58,8 +58,21 @@ TEST_CASE("t00046", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsField; + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("AA"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::B"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::C"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::D"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::E"))); + REQUIRE_THAT(src, IsClass(_A("ns1::ns2::R"))); + + REQUIRE_THAT(src, IsField("i", "std::vector")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00047/test_case.h b/tests/t00047/test_case.h index 3398fe1e..69d341b8 100644 --- a/tests/t00047/test_case.h +++ b/tests/t00047/test_case.h @@ -29,21 +29,21 @@ TEST_CASE("t00047", "[test-case][class]") REQUIRE(model->name() == "t00047_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if class templates exist - REQUIRE_THAT(puml, IsClassTemplate("conditional_t", "Ts...")); - REQUIRE_THAT(puml, IsClassTemplate("conditional_t", "Else")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsClassTemplate("conditional_t", "Ts...")); + REQUIRE_THAT(src, IsClassTemplate("conditional_t", "Else")); + REQUIRE_THAT(src, IsClassTemplate("conditional_t", "std::true_type,Result,Tail...")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsClassTemplate("conditional_t", "std::false_type,Result,Tail...")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -58,8 +58,18 @@ TEST_CASE("t00047", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + // Check if class templates exist + REQUIRE_THAT(src, IsClass(_A("conditional_t"))); + REQUIRE_THAT(src, IsClass(_A("conditional_t"))); + REQUIRE_THAT( + src, IsClass(_A("conditional_t"))); + REQUIRE_THAT( + src, IsClass(_A("conditional_t"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00048/test_case.h b/tests/t00048/test_case.h index 7c19e9e5..3bea43d1 100644 --- a/tests/t00048/test_case.h +++ b/tests/t00048/test_case.h @@ -29,27 +29,27 @@ TEST_CASE("t00048", "[test-case][class]") REQUIRE(model->name() == "t00048_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsAbstractClass(_A("Base"))); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); + REQUIRE_THAT(src, IsAbstractClass(_A("Base"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); // Check if class templates exist - REQUIRE_THAT(puml, IsAbstractClassTemplate("BaseTemplate", "T")); - REQUIRE_THAT(puml, IsClassTemplate("ATemplate", "T")); - REQUIRE_THAT(puml, IsClassTemplate("BTemplate", "T")); + REQUIRE_THAT(src, IsAbstractClassTemplate("BaseTemplate", "T")); + REQUIRE_THAT(src, IsClassTemplate("ATemplate", "T")); + REQUIRE_THAT(src, IsClassTemplate("BTemplate", "T")); // Check if all inheritance relationships exist - REQUIRE_THAT(puml, IsBaseClass(_A("Base"), _A("A"))); - REQUIRE_THAT(puml, IsBaseClass(_A("Base"), _A("B"))); + REQUIRE_THAT(src, IsBaseClass(_A("Base"), _A("A"))); + REQUIRE_THAT(src, IsBaseClass(_A("Base"), _A("B"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -66,8 +66,25 @@ TEST_CASE("t00048", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsAbstractClass; + + // Check if all classes exist + REQUIRE_THAT(src, IsAbstractClass(_A("Base"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + + // Check if class templates exist + REQUIRE_THAT(src, IsAbstractClass(_A("BaseTemplate"))); + REQUIRE_THAT(src, IsClass(_A("ATemplate"))); + REQUIRE_THAT(src, IsClass(_A("BTemplate"))); + + // Check if all inheritance relationships exist + REQUIRE_THAT(src, IsBaseClass(_A("Base"), _A("A"))); + REQUIRE_THAT(src, IsBaseClass(_A("Base"), _A("B"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00049/test_case.h b/tests/t00049/test_case.h index 1fb001eb..bf2f6474 100644 --- a/tests/t00049/test_case.h +++ b/tests/t00049/test_case.h @@ -29,35 +29,35 @@ TEST_CASE("t00049", "[test-case][class]") REQUIRE(model->name() == "t00049_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsClass(_A("R"))); + REQUIRE_THAT(src, IsClass(_A("R"))); // Check if class templates exist - REQUIRE_THAT(puml, IsClassTemplate("A", "T")); + REQUIRE_THAT(src, IsClassTemplate("A", "T")); // Check if all methods exist - REQUIRE_THAT(puml, (IsMethod("get_int_map", "A"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, (IsMethod("get_int_map", "A"))); + REQUIRE_THAT(src, (IsMethod("set_int_map", "void", "A && int_map"))); // Check if all fields exist - REQUIRE_THAT(puml, (IsField("a_string", "A"))); + REQUIRE_THAT(src, (IsField("a_string", "A"))); REQUIRE_THAT( - puml, (IsField("a_vector_string", "A"))); - REQUIRE_THAT(puml, (IsField("a_int_map", "A"))); + src, (IsField("a_vector_string", "A"))); + REQUIRE_THAT(src, (IsField("a_int_map", "A"))); // Check if all relationships exist - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -71,8 +71,34 @@ TEST_CASE("t00049", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsField; + using mermaid::IsMethod; + + // Check if all classes exist + REQUIRE_THAT(src, IsClass(_A("R"))); + + // Check if class templates exist + REQUIRE_THAT(src, IsClass(_A("A"))); + + // Check if all methods exist + REQUIRE_THAT(src, (IsMethod("get_int_map", "A"))); + REQUIRE_THAT(src, + (IsMethod("set_int_map", "void", "A && int_map"))); + + // Check if all fields exist + REQUIRE_THAT(src, (IsField("a_string", "A"))); + REQUIRE_THAT( + src, (IsField("a_vector_string", "A"))); + REQUIRE_THAT(src, (IsField("a_int_map", "A"))); + + // Check if all relationships exist + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00050/test_case.h b/tests/t00050/test_case.h index 5e5d5bf6..72c815c8 100644 --- a/tests/t00050/test_case.h +++ b/tests/t00050/test_case.h @@ -29,32 +29,32 @@ TEST_CASE("t00050", "[test-case][class]") REQUIRE(model->name() == "t00050_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("utils::D"))); - REQUIRE_THAT(puml, IsEnum(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("utils::D"))); + REQUIRE_THAT(src, IsEnum(_A("E"))); - REQUIRE_THAT(puml, HasNote(_A("A"), "left")); - REQUIRE_THAT(puml, HasNote(_A("A"), "right")); - REQUIRE_THAT(puml, HasNote(_A("B"), "top")); - REQUIRE_THAT(puml, HasNote(_A("C"), "top")); - REQUIRE_THAT(puml, HasNote(_A("utils::D"), "top")); - REQUIRE_THAT(puml, !HasNote(_A("E"), "bottom")); - REQUIRE_THAT(puml, !HasNote(_A("NoComment"), "top")); - REQUIRE_THAT(puml, HasNote(_A("F"), "top")); - REQUIRE_THAT(puml, HasNote(_A("G"), "top")); - REQUIRE_THAT(puml, HasNote(_A("G"), "bottom")); - REQUIRE_THAT(puml, HasNote(_A("G"), "right")); + REQUIRE_THAT(src, HasNote(_A("A"), "left")); + REQUIRE_THAT(src, HasNote(_A("A"), "right")); + REQUIRE_THAT(src, HasNote(_A("B"), "top")); + REQUIRE_THAT(src, HasNote(_A("C"), "top")); + REQUIRE_THAT(src, HasNote(_A("utils::D"), "top")); + REQUIRE_THAT(src, !HasNote(_A("E"), "bottom")); + REQUIRE_THAT(src, !HasNote(_A("NoComment"), "top")); + REQUIRE_THAT(src, HasNote(_A("F"), "top")); + REQUIRE_THAT(src, HasNote(_A("G"), "top")); + REQUIRE_THAT(src, HasNote(_A("G"), "bottom")); + REQUIRE_THAT(src, HasNote(_A("G"), "right")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -70,8 +70,18 @@ TEST_CASE("t00050", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsEnum; + + // Check if all classes exist + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("utils::D"))); + REQUIRE_THAT(src, IsEnum(_A("E"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00051/test_case.h b/tests/t00051/test_case.h index dece426e..ea66c8e0 100644 --- a/tests/t00051/test_case.h +++ b/tests/t00051/test_case.h @@ -29,51 +29,51 @@ TEST_CASE("t00051", "[test-case][class]") REQUIRE(model->name() == "t00051_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsInnerClass(_A("A"), _A("A::custom_thread1"))); - REQUIRE_THAT(puml, IsInnerClass(_A("A"), _A("A::custom_thread2"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsInnerClass(_A("A"), _A("A::custom_thread1"))); + REQUIRE_THAT(src, IsInnerClass(_A("A"), _A("A::custom_thread2"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, (IsMethod("custom_thread1", "void", "Function && f, Args &&... args"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, (IsMethod("thread", "void", "(lambda at ../../tests/t00051/t00051.cc:59:27) &&"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, (IsMethod("start_thread3", "B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at " "../../tests/t00051/t00051.cc:43:27)>"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, (IsMethod("get_function", "(lambda at ../../tests/t00051/t00051.cc:48:16)"))); - REQUIRE_THAT(puml, IsClassTemplate("B", "F,FF=F")); - REQUIRE_THAT(puml, (IsMethod("f", "void"))); - REQUIRE_THAT(puml, (IsMethod("ff", "void"))); + REQUIRE_THAT(src, IsClassTemplate("B", "F,FF=F")); + REQUIRE_THAT(src, (IsMethod("f", "void"))); + REQUIRE_THAT(src, (IsMethod("ff", "void"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsClassTemplate("B", "(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at " "../../tests/t00051/t00051.cc:43:27)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation(_A("B"), _A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " "at ../../tests/t00051/t00051.cc:43:27)>"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency(_A("A"), _A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " "at ../../tests/t00051/t00051.cc:43:27)>"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -87,8 +87,50 @@ TEST_CASE("t00051", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsInnerClass; + using mermaid::IsMethod; + + // Check if all classes exist + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsInnerClass(_A("A"), _A("A::custom_thread1"))); + REQUIRE_THAT(src, IsInnerClass(_A("A"), _A("A::custom_thread2"))); + + REQUIRE_THAT(src, + (IsMethod("custom_thread1", "void", + "Function && f, Args &&... args"))); + REQUIRE_THAT(src, + (IsMethod("thread", "void", + "(lambda at ../../tests/t00051/t00051.cc:59:27) &&"))); + REQUIRE_THAT(src, + (IsMethod("start_thread3", + "B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at " + "../../tests/t00051/t00051.cc:43:27)>"))); + REQUIRE_THAT(src, + (IsMethod("get_function", + "(lambda at ../../tests/t00051/t00051.cc:48:16)"))); + + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, (IsMethod("f", "void"))); + REQUIRE_THAT(src, (IsMethod("ff", "void"))); + + REQUIRE_THAT(src, + IsClass(_A( + "B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at " + "../../tests/t00051/t00051.cc:43:27)>"))); + + REQUIRE_THAT(src, + IsInstantiation(_A("B"), + _A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " + "at ../../tests/t00051/t00051.cc:43:27)>"))); + + REQUIRE_THAT(src, + IsDependency(_A("A"), + _A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " + "at ../../tests/t00051/t00051.cc:43:27)>"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00052/test_case.h b/tests/t00052/test_case.h index 0971db6a..264bf190 100644 --- a/tests/t00052/test_case.h +++ b/tests/t00052/test_case.h @@ -29,26 +29,25 @@ TEST_CASE("t00052", "[test-case][class]") REQUIRE(model->name() == "t00052_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); // Check if class templates exist - REQUIRE_THAT(puml, IsClassTemplate("B", "T")); + REQUIRE_THAT(src, IsClassTemplate("B", "T")); // Check if all methods exist - REQUIRE_THAT(puml, (IsMethod("a", "T", "T p"))); - REQUIRE_THAT( - puml, (IsMethod("aa", "void", "F && f, Q q"))); - REQUIRE_THAT(puml, (IsMethod("b", "T", "T t"))); - REQUIRE_THAT(puml, (IsMethod("bb", "T", "F && f, T t"))); + REQUIRE_THAT(src, (IsMethod("a", "T", "T p"))); + REQUIRE_THAT(src, (IsMethod("aa", "void", "F && f, Q q"))); + REQUIRE_THAT(src, (IsMethod("b", "T", "T t"))); + REQUIRE_THAT(src, (IsMethod("bb", "T", "F && f, T t"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -61,8 +60,23 @@ TEST_CASE("t00052", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsMethod; + + // Check if all classes exist + REQUIRE_THAT(src, IsClass(_A("A"))); + + // Check if class templates exist + REQUIRE_THAT(src, IsClass(_A("B"))); + + // Check if all methods exist + REQUIRE_THAT(src, (IsMethod("a", "T", "T p"))); + REQUIRE_THAT(src, (IsMethod("aa", "void", "F && f, Q q"))); + REQUIRE_THAT(src, (IsMethod("b", "T", "T t"))); + REQUIRE_THAT(src, (IsMethod("bb", "T", "F && f, T t"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00053/test_case.h b/tests/t00053/test_case.h index fe4923c4..528b23ff 100644 --- a/tests/t00053/test_case.h +++ b/tests/t00053/test_case.h @@ -29,30 +29,30 @@ TEST_CASE("t00053", "[test-case][class]") REQUIRE(model->name() == "t00053_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsClass(_A("a"))); - REQUIRE_THAT(puml, IsClass(_A("b"))); - REQUIRE_THAT(puml, IsClass(_A("c"))); - REQUIRE_THAT(puml, IsClass(_A("d"))); - REQUIRE_THAT(puml, IsClass(_A("e"))); - REQUIRE_THAT(puml, IsClass(_A("f"))); - REQUIRE_THAT(puml, IsClass(_A("g"))); + REQUIRE_THAT(src, IsClass(_A("a"))); + REQUIRE_THAT(src, IsClass(_A("b"))); + REQUIRE_THAT(src, IsClass(_A("c"))); + REQUIRE_THAT(src, IsClass(_A("d"))); + REQUIRE_THAT(src, IsClass(_A("e"))); + REQUIRE_THAT(src, IsClass(_A("f"))); + REQUIRE_THAT(src, IsClass(_A("g"))); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClass(_A("E"))); - REQUIRE_THAT(puml, IsClass(_A("F"))); - REQUIRE_THAT(puml, IsClass(_A("G"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("G"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -79,8 +79,27 @@ TEST_CASE("t00053", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + // Check if all classes exist + REQUIRE_THAT(src, IsClass(_A("a"))); + REQUIRE_THAT(src, IsClass(_A("b"))); + REQUIRE_THAT(src, IsClass(_A("c"))); + REQUIRE_THAT(src, IsClass(_A("d"))); + REQUIRE_THAT(src, IsClass(_A("e"))); + REQUIRE_THAT(src, IsClass(_A("f"))); + REQUIRE_THAT(src, IsClass(_A("g"))); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("G"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00054/test_case.h b/tests/t00054/test_case.h index b844e394..060c4900 100644 --- a/tests/t00054/test_case.h +++ b/tests/t00054/test_case.h @@ -29,34 +29,34 @@ TEST_CASE("t00054", "[test-case][class]") REQUIRE(model->name() == "t00054_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsClass(_A("a"))); - REQUIRE_THAT(puml, IsClass(_A("b"))); - REQUIRE_THAT(puml, IsClass(_A("c"))); - REQUIRE_THAT(puml, IsClass(_A("d"))); - REQUIRE_THAT(puml, IsClass(_A("e"))); - REQUIRE_THAT(puml, IsClass(_A("f"))); - REQUIRE_THAT(puml, IsClass(_A("g"))); + REQUIRE_THAT(src, IsClass(_A("a"))); + REQUIRE_THAT(src, IsClass(_A("b"))); + REQUIRE_THAT(src, IsClass(_A("c"))); + REQUIRE_THAT(src, IsClass(_A("d"))); + REQUIRE_THAT(src, IsClass(_A("e"))); + REQUIRE_THAT(src, IsClass(_A("f"))); + REQUIRE_THAT(src, IsClass(_A("g"))); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClass(_A("E"))); - REQUIRE_THAT(puml, IsClass(_A("F"))); - REQUIRE_THAT(puml, IsClass(_A("G"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("G"))); - REQUIRE_THAT(puml, IsEnum(_A("i"))); - REQUIRE_THAT(puml, IsEnum(_A("h"))); - REQUIRE_THAT(puml, IsEnum(_A("j"))); + REQUIRE_THAT(src, IsEnum(_A("i"))); + REQUIRE_THAT(src, IsEnum(_A("h"))); + REQUIRE_THAT(src, IsEnum(_A("j"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -87,8 +87,32 @@ TEST_CASE("t00054", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsEnum; + + // Check if all classes exist + REQUIRE_THAT(src, IsClass(_A("a"))); + REQUIRE_THAT(src, IsClass(_A("b"))); + REQUIRE_THAT(src, IsClass(_A("detail::c"))); + REQUIRE_THAT(src, IsClass(_A("detail::d"))); + REQUIRE_THAT(src, IsClass(_A("detail::e"))); + REQUIRE_THAT(src, IsClass(_A("f"))); + REQUIRE_THAT(src, IsClass(_A("g"))); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("detail2::C"))); + REQUIRE_THAT(src, IsClass(_A("detail2::detail3::D"))); + REQUIRE_THAT(src, IsClass(_A("detail2::detail3::E"))); + REQUIRE_THAT(src, IsClass(_A("detail2::F"))); + REQUIRE_THAT(src, IsClass(_A("G"))); + + REQUIRE_THAT(src, IsEnum(_A("detail4::i"))); + REQUIRE_THAT(src, IsEnum(_A("detail4::h"))); + REQUIRE_THAT(src, IsEnum(_A("detail4::j"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00055/test_case.h b/tests/t00055/test_case.h index 391555a5..9f238ba7 100644 --- a/tests/t00055/test_case.h +++ b/tests/t00055/test_case.h @@ -29,35 +29,35 @@ TEST_CASE("t00055", "[test-case][class]") REQUIRE(model->name() == "t00055_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, IsClass(_A("E"))); - REQUIRE_THAT(puml, IsClass(_A("F"))); - REQUIRE_THAT(puml, IsClass(_A("G"))); - REQUIRE_THAT(puml, IsClass(_A("H"))); - REQUIRE_THAT(puml, IsClass(_A("I"))); - REQUIRE_THAT(puml, IsClass(_A("J"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("G"))); + REQUIRE_THAT(src, IsClass(_A("H"))); + REQUIRE_THAT(src, IsClass(_A("I"))); + REQUIRE_THAT(src, IsClass(_A("J"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("A"), "right", _A("C"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("C"), "right", _A("E"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("E"), "right", _A("G"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("G"), "right", _A("I"))); + REQUIRE_THAT(src, IsLayoutHint(_A("A"), "right", _A("C"))); + REQUIRE_THAT(src, IsLayoutHint(_A("C"), "right", _A("E"))); + REQUIRE_THAT(src, IsLayoutHint(_A("E"), "right", _A("G"))); + REQUIRE_THAT(src, IsLayoutHint(_A("G"), "right", _A("I"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("B"), "down", _A("D"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("D"), "down", _A("F"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("F"), "down", _A("H"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("H"), "down", _A("J"))); + REQUIRE_THAT(src, IsLayoutHint(_A("B"), "down", _A("D"))); + REQUIRE_THAT(src, IsLayoutHint(_A("D"), "down", _A("F"))); + REQUIRE_THAT(src, IsLayoutHint(_A("F"), "down", _A("H"))); + REQUIRE_THAT(src, IsLayoutHint(_A("H"), "down", _A("J"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -79,8 +79,22 @@ TEST_CASE("t00055", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + // Check if all classes exist + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("G"))); + REQUIRE_THAT(src, IsClass(_A("H"))); + REQUIRE_THAT(src, IsClass(_A("I"))); + REQUIRE_THAT(src, IsClass(_A("J"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00056/test_case.h b/tests/t00056/test_case.h index 2852bd3a..d271740c 100644 --- a/tests/t00056/test_case.h +++ b/tests/t00056/test_case.h @@ -29,94 +29,94 @@ TEST_CASE("t00056", "[test-case][class]") REQUIRE(model->name() == "t00056_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsConcept(_A("greater_than_simple"))); - REQUIRE_THAT(puml, IsConcept(_A("greater_than_with_requires"))); - REQUIRE_THAT(puml, IsConcept(_A("max_four_bytes"))); - REQUIRE_THAT(puml, IsConcept(_A("iterable"))); - REQUIRE_THAT(puml, IsConcept(_A("has_value_type"))); - REQUIRE_THAT(puml, IsConcept(_A("convertible_to_string"))); - REQUIRE_THAT(puml, IsConcept(_A("iterable_with_value_type"))); - REQUIRE_THAT(puml, IsConcept(_A("iterable_or_small_value_type"))); + REQUIRE_THAT(src, IsConcept(_A("greater_than_simple"))); + REQUIRE_THAT(src, IsConcept(_A("greater_than_with_requires"))); + REQUIRE_THAT(src, IsConcept(_A("max_four_bytes"))); + REQUIRE_THAT(src, IsConcept(_A("iterable"))); + REQUIRE_THAT(src, IsConcept(_A("has_value_type"))); + REQUIRE_THAT(src, IsConcept(_A("convertible_to_string"))); + REQUIRE_THAT(src, IsConcept(_A("iterable_with_value_type"))); + REQUIRE_THAT(src, IsConcept(_A("iterable_or_small_value_type"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConceptRequirement(_A("greater_than_with_requires"), "sizeof (l) > sizeof (r)")); REQUIRE_THAT( - puml, IsConceptRequirement(_A("iterable"), "container.begin()")); + src, IsConceptRequirement(_A("iterable"), "container.begin()")); REQUIRE_THAT( - puml, IsConceptRequirement(_A("iterable"), "container.end()")); + src, IsConceptRequirement(_A("iterable"), "container.end()")); #ifdef _MSC_VER REQUIRE_THAT(puml, IsConceptRequirement( _A("convertible_to_string"), "std::string{s}")); #else - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConceptRequirement( _A("convertible_to_string"), "std::string{s}")); #endif - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConceptRequirement(_A("convertible_to_string"), "{std::to_string(s)} noexcept")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConceptRequirement(_A("convertible_to_string"), "{std::to_string(s)} -> std::same_as")); // Check if class templates exist - REQUIRE_THAT(puml, IsClassTemplate("A", "max_four_bytes T")); - REQUIRE_THAT(puml, IsClassTemplate("B", "T")); - REQUIRE_THAT(puml, IsClassTemplate("C", "convertible_to_string T")); + REQUIRE_THAT(src, IsClassTemplate("A", "max_four_bytes T")); + REQUIRE_THAT(src, IsClassTemplate("B", "T")); + REQUIRE_THAT(src, IsClassTemplate("C", "convertible_to_string T")); REQUIRE_THAT( - puml, IsClassTemplate("D", "iterable T1,T2,iterable T3,T4,T5")); - REQUIRE_THAT(puml, IsClassTemplate("E", "T1,T2,T3")); - REQUIRE_THAT(puml, IsClassTemplate("F", "T1,T2,T3")); + src, IsClassTemplate("D", "iterable T1,T2,iterable T3,T4,T5")); + REQUIRE_THAT(src, IsClassTemplate("E", "T1,T2,T3")); + REQUIRE_THAT(src, IsClassTemplate("F", "T1,T2,T3")); // Check if all relationships exist - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConstraint( _A("A"), _A("max_four_bytes"), "T")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConstraint(_A("D"), _A("max_four_bytes"), "T2")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConstraint(_A("D"), _A("max_four_bytes"), "T5")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConstraint(_A("D"), _A("iterable"), "T1")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConstraint(_A("D"), _A("iterable"), "T3")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConstraint(_A("iterable_with_value_type"), _A("has_value_type"), "T")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConstraint(_A("iterable_or_small_value_type"), _A("max_four_bytes"), "T")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConstraint(_A("iterable_or_small_value_type"), _A("iterable_with_value_type"), "T")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConstraint(_A("E"), _A("greater_than_with_requires"), "T1,T3")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConstraint( _A("F"), _A("greater_than_simple"), "T1,T3")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_class_json(diagram, *model); @@ -135,8 +135,93 @@ TEST_CASE("t00056", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsConcept; + using mermaid::IsConceptRequirement; + using mermaid::IsConstraint; + + // Check if all classes exist + REQUIRE_THAT(src, IsConcept(_A("greater_than_simple"))); + REQUIRE_THAT(src, IsConcept(_A("greater_than_with_requires"))); + REQUIRE_THAT(src, IsConcept(_A("max_four_bytes"))); + REQUIRE_THAT(src, IsConcept(_A("iterable"))); + REQUIRE_THAT(src, IsConcept(_A("has_value_type"))); + REQUIRE_THAT(src, IsConcept(_A("convertible_to_string"))); + REQUIRE_THAT(src, IsConcept(_A("iterable_with_value_type"))); + REQUIRE_THAT(src, IsConcept(_A("iterable_or_small_value_type"))); + + REQUIRE_THAT(src, + IsConceptRequirement(_A("greater_than_with_requires"), + "sizeof (l) > sizeof (r)")); + + REQUIRE_THAT( + src, IsConceptRequirement(_A("iterable"), "container.begin()")); + REQUIRE_THAT( + src, IsConceptRequirement(_A("iterable"), "container.end()")); + +#ifdef _MSC_VER + REQUIRE_THAT(puml, + IsConceptRequirement( + _A("convertible_to_string"), "std::string{s}")); +#else + REQUIRE_THAT(src, + IsConceptRequirement( + _A("convertible_to_string"), "std::string{s}")); +#endif + REQUIRE_THAT(src, + IsConceptRequirement(_A("convertible_to_string"), + "{std::to_string(s)} noexcept")); + REQUIRE_THAT(src, + IsConceptRequirement(_A("convertible_to_string"), + "{std::to_string(s)} -> std::same_as")); + + // Check if class templates exist + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, IsClass(_A("E"))); + REQUIRE_THAT(src, IsClass(_A("F"))); + + // Check if all relationships exist + REQUIRE_THAT(src, + IsConstraint( + _A("A"), _A("max_four_bytes"), "T")); + + REQUIRE_THAT(src, + IsConstraint(_A("D"), + _A("max_four_bytes"), "T2")); + REQUIRE_THAT(src, + IsConstraint(_A("D"), + _A("max_four_bytes"), "T5")); + REQUIRE_THAT(src, + IsConstraint(_A("D"), + _A("iterable"), "T1")); + REQUIRE_THAT(src, + IsConstraint(_A("D"), + _A("iterable"), "T3")); + + REQUIRE_THAT(src, + IsConstraint(_A("iterable_with_value_type"), + _A("has_value_type"), "T")); + + REQUIRE_THAT(src, + IsConstraint(_A("iterable_or_small_value_type"), + _A("max_four_bytes"), "T")); + REQUIRE_THAT(src, + IsConstraint(_A("iterable_or_small_value_type"), + _A("iterable_with_value_type"), "T")); + + REQUIRE_THAT(src, + IsConstraint(_A("E"), + _A("greater_than_with_requires"), "T1,T3")); + + REQUIRE_THAT(src, + IsConstraint( + _A("F"), _A("greater_than_simple"), "T1,T3")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00057/test_case.h b/tests/t00057/test_case.h index 7783304f..e033db34 100644 --- a/tests/t00057/test_case.h +++ b/tests/t00057/test_case.h @@ -29,37 +29,37 @@ TEST_CASE("t00057", "[test-case][class]") REQUIRE(model->name() == "t00057_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsClass(_A("t00057_A"))); - REQUIRE_THAT(puml, IsClass(_A("t00057_B"))); - REQUIRE_THAT(puml, IsClass(_A("t00057_C"))); - REQUIRE_THAT(puml, IsUnion(_A("t00057_D"))); - REQUIRE_THAT(puml, IsClass(_A("t00057_E"))); - REQUIRE_THAT(puml, IsClass(_A("t00057_F"))); - REQUIRE_THAT(puml, IsClass(_A("t00057_G"))); - REQUIRE_THAT(puml, !IsClass(_A("(anonymous)"))); - REQUIRE_THAT(puml, IsClass(_A("t00057_R"))); + REQUIRE_THAT(src, IsClass(_A("t00057_A"))); + REQUIRE_THAT(src, IsClass(_A("t00057_B"))); + REQUIRE_THAT(src, IsClass(_A("t00057_C"))); + REQUIRE_THAT(src, IsUnion(_A("t00057_D"))); + REQUIRE_THAT(src, IsClass(_A("t00057_E"))); + REQUIRE_THAT(src, IsClass(_A("t00057_F"))); + REQUIRE_THAT(src, IsClass(_A("t00057_G"))); + REQUIRE_THAT(src, !IsClass(_A("(anonymous)"))); + REQUIRE_THAT(src, IsClass(_A("t00057_R"))); // Check if all relationships exist - REQUIRE_THAT(puml, IsAggregation(_A("t00057_R"), _A("t00057_A"), "+a")); - REQUIRE_THAT(puml, IsAggregation(_A("t00057_R"), _A("t00057_B"), "+b")); - REQUIRE_THAT(puml, IsAssociation(_A("t00057_R"), _A("t00057_C"), "+c")); - REQUIRE_THAT(puml, IsAggregation(_A("t00057_R"), _A("t00057_D"), "+d")); - REQUIRE_THAT(puml, IsAssociation(_A("t00057_R"), _A("t00057_E"), "+e")); - REQUIRE_THAT(puml, IsAssociation(_A("t00057_R"), _A("t00057_F"), "+f")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAggregation(_A("t00057_R"), _A("t00057_A"), "+a")); + REQUIRE_THAT(src, IsAggregation(_A("t00057_R"), _A("t00057_B"), "+b")); + REQUIRE_THAT(src, IsAssociation(_A("t00057_R"), _A("t00057_C"), "+c")); + REQUIRE_THAT(src, IsAggregation(_A("t00057_R"), _A("t00057_D"), "+d")); + REQUIRE_THAT(src, IsAssociation(_A("t00057_R"), _A("t00057_E"), "+e")); + REQUIRE_THAT(src, IsAssociation(_A("t00057_R"), _A("t00057_F"), "+f")); + REQUIRE_THAT(src, IsAggregation( _A("t00057_E"), _A("t00057_E::(coordinates)"), "+coordinates")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAggregation(_A("t00057_E"), _A("t00057_E::(height)"), "+height")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -79,8 +79,35 @@ TEST_CASE("t00057", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsUnion; + + // Check if all classes exist + REQUIRE_THAT(src, IsClass(_A("t00057_A"))); + REQUIRE_THAT(src, IsClass(_A("t00057_B"))); + REQUIRE_THAT(src, IsClass(_A("t00057_C"))); + REQUIRE_THAT(src, IsUnion(_A("t00057_D"))); + REQUIRE_THAT(src, IsClass(_A("t00057_E"))); + REQUIRE_THAT(src, IsClass(_A("t00057_F"))); + REQUIRE_THAT(src, IsClass(_A("t00057_G"))); + REQUIRE_THAT(src, !IsClass(_A("(anonymous)"))); + REQUIRE_THAT(src, IsClass(_A("t00057_R"))); + + // Check if all relationships exist + REQUIRE_THAT(src, IsAggregation(_A("t00057_R"), _A("t00057_A"), "+a")); + REQUIRE_THAT(src, IsAggregation(_A("t00057_R"), _A("t00057_B"), "+b")); + REQUIRE_THAT(src, IsAssociation(_A("t00057_R"), _A("t00057_C"), "+c")); + REQUIRE_THAT(src, IsAggregation(_A("t00057_R"), _A("t00057_D"), "+d")); + REQUIRE_THAT(src, IsAssociation(_A("t00057_R"), _A("t00057_E"), "+e")); + REQUIRE_THAT(src, IsAssociation(_A("t00057_R"), _A("t00057_F"), "+f")); + REQUIRE_THAT(src, + IsAggregation( + _A("t00057_E"), _A("t00057_E::(coordinates)"), "+coordinates")); + REQUIRE_THAT(src, + IsAggregation(_A("t00057_E"), _A("t00057_E::(height)"), "+height")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00058/test_case.h b/tests/t00058/test_case.h index 1ac074ab..aabb26a5 100644 --- a/tests/t00058/test_case.h +++ b/tests/t00058/test_case.h @@ -29,44 +29,44 @@ TEST_CASE("t00058", "[test-case][class]") REQUIRE(model->name() == "t00058_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClassTemplate("A", "int,int,double,std::string")); - REQUIRE_THAT(puml, - IsClassTemplate("B", "int,std::string,int,double,A")); + REQUIRE_THAT(src, IsClassTemplate("A", "int,int,double,std::string")); + REQUIRE_THAT( + src, IsClassTemplate("B", "int,std::string,int,double,A")); - REQUIRE_THAT(puml, IsConcept(_A("same_as_first_type"))); + REQUIRE_THAT(src, IsConcept(_A("same_as_first_type"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConstraint(_A("A"), _A("same_as_first_type"), "T,Args...")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConstraint(_A("B"), _A("same_as_first_type"), "T,Args...")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("A"), "+aa")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("B>"), "+bb")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation( _A("A"), _A("A"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation(_A("B"), _A("B>"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency(_A("same_as_first_type"), _A("first_type"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -81,8 +81,44 @@ TEST_CASE("t00058", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsConcept; + using mermaid::IsConstraint; + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT( + src, IsClass(_A("B>"))); + + REQUIRE_THAT(src, IsConcept(_A("same_as_first_type"))); + + REQUIRE_THAT(src, + IsConstraint(_A("A"), + _A("same_as_first_type"), "T,Args...")); + + REQUIRE_THAT(src, + IsConstraint(_A("B"), + _A("same_as_first_type"), "T,Args...")); + + REQUIRE_THAT(src, + IsAggregation(_A("R"), _A("A"), "+aa")); + REQUIRE_THAT(src, + IsAggregation(_A("R"), + _A("B>"), "+bb")); + + REQUIRE_THAT(src, + IsInstantiation( + _A("A"), _A("A"))); + REQUIRE_THAT(src, + IsInstantiation(_A("B"), + _A("B>"))); + + // TODO + // REQUIRE_THAT(src, + // IsDependency(_A("same_as_first_type"), + // _A("first_type"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00059/test_case.h b/tests/t00059/test_case.h index 54211c31..8449ca80 100644 --- a/tests/t00059/test_case.h +++ b/tests/t00059/test_case.h @@ -29,64 +29,64 @@ TEST_CASE("t00059", "[test-case][class]") REQUIRE(model->name() == "t00059_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsConcept(_A("fruit_c"))); - REQUIRE_THAT(puml, IsConcept(_A("apple_c"))); - REQUIRE_THAT(puml, IsConcept(_A("orange_c"))); + REQUIRE_THAT(src, IsConcept(_A("fruit_c"))); + REQUIRE_THAT(src, IsConcept(_A("apple_c"))); + REQUIRE_THAT(src, IsConcept(_A("orange_c"))); REQUIRE_THAT( - puml, IsConstraint(_A("apple_c"), _A("fruit_c"), "T")); + src, IsConstraint(_A("apple_c"), _A("fruit_c"), "T")); REQUIRE_THAT( - puml, IsConstraint(_A("orange_c"), _A("fruit_c"), "T")); + src, IsConstraint(_A("orange_c"), _A("fruit_c"), "T")); REQUIRE_THAT( - puml, IsConceptRequirement(_A("apple_c"), "t.get_sweetness()")); + src, IsConceptRequirement(_A("apple_c"), "t.get_sweetness()")); REQUIRE_THAT( - puml, IsConceptRequirement(_A("apple_c"), "t.get_bitterness()")); + src, IsConceptRequirement(_A("apple_c"), "t.get_bitterness()")); - REQUIRE_THAT(puml, IsClass(_A("gala_apple"))); - REQUIRE_THAT(puml, IsClass(_A("empire_apple"))); - REQUIRE_THAT(puml, IsClass(_A("valencia_orange"))); - REQUIRE_THAT(puml, IsClass(_A("lima_orange"))); - REQUIRE_THAT(puml, IsClass(_A("R"))); + REQUIRE_THAT(src, IsClass(_A("gala_apple"))); + REQUIRE_THAT(src, IsClass(_A("empire_apple"))); + REQUIRE_THAT(src, IsClass(_A("valencia_orange"))); + REQUIRE_THAT(src, IsClass(_A("lima_orange"))); + REQUIRE_THAT(src, IsClass(_A("R"))); REQUIRE_THAT( - puml, IsClassTemplate("fruit_factory", "apple_c TA,orange_c TO")); + src, IsClassTemplate("fruit_factory", "apple_c TA,orange_c TO")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency(_A("fruit_factory"), _A("gala_apple"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency(_A("fruit_factory"), _A("valencia_orange"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency(_A("fruit_factory"), _A("empire_apple"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsDependency(_A("fruit_factory"), _A("lima_orange"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("fruit_factory"), "+factory_1")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsAggregation(_A("R"), _A("fruit_factory"), "+factory_2")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation(_A("fruit_factory"), _A("fruit_factory"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation(_A("fruit_factory"), _A("fruit_factory"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -101,8 +101,63 @@ TEST_CASE("t00059", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsConcept; + using mermaid::IsConceptRequirement; + using mermaid::IsConstraint; + + REQUIRE_THAT(src, IsConcept(_A("fruit_c"))); + REQUIRE_THAT(src, IsConcept(_A("apple_c"))); + REQUIRE_THAT(src, IsConcept(_A("orange_c"))); + + REQUIRE_THAT( + src, IsConstraint(_A("apple_c"), _A("fruit_c"), "T")); + REQUIRE_THAT( + src, IsConstraint(_A("orange_c"), _A("fruit_c"), "T")); + + REQUIRE_THAT( + src, IsConceptRequirement(_A("apple_c"), "t.get_sweetness()")); + REQUIRE_THAT( + src, IsConceptRequirement(_A("apple_c"), "t.get_bitterness()")); + + REQUIRE_THAT(src, IsClass(_A("gala_apple"))); + REQUIRE_THAT(src, IsClass(_A("empire_apple"))); + REQUIRE_THAT(src, IsClass(_A("valencia_orange"))); + REQUIRE_THAT(src, IsClass(_A("lima_orange"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + + REQUIRE_THAT(src, IsClass(_A("fruit_factory"))); + + REQUIRE_THAT(src, + IsDependency(_A("fruit_factory"), + _A("gala_apple"))); + REQUIRE_THAT(src, + IsDependency(_A("fruit_factory"), + _A("valencia_orange"))); + + REQUIRE_THAT(src, + IsDependency(_A("fruit_factory"), + _A("empire_apple"))); + REQUIRE_THAT(src, + IsDependency(_A("fruit_factory"), + _A("lima_orange"))); + + REQUIRE_THAT(src, + IsAggregation(_A("R"), + _A("fruit_factory"), "+factory_1")); + REQUIRE_THAT(src, + IsAggregation(_A("R"), + _A("fruit_factory"), "+factory_2")); + + REQUIRE_THAT(src, + IsInstantiation(_A("fruit_factory"), + _A("fruit_factory"))); + REQUIRE_THAT(src, + IsInstantiation(_A("fruit_factory"), + _A("fruit_factory"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00060/test_case.h b/tests/t00060/test_case.h index c38b6490..3481b8a8 100644 --- a/tests/t00060/test_case.h +++ b/tests/t00060/test_case.h @@ -29,25 +29,25 @@ TEST_CASE("t00060", "[test-case][class]") REQUIRE(model->name() == "t00060_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("D"))); - REQUIRE_THAT(puml, !IsClass(_A("E"))); - REQUIRE_THAT(puml, !IsClass(_A("F"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, !IsClass(_A("E"))); + REQUIRE_THAT(src, !IsClass(_A("F"))); // Check if class templates exist - REQUIRE_THAT(puml, IsClassTemplate("G", "T")); - REQUIRE_THAT(puml, IsClassTemplate("H", "T,P")); + REQUIRE_THAT(src, IsClassTemplate("G", "T")); + REQUIRE_THAT(src, IsClassTemplate("H", "T,P")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -65,8 +65,22 @@ TEST_CASE("t00060", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + // Check if all classes exist + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("D"))); + REQUIRE_THAT(src, !IsClass(_A("E"))); + REQUIRE_THAT(src, !IsClass(_A("F"))); + + // Check if class templates exist + REQUIRE_THAT(src, IsClass(_A("G"))); + REQUIRE_THAT(src, IsClass(_A("H"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00061/test_case.h b/tests/t00061/test_case.h index 57748bf9..38df0dd5 100644 --- a/tests/t00061/test_case.h +++ b/tests/t00061/test_case.h @@ -29,18 +29,18 @@ TEST_CASE("t00061", "[test-case][class]") REQUIRE(model->name() == "t00061_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, !IsClass(_A("B"))); - REQUIRE_THAT(puml, !IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, !IsClass(_A("B"))); + REQUIRE_THAT(src, !IsClass(_A("C"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -55,8 +55,15 @@ TEST_CASE("t00061", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + + // Check if all classes exist + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, !IsClass(_A("B"))); + REQUIRE_THAT(src, !IsClass(_A("C"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00062/test_case.h b/tests/t00062/test_case.h index 31ab4eff..d441f901 100644 --- a/tests/t00062/test_case.h +++ b/tests/t00062/test_case.h @@ -29,61 +29,61 @@ TEST_CASE("t00062", "[test-case][class]") REQUIRE(model->name() == "t00062_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, !Contains("type-parameter-")); + REQUIRE_THAT(src, !Contains("type-parameter-")); // Check if all classes exist - REQUIRE_THAT(puml, IsClassTemplate("A", "T")); - REQUIRE_THAT(puml, IsClassTemplate("A", "U &")); - REQUIRE_THAT(puml, IsClassTemplate("A", "U &&")); - REQUIRE_THAT(puml, IsClassTemplate("A", "U const&")); - REQUIRE_THAT(puml, IsClassTemplate("A", "M C::*")); - REQUIRE_THAT(puml, IsClassTemplate("A", "M C::* &&")); - REQUIRE_THAT(puml, IsClassTemplate("A", "M (C::*)(Arg)")); - REQUIRE_THAT(puml, IsClassTemplate("A", "int (C::*)(bool)")); - REQUIRE_THAT(puml, IsClassTemplate("A", "M (C::*)(Arg) &&")); - REQUIRE_THAT(puml, IsClassTemplate("A", "M (C::*)(Arg1,Arg2,Arg3)")); - REQUIRE_THAT(puml, IsClassTemplate("A", "float (C::*)(int) &&")); + REQUIRE_THAT(src, IsClassTemplate("A", "T")); + REQUIRE_THAT(src, IsClassTemplate("A", "U &")); + REQUIRE_THAT(src, IsClassTemplate("A", "U &&")); + REQUIRE_THAT(src, IsClassTemplate("A", "U const&")); + REQUIRE_THAT(src, IsClassTemplate("A", "M C::*")); + REQUIRE_THAT(src, IsClassTemplate("A", "M C::* &&")); + REQUIRE_THAT(src, IsClassTemplate("A", "M (C::*)(Arg)")); + REQUIRE_THAT(src, IsClassTemplate("A", "int (C::*)(bool)")); + REQUIRE_THAT(src, IsClassTemplate("A", "M (C::*)(Arg) &&")); + REQUIRE_THAT(src, IsClassTemplate("A", "M (C::*)(Arg1,Arg2,Arg3)")); + REQUIRE_THAT(src, IsClassTemplate("A", "float (C::*)(int) &&")); - REQUIRE_THAT(puml, IsClassTemplate("A", "char[N]")); - REQUIRE_THAT(puml, IsClassTemplate("A", "char[1000]")); + REQUIRE_THAT(src, IsClassTemplate("A", "char[N]")); + REQUIRE_THAT(src, IsClassTemplate("A", "char[1000]")); - REQUIRE_THAT(puml, IsClassTemplate("A", "U(...)")); - REQUIRE_THAT(puml, IsClassTemplate("A", "C")); - REQUIRE_THAT(puml, IsClassTemplate("A", "C")); + REQUIRE_THAT(src, IsClassTemplate("A", "U(...)")); + REQUIRE_THAT(src, IsClassTemplate("A", "C")); + REQUIRE_THAT(src, IsClassTemplate("A", "C")); - REQUIRE_THAT(puml, (IsField("u", "U &"))); - REQUIRE_THAT(puml, (IsField("u", "U **"))); - REQUIRE_THAT(puml, (IsField("u", "U ***"))); - REQUIRE_THAT(puml, (IsField("u", "U &&"))); - REQUIRE_THAT(puml, (IsField("u", "const U &"))); - REQUIRE_THAT(puml, (IsField("c", "C &"))); - REQUIRE_THAT(puml, (IsField("m", "M C::*"))); + REQUIRE_THAT(src, (IsField("u", "U &"))); + REQUIRE_THAT(src, (IsField("u", "U **"))); + REQUIRE_THAT(src, (IsField("u", "U ***"))); + REQUIRE_THAT(src, (IsField("u", "U &&"))); + REQUIRE_THAT(src, (IsField("u", "const U &"))); + REQUIRE_THAT(src, (IsField("c", "C &"))); + REQUIRE_THAT(src, (IsField("m", "M C::*"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); REQUIRE_THAT( - puml, IsInstantiation(_A("A"), _A("A"))); + src, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A>"))); - REQUIRE_THAT(puml, IsInstantiation(_A("A"), _A("A>"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A>"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A>"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -94,8 +94,59 @@ TEST_CASE("t00062", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsField; + + REQUIRE_THAT(src, !Contains("type-parameter-")); + + // Check if all classes exist + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A>"))); + REQUIRE_THAT(src, IsClass(_A("A>"))); + + REQUIRE_THAT(src, (IsField("u", "U &"))); + REQUIRE_THAT(src, (IsField("u", "U **"))); + REQUIRE_THAT(src, (IsField("u", "U ***"))); + REQUIRE_THAT(src, (IsField("u", "U &&"))); + REQUIRE_THAT(src, (IsField("u", "const U &"))); + REQUIRE_THAT(src, (IsField("c", "C &"))); + REQUIRE_THAT(src, (IsField("m", "M C::*"))); + + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, + IsInstantiation(_A("A"), _A("A"))); + + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT( + src, IsInstantiation(_A("A"), _A("A"))); + + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A>"))); + REQUIRE_THAT(src, IsInstantiation(_A("A"), _A("A>"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00063/test_case.h b/tests/t00063/test_case.h index 965874c7..3afc52b1 100644 --- a/tests/t00063/test_case.h +++ b/tests/t00063/test_case.h @@ -29,17 +29,17 @@ TEST_CASE("t00063", "[test-case][class]") REQUIRE(model->name() == "t00063_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, !IsEnum(_A("B"))); - REQUIRE_THAT(puml, !IsEnum(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, !IsEnum(_A("B"))); + REQUIRE_THAT(src, !IsEnum(_A("C"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -54,8 +54,15 @@ TEST_CASE("t00063", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsEnum; + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, !IsEnum(_A("B"))); + REQUIRE_THAT(src, !IsEnum(_A("C"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00064/test_case.h b/tests/t00064/test_case.h index 22d39c17..6cc3dfb8 100644 --- a/tests/t00064/test_case.h +++ b/tests/t00064/test_case.h @@ -29,56 +29,55 @@ TEST_CASE("t00064", "[test-case][class]") REQUIRE(model->name() == "t00064_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, !Contains("type-parameter-")); + REQUIRE_THAT(src, !Contains("type-parameter-")); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("B"))); - REQUIRE_THAT(puml, IsClass(_A("C"))); - REQUIRE_THAT(puml, IsClass(_A("R"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("R"))); - REQUIRE_THAT(puml, IsClassTemplate("type_list", "Ts...")); - REQUIRE_THAT(puml, IsClassTemplate("type_list", "Ret(Arg &&),Ts...")); - REQUIRE_THAT(puml, IsClassTemplate("type_list", "T const,Ts...")); + REQUIRE_THAT(src, IsClassTemplate("type_list", "Ts...")); + REQUIRE_THAT(src, IsClassTemplate("type_list", "Ret(Arg &&),Ts...")); + REQUIRE_THAT(src, IsClassTemplate("type_list", "T const,Ts...")); - REQUIRE_THAT(puml, IsClassTemplate("head", "typename")); - REQUIRE_THAT(puml, IsClassTemplate("head", "type_list")); + REQUIRE_THAT(src, IsClassTemplate("head", "typename")); + REQUIRE_THAT(src, IsClassTemplate("head", "type_list")); REQUIRE_THAT( - puml, IsClassTemplate("type_group_pair", "typename,typename")); - REQUIRE_THAT(puml, + src, IsClassTemplate("type_group_pair", "typename,typename")); + REQUIRE_THAT(src, IsClassTemplate( "type_group_pair", "type_list,type_list")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsClassTemplate( "type_group_pair", "type_list,type_list")); - REQUIRE_THAT(puml, IsClassTemplate("optional_ref", "T")); + REQUIRE_THAT(src, IsClassTemplate("optional_ref", "T")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsClassTemplate("type_group_pair_it", "It,type_list,type_list")); - REQUIRE_THAT( - puml, (IsMethod("get", "ref_t", "unsigned int i"))); + REQUIRE_THAT(src, (IsMethod("get", "ref_t", "unsigned int i"))); #if LLVM_VERSION_MAJOR < 16 - REQUIRE_THAT(puml, + REQUIRE_THAT(src, (IsMethod("getp", "value_type const*", "unsigned int i"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, (IsMethod( "find", "unsigned int", "value_type const& v"))); #else - REQUIRE_THAT(puml, + REQUIRE_THAT(src, (IsMethod("getp", "const value_type *", "unsigned int i"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, (IsMethod( "find", "unsigned int", "const value_type & v"))); #endif - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -89,8 +88,53 @@ TEST_CASE("t00064", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsMethod; + + REQUIRE_THAT(src, !Contains("type-parameter-")); + + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("B"))); + REQUIRE_THAT(src, IsClass(_A("C"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + + REQUIRE_THAT(src, IsClass(_A("type_list"))); + REQUIRE_THAT(src, IsClass(_A("type_list"))); + REQUIRE_THAT(src, IsClass(_A("type_list"))); + + REQUIRE_THAT(src, IsClass(_A("head"))); + REQUIRE_THAT(src, IsClass(_A("head>"))); + REQUIRE_THAT(src, IsClass(_A("type_group_pair"))); + REQUIRE_THAT(src, + IsClass(_A( + "type_group_pair,type_list>"))); + REQUIRE_THAT(src, + IsClass(_A( + "type_group_pair,type_list>"))); + + REQUIRE_THAT(src, IsClass(_A("optional_ref"))); + + REQUIRE_THAT(src, + IsClass(_A("type_group_pair_it,type_list<" + "Second...>>"))); + REQUIRE_THAT(src, (IsMethod("get", "ref_t", "unsigned int i"))); +#if LLVM_VERSION_MAJOR < 16 + REQUIRE_THAT(src, + (IsMethod("getp", "value_type const*", "unsigned int i"))); + REQUIRE_THAT(src, + (IsMethod( + "find", "unsigned int", "value_type const& v"))); +#else + REQUIRE_THAT(src, + (IsMethod("getp", "const value_type *", "unsigned int i"))); + REQUIRE_THAT(src, + (IsMethod( + "find", "unsigned int", "const value_type & v"))); + +#endif + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00065/test_case.h b/tests/t00065/test_case.h index 75dc215a..0a1c0fdf 100644 --- a/tests/t00065/test_case.h +++ b/tests/t00065/test_case.h @@ -29,25 +29,25 @@ TEST_CASE("t00065", "[test-case][class]") REQUIRE(model->name() == "t00065_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all classes exist - REQUIRE_THAT(puml, IsClass(_A("R"))); - REQUIRE_THAT(puml, IsClass(_A("A"))); - REQUIRE_THAT(puml, IsClass(_A("AImpl"))); - REQUIRE_THAT(puml, IsEnum(_A("XYZ"))); - REQUIRE_THAT(puml, IsEnum(_A("ABC"))); + REQUIRE_THAT(src, IsClass(_A("R"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("AImpl"))); + REQUIRE_THAT(src, IsEnum(_A("XYZ"))); + REQUIRE_THAT(src, IsEnum(_A("ABC"))); - REQUIRE_THAT(puml, IsPackage("module1")); - REQUIRE_THAT(puml, IsPackage("module2")); - REQUIRE_THAT(puml, IsPackage("submodule1a")); - REQUIRE_THAT(puml, IsPackage("concepts")); + REQUIRE_THAT(src, IsPackage("module1")); + REQUIRE_THAT(src, IsPackage("module2")); + REQUIRE_THAT(src, IsPackage("submodule1a")); + REQUIRE_THAT(src, IsPackage("concepts")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -58,8 +58,18 @@ TEST_CASE("t00065", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsEnum; + + // Check if all classes exist + REQUIRE_THAT(src, IsClass(_A("R"))); + REQUIRE_THAT(src, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("detail::AImpl"))); + REQUIRE_THAT(src, IsEnum(_A("XYZ"))); + REQUIRE_THAT(src, IsEnum(_A("ABC"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00066/test_case.h b/tests/t00066/test_case.h index 4336d03b..8492271c 100644 --- a/tests/t00066/test_case.h +++ b/tests/t00066/test_case.h @@ -29,47 +29,47 @@ TEST_CASE("t00066", "[test-case][class]") REQUIRE(model->name() == "t00066_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsClass(_A("A"))); + REQUIRE_THAT(src, IsClass(_A("A"))); - REQUIRE_THAT(puml, !IsDependency(_A("A"), _A("A"))); + REQUIRE_THAT(src, !IsDependency(_A("A"), _A("A"))); - REQUIRE_THAT(puml, (IsMethod("A"))); - REQUIRE_THAT(puml, (IsMethod("A", "void", "A &&"))); + REQUIRE_THAT(src, (IsMethod("A"))); + REQUIRE_THAT(src, (IsMethod("A", "void", "A &&"))); REQUIRE_THAT( - puml, (IsMethod("A", "void", "const A &"))); + src, (IsMethod("A", "void", "const A &"))); - REQUIRE_THAT(puml, (IsMethod("~A"))); + REQUIRE_THAT(src, (IsMethod("~A"))); - REQUIRE_THAT(puml, (IsMethod("basic_method"))); - REQUIRE_THAT(puml, (IsMethod("static_method", "int"))); - REQUIRE_THAT(puml, (IsMethod("const_method"))); + REQUIRE_THAT(src, (IsMethod("basic_method"))); + REQUIRE_THAT(src, (IsMethod("static_method", "int"))); + REQUIRE_THAT(src, (IsMethod("const_method"))); REQUIRE_THAT( - puml, (IsMethod("default_int", "int", "int i = 12"))); - REQUIRE_THAT(puml, + src, (IsMethod("default_int", "int", "int i = 12"))); + REQUIRE_THAT(src, (IsMethod("default_string", "std::string", "int i, std::string s = \"abc\""))); - REQUIRE_THAT(puml, (IsMethod("size", "std::size_t"))); + REQUIRE_THAT(src, (IsMethod("size", "std::size_t"))); - REQUIRE_THAT(puml, (IsMethod("protected_method"))); - REQUIRE_THAT(puml, (IsMethod("private_method"))); - REQUIRE_THAT(puml, (IsField("public_member", "int"))); - REQUIRE_THAT(puml, (IsField("protected_member", "int"))); - REQUIRE_THAT(puml, (IsField("private_member", "int"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, (IsMethod("protected_method"))); + REQUIRE_THAT(src, (IsMethod("private_method"))); + REQUIRE_THAT(src, (IsField("public_member", "int"))); + REQUIRE_THAT(src, (IsField("protected_member", "int"))); + REQUIRE_THAT(src, (IsField("private_member", "int"))); + REQUIRE_THAT(src, (IsField("auto_member", "const unsigned long"))); - REQUIRE_THAT(puml, (IsField("a_", "int"))); - REQUIRE_THAT(puml, (IsField("b_", "int"))); - REQUIRE_THAT(puml, (IsField("c_", "int"))); + REQUIRE_THAT(src, (IsField("a_", "int"))); + REQUIRE_THAT(src, (IsField("b_", "int"))); + REQUIRE_THAT(src, (IsField("c_", "int"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -80,8 +80,46 @@ TEST_CASE("t00066", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_class_mermaid(diagram, *model); + auto src = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsField; + using mermaid::IsMethod; + + REQUIRE_THAT(src, IsClass(_A("A"))); + + REQUIRE_THAT(src, !IsDependency(_A("A"), _A("A"))); + + REQUIRE_THAT(src, (IsMethod("A"))); + REQUIRE_THAT(src, (IsMethod("A", "void", "A &&"))); + REQUIRE_THAT( + src, (IsMethod("A", "void", "const A &"))); + + REQUIRE_THAT(src, (IsMethod("~A"))); + + REQUIRE_THAT(src, (IsMethod("basic_method"))); + REQUIRE_THAT(src, (IsMethod("static_method", "int"))); + REQUIRE_THAT(src, (IsMethod("const_method"))); + REQUIRE_THAT( + src, (IsMethod("default_int", "int", "int i = 12"))); + REQUIRE_THAT(src, + (IsMethod("default_string", "std::string", + "int i, std::string s = \"abc\""))); + + REQUIRE_THAT(src, (IsMethod("size", "std::size_t"))); + + REQUIRE_THAT(src, (IsMethod("protected_method"))); + REQUIRE_THAT(src, (IsMethod("private_method"))); + REQUIRE_THAT(src, (IsField("public_member", "int"))); + REQUIRE_THAT(src, (IsField("protected_member", "int"))); + REQUIRE_THAT(src, (IsField("private_member", "int"))); + REQUIRE_THAT(src, + (IsField("auto_member", "const unsigned long"))); + + REQUIRE_THAT(src, (IsField("a_", "int"))); + REQUIRE_THAT(src, (IsField("b_", "int"))); + REQUIRE_THAT(src, (IsField("c_", "int"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t00067/test_case.h b/tests/t00067/test_case.h index 03d3dc0a..45d77b35 100644 --- a/tests/t00067/test_case.h +++ b/tests/t00067/test_case.h @@ -29,22 +29,22 @@ TEST_CASE("t00067", "[test-case][class]") REQUIRE(model->name() == "t00067_class"); { - auto puml = generate_class_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_class_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, !(IsMethod("A"))); - REQUIRE_THAT(puml, !(IsMethod("A", "void", "A &&"))); + REQUIRE_THAT(src, !(IsMethod("A"))); + REQUIRE_THAT(src, !(IsMethod("A", "void", "A &&"))); REQUIRE_THAT( - puml, !(IsMethod("A", "void", "const A &"))); + src, !(IsMethod("A", "void", "const A &"))); - REQUIRE_THAT(puml, !(IsMethod("~A"))); + REQUIRE_THAT(src, !(IsMethod("~A"))); - REQUIRE_THAT(puml, !(IsMethod("~A"))); + REQUIRE_THAT(src, !(IsMethod("~A"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -54,9 +54,22 @@ TEST_CASE("t00067", "[test-case][class]") save_json(config.output_directory(), diagram->name + ".json", j); } - { - auto mmd = generate_class_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + { + auto src = generate_class_mermaid(diagram, *model); + + mermaid::AliasMatcher _A(src); + using mermaid::IsMethod; + + REQUIRE_THAT(src, !(IsMethod("A"))); + REQUIRE_THAT(src, !(IsMethod("A", "void", "A &&"))); + REQUIRE_THAT( + src, !(IsMethod("A", "void", "const A &"))); + + REQUIRE_THAT(src, !(IsMethod("~A"))); + + REQUIRE_THAT(src, !(IsMethod("~A"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/test_cases.h b/tests/test_cases.h index 9dc32df5..0ac7e500 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -302,12 +302,86 @@ struct AliasMatcher { const std::vector puml; }; +namespace mermaid { +struct AliasMatcher { + AliasMatcher(const std::string &mmd_) + : mmd{split(mmd_, "\n")} + { + } + + std::string operator()(std::string name) + { + std::vector patterns; + + const std::string alias_regex("([A-Z]_[0-9]+)"); + + util::replace_all(name, "(", "("); + util::replace_all(name, ")", ")"); + util::replace_all(name, " ", "\\s"); + util::replace_all(name, "*", "\\*"); + util::replace_all(name, "[", "\\["); + util::replace_all(name, "]", "\\]"); + util::replace_all(name, "<", "<"); + util::replace_all(name, ">", ">"); + + patterns.push_back( + std::regex{"class\\s" + alias_regex + "\\[\"" + name + "\"\\]"}); + // patterns.push_back( + // std::regex{"abstract\\s\"" + name + "\"\\sas\\s" + + // alias_regex}); + // patterns.push_back( + // std::regex{"enum\\s\"" + name + "\"\\sas\\s" + + // alias_regex}); + // patterns.push_back( + // std::regex{"package\\s\"" + name + "\"\\sas\\s" + + // alias_regex}); + // patterns.push_back( + // std::regex{"package\\s\\[" + name + "\\]\\sas\\s" + + // alias_regex}); + // patterns.push_back( + // std::regex{"file\\s\"" + name + "\"\\sas\\s" + + // alias_regex}); + // patterns.push_back( + // std::regex{"folder\\s\"" + name + "\"\\sas\\s" + + // alias_regex}); + // patterns.push_back( + // std::regex{"participant\\s\"" + name + "\"\\sas\\s" + + // alias_regex}); + + std::smatch base_match; + + for (const auto &line : mmd) { + for (const auto &pattern : patterns) { + if (std::regex_search(line, base_match, pattern) && + base_match.size() == 2) { + std::ssub_match base_sub_match = base_match[1]; + std::string alias = base_sub_match.str(); + return trim(alias); + } + } + } + + return "__INVALID__ALIAS__"; + } + + const std::vector mmd; +}; +} + ContainsMatcher IsClass(std::string const &str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) { return ContainsMatcher(CasedString("class " + str, caseSensitivity)); } +namespace mermaid { +auto IsClass(std::string const &str, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher(CasedString("class " + str, caseSensitivity)); +} +} + ContainsMatcher IsUnion(std::string const &str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) { @@ -315,6 +389,16 @@ ContainsMatcher IsUnion(std::string const &str, CasedString("class " + str + " <>", caseSensitivity)); } +namespace mermaid { +auto IsUnion(std::string const &alias, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return Catch::Matchers::Matches( + std::string("class ") + alias + " \\{\\n\\s+<>", + caseSensitivity); +} +} + ContainsMatcher IsClassTemplate(std::string const &str, std::string const &tmplt, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) @@ -330,18 +414,48 @@ ContainsMatcher IsConcept(std::string const &str, CasedString("class " + str + " <>", caseSensitivity)); } +namespace mermaid { +auto IsConcept(std::string const &alias, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return Catch::Matchers::Matches( + std::string("class ") + alias + " \\{\\n\\s+<>", + caseSensitivity); +} +} + ContainsMatcher IsEnum(std::string const &str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) { return ContainsMatcher(CasedString("enum " + str, caseSensitivity)); } +namespace mermaid { +auto IsEnum(std::string const &alias, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return Catch::Matchers::Matches( + std::string("class ") + alias + " \\{\\n\\s+<>", + caseSensitivity); +} +} + ContainsMatcher IsAbstractClass(std::string const &str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) { return ContainsMatcher(CasedString("abstract " + str, caseSensitivity)); } +namespace mermaid { +auto IsAbstractClass(std::string const &alias, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return Catch::Matchers::Matches( + std::string("class ") + alias + " \\{\\n\\s+<>", + caseSensitivity); +} +} + ContainsMatcher IsAbstractClassTemplate(std::string const &str, std::string const &tmplt, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) @@ -356,6 +470,14 @@ ContainsMatcher IsBaseClass(std::string const &base, std::string const &sub, return ContainsMatcher(CasedString(base + " <|-- " + sub, caseSensitivity)); } +namespace mermaid { +ContainsMatcher IsBaseClass(std::string const &base, std::string const &sub, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher(CasedString(base + " <|-- " + sub, caseSensitivity)); +} +} + ContainsMatcher IsInnerClass(std::string const &parent, std::string const &inner, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) @@ -364,6 +486,16 @@ ContainsMatcher IsInnerClass(std::string const &parent, CasedString(inner + " --+ " + parent, caseSensitivity)); } +namespace mermaid { +ContainsMatcher IsInnerClass(std::string const &parent, + std::string const &inner, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher( + CasedString(parent + " ()-- " + inner + " : ", caseSensitivity)); +} +} + ContainsMatcher IsAssociation(std::string const &from, std::string const &to, std::string const &label = "", std::string multiplicity_source = "", std::string multiplicity_dest = "", @@ -494,6 +626,43 @@ ContainsMatcher IsConceptRequirement(std::string const &cpt, return ContainsMatcher(CasedString(requirement, caseSensitivity)); } +namespace mermaid { +ContainsMatcher IsConstraint(std::string const &from, std::string const &to, + std::string label = {}, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + util::replace_all(label, "<", "<"); + util::replace_all(label, ">", ">"); + util::replace_all(label, "(", "("); + util::replace_all(label, ")", ")"); + util::replace_all(label, "##", "::"); + util::replace_all(label, "{", "{"); + util::replace_all(label, "}", "}"); + + if (label.empty()) + return ContainsMatcher( + CasedString(fmt::format("{} ..> {}", from, to), caseSensitivity)); + else + return ContainsMatcher(CasedString( + fmt::format("{} ..> {} : {}", from, to, label), caseSensitivity)); +} + +ContainsMatcher IsConceptRequirement(std::string const &cpt, + std::string requirement, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + util::replace_all(requirement, "<", "<"); + util::replace_all(requirement, ">", ">"); + util::replace_all(requirement, "(", "("); + util::replace_all(requirement, ")", ")"); + util::replace_all(requirement, "##", "::"); + util::replace_all(requirement, "{", "{"); + util::replace_all(requirement, "}", "}"); + + return ContainsMatcher(CasedString(requirement, caseSensitivity)); +} +} + ContainsMatcher IsLayoutHint(std::string const &from, std::string const &hint, std::string const &to, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) @@ -534,6 +703,17 @@ ContainsMatcher HasLink(std::string const &alias, std::string const &link, fmt::format("{} [[{}{{{}}}]]", alias, link, tooltip), caseSensitivity)); } +namespace mermaid { +ContainsMatcher HasLink(std::string const &alias, std::string const &link, + std::string const &tooltip, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher(CasedString( + fmt::format("click {} href \"{}\" \"{}\"", alias, link, tooltip), + caseSensitivity)); +} +} + ContainsMatcher HasMemberLink(std::string const &method, std::string const &link, std::string const &tooltip, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) @@ -589,6 +769,61 @@ ContainsMatcher IsMethod(std::string const &name, return ContainsMatcher(CasedString(pattern, caseSensitivity)); } +namespace mermaid { +template +ContainsMatcher IsMethod(std::string const &name, std::string type = "void", + std::string const ¶ms = "", + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + std::string pattern; + + if constexpr (has_type()) + pattern = "+"; + else if constexpr (has_type()) + pattern = "#"; + else + pattern = "-"; + + pattern += name; + + pattern += "(" + params + ")"; + + std::vector method_mods; + if constexpr (has_type()) + method_mods.push_back("default"); + if constexpr (has_type()) + method_mods.push_back("const"); + if constexpr (has_type()) + method_mods.push_back("constexpr"); + if constexpr (has_type()) + method_mods.push_back("consteval"); + + pattern += " : "; + + if (!method_mods.empty()) { + pattern += fmt::format("[{}] ", fmt::join(method_mods, ",")); + } + + util::replace_all(type, "<", "<"); + util::replace_all(type, ">", ">"); + util::replace_all(type, "(", "("); + util::replace_all(type, ")", ")"); + util::replace_all(type, "##", "::"); + util::replace_all(type, "{", "{"); + util::replace_all(type, "}", "}"); + + pattern += type; + + if constexpr (has_type()) + pattern += "*"; + + if constexpr (has_type()) + pattern += "$"; + + return ContainsMatcher(CasedString(pattern, caseSensitivity)); +} +} + template ContainsMatcher IsField(std::string const &name, std::string const &type = "void", @@ -611,6 +846,37 @@ ContainsMatcher IsField(std::string const &name, CasedString(pattern + " : " + type, caseSensitivity)); } +namespace mermaid { +template +ContainsMatcher IsField(std::string const &name, std::string type = "void", + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + std::string pattern; + if constexpr (has_type()) + pattern += "{static} "; + + if constexpr (has_type()) + pattern = "+"; + else if constexpr (has_type()) + pattern = "#"; + else + pattern = "-"; + + pattern += name; + + util::replace_all(type, "<", "<"); + util::replace_all(type, ">", ">"); + util::replace_all(type, "(", "("); + util::replace_all(type, ")", ")"); + util::replace_all(type, "##", "::"); + util::replace_all(type, "{", "{"); + util::replace_all(type, "}", "}"); + + return ContainsMatcher( + CasedString(pattern + " : " + type, caseSensitivity)); +} +} + template ContainsMatcher IsFriend(std::string const &from, std::string const &to, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) From 7c70ab69ad84fd59241575bf023a0a7ab8feaaf3 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 12 Sep 2023 09:03:30 +0200 Subject: [PATCH 14/24] Fixed generation of test cases for diagram notes in mermaid class diagrams --- tests/t00002/.clang-uml | 7 ++++++- tests/t00002/test_case.h | 9 +++++---- tests/t00028/test_case.h | 18 ++++++++++++++---- tests/t00050/.clang-uml | 28 +++++++++++++++++++++++++++- tests/t00050/test_case.h | 13 +++++++++++++ tests/test_cases.h | 10 ++++++++++ 6 files changed, 75 insertions(+), 10 deletions(-) diff --git a/tests/t00002/.clang-uml b/tests/t00002/.clang-uml index 1bb1ed91..772207d9 100644 --- a/tests/t00002/.clang-uml +++ b/tests/t00002/.clang-uml @@ -18,4 +18,9 @@ diagrams: - | note right of {{ alias("D") }} {{ comment("D").text }} - end note \ No newline at end of file + end note + mermaid: + after: + - '{% set e=element("A") %} note for {{ e.alias }} "{{ trim(e.comment.brief.0) }}"' + - '{% set e=element("clanguml::t00002::B") %} note for {{ e.alias }} "{{ trim(e.comment.brief.0) }}"' + - 'note for {{ alias("D") }} "{{ comment("D").text }}"' \ No newline at end of file diff --git a/tests/t00002/test_case.h b/tests/t00002/test_case.h index 796e8ef2..78eb6e66 100644 --- a/tests/t00002/test_case.h +++ b/tests/t00002/test_case.h @@ -110,9 +110,11 @@ TEST_CASE("t00002", "[test-case][class]") auto mmd = generate_class_mermaid(diagram, *model); mermaid::AliasMatcher _A(mmd); + using mermaid::HasNote; + using mermaid::IsAbstractClass; REQUIRE_THAT(mmd, StartsWith("classDiagram")); - REQUIRE_THAT(mmd, mermaid::IsAbstractClass(_A("A"))); + REQUIRE_THAT(mmd, IsAbstractClass(_A("A"))); REQUIRE_THAT(mmd, IsClass(_A("B"))); REQUIRE_THAT(mmd, IsClass(_A("C"))); REQUIRE_THAT(mmd, IsClass(_A("D"))); @@ -126,9 +128,8 @@ TEST_CASE("t00002", "[test-case][class]") REQUIRE_THAT(mmd, (mermaid::IsMethod("foo_a"))); REQUIRE_THAT(mmd, (mermaid::IsMethod("foo_c"))); - // REQUIRE_THAT(mmd, HasNote(_A("A"), "left", "This is class - // A")); REQUIRE_THAT(mmd, HasNote(_A("B"), "top", "This is class - // B")); + REQUIRE_THAT(mmd, HasNote(_A("A"), "left", "This is class A")); + REQUIRE_THAT(mmd, HasNote(_A("B"), "top", "This is class B")); REQUIRE_THAT(mmd, mermaid::HasLink(_A("A"), diff --git a/tests/t00028/test_case.h b/tests/t00028/test_case.h index 2ebe094f..372a1038 100644 --- a/tests/t00028/test_case.h +++ b/tests/t00028/test_case.h @@ -76,6 +76,7 @@ note.)"; auto src = generate_class_mermaid(diagram, *model); mermaid::AliasMatcher _A(src); + using mermaid::HasNote; using mermaid::IsEnum; REQUIRE_THAT(src, IsClass(_A("A"))); @@ -85,10 +86,19 @@ note.)"; REQUIRE_THAT(src, IsClass(_A("E"))); REQUIRE_THAT(src, IsEnum(_A("F"))); REQUIRE_THAT(src, IsClass(_A("R"))); - // REQUIRE_THAT(src, HasNote(_A("A"), "top", "A class note.")); - // REQUIRE_THAT(src, HasNote(_A("B"), "left", "B class note.")); - // REQUIRE_THAT(src, HasNote(_A("C"), "bottom", "C class - // note.")); + REQUIRE_THAT(src, HasNote(_A("A"), "top", "A class note.")); + REQUIRE_THAT(src, HasNote(_A("B"), "left", "B class note.")); + REQUIRE_THAT(src, HasNote(_A("C"), "bottom", "C class note.")); + const auto d_note = R"( +D +class +note.)"; + REQUIRE_THAT(src, HasNote(_A("D"), "left", d_note)); + REQUIRE_THAT( + src, HasNote(_A("E"), "left", "E template class note.")); + REQUIRE_THAT(src, HasNote(_A("F"), "bottom", "F enum note.")); + REQUIRE_THAT(src, !HasNote(_A("G"), "left", "G class note.")); + REQUIRE_THAT(src, HasNote(_A("R"), "right", "R class note.")); save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } diff --git a/tests/t00050/.clang-uml b/tests/t00050/.clang-uml index 2b06a49d..9a80b579 100644 --- a/tests/t00050/.clang-uml +++ b/tests/t00050/.clang-uml @@ -62,7 +62,7 @@ diagrams: {% endfor %} {% endif %} - {# Render template paramete if any #} + {# Render template parameters if any #} {% if existsIn(e, "comment") and existsIn(e.comment, "tparam") %} {% set c=e.comment %} @@ -75,3 +75,29 @@ diagrams: {% endif %} {% endfor %} + mermaid: + after: + - | + note for {{ alias("NoSuchClass") }} "{{ comment("NoSuchClass").formatted }}" + - | + note for {{ alias("A") }} "{{ comment("clanguml::t00050::A").formatted }}" + - | + note for {{ element("clanguml::t00050::A").alias }} {% set e=element("clanguml::t00050::A") %} "{{ e.comment.formatted }}" + note for {{ alias("C") }} "{{ trim(comment("clanguml::t00050::C").text) }}" + {% set cmt=comment("clanguml::t00050::G").paragraph %} + note for {{ alias("G") }} "{{ trim(cmt.0) }}" + note for {{ alias("G") }} "{{ trim(cmt.1) }}" + note for {{ alias("G") }} "{{ trim(cmt.2) }}" + - | + {# Render brief comments and todos, if any were written for an element #} + {% for e in diagram.elements %} + {% if existsIn(e, "comment") and existsIn(e.comment, "brief") %} + note for {{ e.alias }} {% set c=e.comment %} "{{ c.brief.0 }}" + {% endif %} + {% if existsIn(e, "comment") and existsIn(e.comment, "todo") %} + {% set c=e.comment %} + {% for t in c.todo %} + note for {{ e.alias }} "**TODO** {{ t }}" + {% endfor %} + {% endif %} + {% endfor %} diff --git a/tests/t00050/test_case.h b/tests/t00050/test_case.h index 72c815c8..cdb593b8 100644 --- a/tests/t00050/test_case.h +++ b/tests/t00050/test_case.h @@ -73,6 +73,7 @@ TEST_CASE("t00050", "[test-case][class]") auto src = generate_class_mermaid(diagram, *model); mermaid::AliasMatcher _A(src); + using mermaid::HasNote; using mermaid::IsEnum; // Check if all classes exist @@ -82,6 +83,18 @@ TEST_CASE("t00050", "[test-case][class]") REQUIRE_THAT(src, IsClass(_A("utils::D"))); REQUIRE_THAT(src, IsEnum(_A("E"))); + REQUIRE_THAT(src, HasNote(_A("A"), "left")); + REQUIRE_THAT(src, HasNote(_A("A"), "right")); + REQUIRE_THAT(src, HasNote(_A("B"), "top")); + REQUIRE_THAT(src, HasNote(_A("C"), "top")); + REQUIRE_THAT(src, HasNote(_A("utils::D"), "top")); + REQUIRE_THAT(src, !HasNote(_A("E"), "bottom")); + REQUIRE_THAT(src, !HasNote(_A("NoComment"), "top")); + REQUIRE_THAT(src, HasNote(_A("F"), "top")); + REQUIRE_THAT(src, HasNote(_A("G"), "top")); + REQUIRE_THAT(src, HasNote(_A("G"), "bottom")); + REQUIRE_THAT(src, HasNote(_A("G"), "right")); + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/test_cases.h b/tests/test_cases.h index 0ac7e500..9dabbc88 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -686,6 +686,16 @@ ContainsMatcher HasNote(std::string const &cls, std::string const &position, fmt::format("note {} of {}", position, cls), caseSensitivity)); } +namespace mermaid { +ContainsMatcher HasNote(std::string const &cls, + std::string const &position = "", std::string const ¬e = "", + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher( + CasedString(fmt::format("note for {}", cls), caseSensitivity)); +} +} + ContainsMatcher HasMemberNote(std::string const &cls, std::string const &member, std::string const &position, std::string const ¬e = "", CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) From 59180efebf58a3290dc9ccf8e51edd513d206733 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 12 Sep 2023 20:18:11 +0200 Subject: [PATCH 15/24] Fixed friend relationship generation in mermaid class diagram generator --- .../mermaid/class_diagram_generator.cc | 40 +++++++++++++------ tests/t00011/test_case.h | 3 +- tests/t00045/test_case.h | 1 + tests/test_cases.h | 20 ++++++++++ 4 files changed, 50 insertions(+), 14 deletions(-) diff --git a/src/class_diagram/generators/mermaid/class_diagram_generator.cc b/src/class_diagram/generators/mermaid/class_diagram_generator.cc index a142d6e8..f1cf57fd 100644 --- a/src/class_diagram/generators/mermaid/class_diagram_generator.cc +++ b/src/class_diagram/generators/mermaid/class_diagram_generator.cc @@ -370,17 +370,21 @@ void generator::generate_relationship( if (util::starts_with(destination, std::string{"::"})) destination = destination.substr(2, destination.size()); - std::string puml_relation; + std::string mmd_relation; if (!r.multiplicity_source().empty()) - puml_relation += "\"" + r.multiplicity_source() + "\" "; + mmd_relation += "\"" + r.multiplicity_source() + "\" "; - puml_relation += mermaid_common::to_mermaid(r.type(), r.style()); + mmd_relation += mermaid_common::to_mermaid(r.type(), r.style()); if (!r.multiplicity_destination().empty()) - puml_relation += " \"" + r.multiplicity_destination() + "\""; + mmd_relation += " \"" + r.multiplicity_destination() + "\""; if (!r.label().empty()) { - rendered_relations.emplace(r.label()); + if (r.type() == relationship_t::kFriendship) + rendered_relations.emplace(fmt::format( + "{}[friend]", mermaid_common::to_mermaid(r.access()))); + else + rendered_relations.emplace(r.label()); } } @@ -444,7 +448,10 @@ void generator::generate_relationships( relstr << " : "; if (!r.label().empty()) { - relstr << mermaid_common::to_mermaid(r.access()) << r.label(); + auto lbl = r.label(); + if (r.type() == relationship_t::kFriendship) + lbl = "[friend]"; + relstr << mermaid_common::to_mermaid(r.access()) << lbl; rendered_relations.emplace(r.label()); } @@ -516,14 +523,14 @@ void generator::generate_relationships( try { destination = r.destination(); - std::string puml_relation; + std::string mmd_relation; if (!r.multiplicity_source().empty()) - puml_relation += "\"" + r.multiplicity_source() + "\" "; + mmd_relation += "\"" + r.multiplicity_source() + "\" "; - puml_relation += mermaid_common::to_mermaid(r.type(), r.style()); + mmd_relation += mermaid_common::to_mermaid(r.type(), r.style()); if (!r.multiplicity_destination().empty()) - puml_relation += " \"" + r.multiplicity_destination() + "\""; + mmd_relation += " \"" + r.multiplicity_destination() + "\""; std::string target_alias; try { @@ -539,18 +546,21 @@ void generator::generate_relationships( continue; if (r.type() == relationship_t::kContainment) { - relstr << indent(1) << target_alias << " " << puml_relation + relstr << indent(1) << target_alias << " " << mmd_relation << " " << c.alias(); } else { - relstr << indent(1) << c.alias() << " " << puml_relation << " " + relstr << indent(1) << c.alias() << " " << mmd_relation << " " << target_alias; } relstr << " : "; if (!r.label().empty()) { - relstr << mermaid_common::to_mermaid(r.access()) << r.label(); + auto lbl = r.label(); + if (r.type() == relationship_t::kFriendship) + lbl = "[friend]"; + relstr << mermaid_common::to_mermaid(r.access()) << lbl; rendered_relations.emplace(r.label()); } @@ -605,6 +615,10 @@ void generator::generate_relationships(const enum_ &e, std::ostream &ostr) const << " " << target_alias; } + auto lbl = r.label(); + if (r.type() == relationship_t::kFriendship) + lbl = "[friend]"; + relstr << " : " << r.label(); relstr << '\n'; diff --git a/tests/t00011/test_case.h b/tests/t00011/test_case.h index cc3554ff..a59c6155 100644 --- a/tests/t00011/test_case.h +++ b/tests/t00011/test_case.h @@ -59,6 +59,7 @@ TEST_CASE("t00011", "[test-case][class]") auto src = generate_class_mermaid(diagram, *model); mermaid::AliasMatcher _A(src); + using mermaid::IsFriend; REQUIRE_THAT(src, IsClass(_A("A"))); REQUIRE_THAT(src, IsClass(_A("B"))); @@ -67,7 +68,7 @@ TEST_CASE("t00011", "[test-case][class]") REQUIRE_THAT(src, IsAssociation(_A("B"), _A("A"))); REQUIRE_THAT(src, IsFriend(_A("A"), _A("B"))); - // REQUIRE_THAT(puml, IsFriend(_A("A"), _A("D"))); + // REQUIRE_THAT(src, IsFriend(_A("A"), _A("D"))); save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } diff --git a/tests/t00045/test_case.h b/tests/t00045/test_case.h index e91de811..f2f2e2c5 100644 --- a/tests/t00045/test_case.h +++ b/tests/t00045/test_case.h @@ -89,6 +89,7 @@ TEST_CASE("t00045", "[test-case][class]") auto src = generate_class_mermaid(diagram, *model); mermaid::AliasMatcher _A(src); + using mermaid::IsFriend; REQUIRE_THAT(src, IsClass(_A("A"))); REQUIRE_THAT(src, IsClass(_A("ns1::A"))); diff --git a/tests/test_cases.h b/tests/test_cases.h index 9dabbc88..a6517616 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -905,6 +905,26 @@ ContainsMatcher IsFriend(std::string const &from, std::string const &to, caseSensitivity)); } +namespace mermaid { +template +ContainsMatcher IsFriend(std::string const &from, std::string const &to, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + std::string pattern; + + if constexpr (has_type()) + pattern = "+"; + else if constexpr (has_type()) + pattern = "#"; + else + pattern = "-"; + + return ContainsMatcher( + CasedString(fmt::format("{} <.. {} : {}[friend]", from, to, pattern), + caseSensitivity)); +} +} + ContainsMatcher IsPackage(std::string const &str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) { From 57af380dfa6743bc6053522f95c075c874270945 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Tue, 12 Sep 2023 23:04:54 +0200 Subject: [PATCH 16/24] Added mermaid test cases for sequence diagrams --- .../mermaid/sequence_diagram_generator.cc | 2 +- tests/t20001/.clang-uml | 5 + tests/t20001/test_case.h | 37 ++-- tests/t20002/test_case.h | 27 ++- tests/t20003/test_case.h | 27 ++- tests/t20004/test_case.h | 64 ++++-- tests/t20005/test_case.h | 32 ++- tests/t20006/test_case.h | 92 ++++++--- tests/t20007/test_case.h | 33 ++- tests/t20008/test_case.h | 47 +++-- tests/t20009/test_case.h | 42 ++-- tests/t20010/test_case.h | 45 ++-- tests/t20011/test_case.h | 37 ++-- tests/t20012/test_case.h | 86 ++++++-- tests/t20013/test_case.h | 43 ++-- tests/t20014/test_case.h | 39 ++-- tests/t20015/test_case.h | 42 ++-- tests/t20016/test_case.h | 31 ++- tests/t20017/test_case.h | 47 +++-- tests/t20018/test_case.h | 47 +++-- tests/t20019/test_case.h | 30 ++- tests/t20020/test_case.h | 56 +++-- tests/t20021/test_case.h | 57 +++-- tests/t20022/test_case.h | 24 ++- tests/t20023/test_case.h | 33 +-- tests/t20024/test_case.h | 46 +++-- tests/t20025/test_case.h | 31 ++- tests/t20026/test_case.h | 21 +- tests/t20027/test_case.h | 27 ++- tests/t20028/test_case.h | 35 ++-- tests/t20029/test_case.h | 54 +++-- tests/t20030/test_case.h | 53 +++-- tests/t20031/test_case.h | 59 ++++-- tests/t20032/test_case.h | 58 ++++-- tests/t20033/test_case.h | 34 ++- tests/t20034/test_case.h | 42 ++-- tests/t20035/test_case.h | 27 ++- tests/t20036/test_case.h | 45 ++-- tests/test_cases.h | 195 +++++++++++++++--- 39 files changed, 1224 insertions(+), 528 deletions(-) diff --git a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc index 65870510..63f84a5f 100644 --- a/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc @@ -94,7 +94,7 @@ void generator::generate_call(const message &m, std::ostream &ostr) const ostr << indent(1) << from_alias << " " << common::generators::mermaid::to_mermaid(message_t::kCall) << " "; - ostr << indent(1) << to_alias; + ostr << to_alias; ostr << " : "; diff --git a/tests/t20001/.clang-uml b/tests/t20001/.clang-uml index 8ed2b5b8..2124dc35 100644 --- a/tests/t20001/.clang-uml +++ b/tests/t20001/.clang-uml @@ -20,3 +20,8 @@ diagrams: - "' t20001 test diagram of type {{ diagram.type }}" after: - '{% set e=element("clanguml::t20001::tmain()") %} note over {{ e.alias) }}: Main test function' + mermaid: + before: + - "%% t20001 test diagram of type {{ diagram.type }}" + after: + - '{% set e=element("clanguml::t20001::tmain()") %} Note over {{ e.alias) }}: Main test function' diff --git a/tests/t20001/test_case.h b/tests/t20001/test_case.h index f8706b2d..45a315e2 100644 --- a/tests/t20001/test_case.h +++ b/tests/t20001/test_case.h @@ -29,21 +29,21 @@ TEST_CASE("t20001", "[test-case][sequence]") REQUIRE(model->name() == "t20001_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "add3(int,int,int)")); - REQUIRE_THAT(puml, HasCall(_A("A"), "add(int,int)")); - REQUIRE_THAT(puml, !HasCall(_A("A"), _A("detail::C"), "add(int,int)")); - REQUIRE_THAT(puml, HasCall(_A("A"), "__log_result(int)__")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "__log_result(int)__")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "add3(int,int,int)")); + REQUIRE_THAT(src, HasCall(_A("A"), "add(int,int)")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("detail::C"), "add(int,int)")); + REQUIRE_THAT(src, HasCall(_A("A"), "__log_result(int)__")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "__log_result(int)__")); - REQUIRE_THAT(puml, HasComment("t20001 test diagram of type sequence")); + REQUIRE_THAT(src, HasComment("t20001 test diagram of type sequence")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { auto j = generate_sequence_json(diagram, *model); @@ -67,8 +67,19 @@ TEST_CASE("t20001", "[test-case][sequence]") save_json(config.output_directory(), diagram->name + ".json", j); } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + using mermaid::HasComment; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "add3(int,int,int)")); + REQUIRE_THAT(src, HasCall(_A("A"), "add(int,int)")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("detail::C"), "add(int,int)")); + REQUIRE_THAT(src, HasCall(_A("A"), "log_result(int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "log_result(int)")); + + REQUIRE_THAT(src, HasComment("t20001 test diagram of type sequence")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t20002/test_case.h b/tests/t20002/test_case.h index fdfd4081..03986b0c 100644 --- a/tests/t20002/test_case.h +++ b/tests/t20002/test_case.h @@ -29,17 +29,17 @@ TEST_CASE("t20002", "[test-case][sequence]") REQUIRE(model->name() == "t20002_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, HasCall(_A("m1()"), _A("m2()"), "")); - REQUIRE_THAT(puml, HasCall(_A("m2()"), _A("m3()"), "")); - REQUIRE_THAT(puml, HasCall(_A("m3()"), _A("m4()"), "")); + REQUIRE_THAT(src, HasCall(_A("m1()"), _A("m2()"), "")); + REQUIRE_THAT(src, HasCall(_A("m2()"), _A("m3()"), "")); + REQUIRE_THAT(src, HasCall(_A("m3()"), _A("m4()"), "")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -62,8 +62,15 @@ TEST_CASE("t20002", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("m1()"), _A("m2()"), "")); + REQUIRE_THAT(src, HasCall(_A("m2()"), _A("m3()"), "")); + REQUIRE_THAT(src, HasCall(_A("m3()"), _A("m4()"), "")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t20003/test_case.h b/tests/t20003/test_case.h index f27ced2e..7a5dce25 100644 --- a/tests/t20003/test_case.h +++ b/tests/t20003/test_case.h @@ -29,17 +29,17 @@ TEST_CASE("t20003", "[test-case][sequence]") REQUIRE(model->name() == "t20003_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, HasCall(_A("m1(T)"), _A("m2(T)"), "")); - REQUIRE_THAT(puml, HasCall(_A("m2(T)"), _A("m3(T)"), "")); - REQUIRE_THAT(puml, HasCall(_A("m3(T)"), _A("m4(T)"), "")); + REQUIRE_THAT(src, HasCall(_A("m1(T)"), _A("m2(T)"), "")); + REQUIRE_THAT(src, HasCall(_A("m2(T)"), _A("m3(T)"), "")); + REQUIRE_THAT(src, HasCall(_A("m3(T)"), _A("m4(T)"), "")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -57,8 +57,15 @@ TEST_CASE("t20003", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("m1(T)"), _A("m2(T)"), "")); + REQUIRE_THAT(src, HasCall(_A("m2(T)"), _A("m3(T)"), "")); + REQUIRE_THAT(src, HasCall(_A("m3(T)"), _A("m4(T)"), "")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t20004/test_case.h b/tests/t20004/test_case.h index eb6ac747..70747fb6 100644 --- a/tests/t20004/test_case.h +++ b/tests/t20004/test_case.h @@ -29,35 +29,35 @@ TEST_CASE("t20004", "[test-case][sequence]") REQUIRE(model->name() == "t20004_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, HasCall(_A("main()"), _A("m1(float)"), "")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, HasCall(_A("main()"), _A("m1(float)"), "")); REQUIRE_THAT( - puml, !HasCall(_A("m1(float)"), _A("m1(float)"), "")); + src, !HasCall(_A("m1(float)"), _A("m1(float)"), "")); REQUIRE_THAT( - puml, !HasCall(_A("m1(float)"), _A("m1(float)"), "")); + src, !HasCall(_A("m1(float)"), _A("m1(float)"), "")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("main()"), _A("m1(unsigned long)"), "")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("m1(unsigned long)"), _A("m4(unsigned long)"), "")); - REQUIRE_THAT(puml, - HasCall(_A("main()"), _A("m1(std::string)"), "")); - REQUIRE_THAT(puml, + REQUIRE_THAT( + src, HasCall(_A("main()"), _A("m1(std::string)"), "")); + REQUIRE_THAT(src, HasCall(_A("m1(std::string)"), _A("m2(std::string)"), "")); - REQUIRE_THAT(puml, HasCall(_A("main()"), _A("m1(int)"), "")); - REQUIRE_THAT(puml, HasCall(_A("m1(int)"), _A("m2(int)"), "")); - REQUIRE_THAT(puml, HasCall(_A("m2(int)"), _A("m3(int)"), "")); - REQUIRE_THAT(puml, HasCall(_A("m3(int)"), _A("m4(int)"), "")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, HasCall(_A("main()"), _A("m1(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("m1(int)"), _A("m2(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("m2(int)"), _A("m3(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("m3(int)"), _A("m4(int)"), "")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -84,8 +84,34 @@ TEST_CASE("t20004", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("main()"), _A("m1(float)"), "")); + REQUIRE_THAT( + src, !HasCall(_A("m1(float)"), _A("m1(float)"), "")); + REQUIRE_THAT( + src, !HasCall(_A("m1(float)"), _A("m1(float)"), "")); + + REQUIRE_THAT(src, + HasCall(_A("main()"), _A("m1(unsigned long)"), "")); + REQUIRE_THAT(src, + HasCall(_A("m1(unsigned long)"), + _A("m4(unsigned long)"), "")); + + REQUIRE_THAT( + src, HasCall(_A("main()"), _A("m1(std::string)"), "")); + REQUIRE_THAT(src, + HasCall(_A("m1(std::string)"), + _A("m2(std::string)"), "")); + + REQUIRE_THAT(src, HasCall(_A("main()"), _A("m1(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("m1(int)"), _A("m2(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("m2(int)"), _A("m3(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("m3(int)"), _A("m4(int)"), "")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20005/test_case.h b/tests/t20005/test_case.h index 49f0babe..ac336b83 100644 --- a/tests/t20005/test_case.h +++ b/tests/t20005/test_case.h @@ -29,19 +29,19 @@ TEST_CASE("t20005", "[test-case][sequence]") REQUIRE(model->name() == "t20005_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasEntrypoint(_A("C"), "c(T)")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("B"), "b(T)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a(T)")); - REQUIRE_THAT(puml, HasExitpoint(_A("C"))); + REQUIRE_THAT(src, HasEntrypoint(_A("C"), "c(T)")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("B"), "b(T)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a(T)")); + REQUIRE_THAT(src, HasExitpoint(_A("C"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -58,8 +58,18 @@ TEST_CASE("t20005", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + using mermaid::HasEntrypoint; + using mermaid::HasExitpoint; + + REQUIRE_THAT(src, HasEntrypoint(_A("C"), "c(T)")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("B"), "b(T)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a(T)")); + REQUIRE_THAT(src, HasExitpoint(_A("C"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20006/test_case.h b/tests/t20006/test_case.h index d2913f07..65c2bed2 100644 --- a/tests/t20006/test_case.h +++ b/tests/t20006/test_case.h @@ -29,53 +29,53 @@ TEST_CASE("t20006", "[test-case][sequence]") REQUIRE(model->name() == "t20006_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b(int)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a1(int)")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b(int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1(int)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b(std::string)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall( _A("B"), _A("A"), "a2(std::string)")); REQUIRE_THAT( - puml, HasCall(_A("tmain()"), _A("BB"), "bb1(int,int)")); + src, HasCall(_A("tmain()"), _A("BB"), "bb1(int,int)")); REQUIRE_THAT( - puml, HasCall(_A("BB"), _A("AA"), "aa1(int)")); + src, HasCall(_A("BB"), _A("AA"), "aa1(int)")); REQUIRE_THAT( - puml, HasCall(_A("tmain()"), _A("BB"), "bb2(int,int)")); + src, HasCall(_A("tmain()"), _A("BB"), "bb2(int,int)")); REQUIRE_THAT( - puml, HasCall(_A("BB"), _A("AA"), "aa2(int)")); + src, HasCall(_A("BB"), _A("AA"), "aa2(int)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("BB"), "bb1(int,std::string)")); - REQUIRE_THAT(puml, - HasCall(_A("BB"), _A("AA"), "aa2(int)")); + REQUIRE_THAT( + src, HasCall(_A("BB"), _A("AA"), "aa2(int)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("BB"), "bb2(int,std::string)")); - REQUIRE_THAT(puml, - HasCall(_A("BB"), _A("AA"), "aa1(int)")); + REQUIRE_THAT( + src, HasCall(_A("BB"), _A("AA"), "aa1(int)")); - REQUIRE_THAT(puml, - HasCall(_A("tmain()"), _A("BB"), "bb1(int,float)")); - REQUIRE_THAT(puml, + REQUIRE_THAT( + src, HasCall(_A("tmain()"), _A("BB"), "bb1(int,float)")); + REQUIRE_THAT(src, HasCall( _A("BB"), _A("BB"), "bb2(int,float)")); REQUIRE_THAT( - puml, HasCall(_A("BB"), _A("AA"), "aa2(int)")); + src, HasCall(_A("BB"), _A("AA"), "aa2(int)")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -98,8 +98,50 @@ TEST_CASE("t20006", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b(int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1(int)")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("B"), "b(std::string)")); + REQUIRE_THAT(src, + HasCall( + _A("B"), _A("A"), "a2(std::string)")); + + REQUIRE_THAT( + src, HasCall(_A("tmain()"), _A("BB"), "bb1(int,int)")); + REQUIRE_THAT( + src, HasCall(_A("BB"), _A("AA"), "aa1(int)")); + + REQUIRE_THAT( + src, HasCall(_A("tmain()"), _A("BB"), "bb2(int,int)")); + REQUIRE_THAT( + src, HasCall(_A("BB"), _A("AA"), "aa2(int)")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("BB"), + "bb1(int,std::string)")); + REQUIRE_THAT( + src, HasCall(_A("BB"), _A("AA"), "aa2(int)")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("BB"), + "bb2(int,std::string)")); + REQUIRE_THAT( + src, HasCall(_A("BB"), _A("AA"), "aa1(int)")); + + REQUIRE_THAT( + src, HasCall(_A("tmain()"), _A("BB"), "bb1(int,float)")); + REQUIRE_THAT(src, + HasCall( + _A("BB"), _A("BB"), "bb2(int,float)")); + REQUIRE_THAT( + src, HasCall(_A("BB"), _A("AA"), "aa2(int)")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20007/test_case.h b/tests/t20007/test_case.h index c16b95d6..d6ee8025 100644 --- a/tests/t20007/test_case.h +++ b/tests/t20007/test_case.h @@ -29,24 +29,24 @@ TEST_CASE("t20007", "[test-case][sequence]") REQUIRE(model->name() == "t20007_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("Adder"), "add(int &&,int &&)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("Adder"), "add(int &&,float &&,double &&)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("Adder"), "add(std::string &&,std::string &&,std::string &&)")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -68,8 +68,21 @@ TEST_CASE("t20007", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("Adder"), "add(int &&,int &&)")); + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("Adder"), + "add(int &&,float &&,double &&)")); + REQUIRE_THAT(src, + HasCall(_A("tmain()"), + _A("Adder"), + "add(std::string &&,std::string &&,std::string &&)")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20008/test_case.h b/tests/t20008/test_case.h index 47f8a529..c6bc3497 100644 --- a/tests/t20008/test_case.h +++ b/tests/t20008/test_case.h @@ -29,32 +29,32 @@ TEST_CASE("t20008", "[test-case][sequence]") REQUIRE(model->name() == "t20008_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b(int)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a1(int)")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b(int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1(int)")); // REQUIRE_THAT(puml, !HasCall(_A("B"), _A("A"), // "a2(int)")); REQUIRE_THAT(puml, !HasCall(_A("B"), // _A("A"), "a3(int)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b(const char *)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2(const char *)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b(std::string)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall( _A("B"), _A("A"), "a3(std::string)")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -78,8 +78,29 @@ TEST_CASE("t20008", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b(int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1(int)")); + // REQUIRE_THAT(puml, !HasCall(_A("B"), _A("A"), + // "a2(int)")); REQUIRE_THAT(puml, !HasCall(_A("B"), + // _A("A"), "a3(int)")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("B"), "b(const char *)")); + REQUIRE_THAT(src, + HasCall(_A("B"), _A("A"), + "a2(const char *)")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("B"), "b(std::string)")); + REQUIRE_THAT(src, + HasCall( + _A("B"), _A("A"), "a3(std::string)")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20009/test_case.h b/tests/t20009/test_case.h index b11a4597..905d034f 100644 --- a/tests/t20009/test_case.h +++ b/tests/t20009/test_case.h @@ -29,25 +29,26 @@ TEST_CASE("t20009", "[test-case][sequence]") REQUIRE(model->name() == "t20009_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b(std::string)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall( _A("B"), _A("A"), "a(std::string)")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b(int)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a(int)")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b(int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a(int)")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b(float)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a(float)")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b(float)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a(float)")); + + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -70,8 +71,23 @@ TEST_CASE("t20009", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("B"), "b(std::string)")); + REQUIRE_THAT(src, + HasCall( + _A("B"), _A("A"), "a(std::string)")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b(int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a(int)")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b(float)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a(float)")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20010/test_case.h b/tests/t20010/test_case.h index 600784b0..99f842d4 100644 --- a/tests/t20010/test_case.h +++ b/tests/t20010/test_case.h @@ -29,26 +29,26 @@ TEST_CASE("t20010", "[test-case][sequence]") REQUIRE(model->name() == "t20010_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b1()")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a1()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b1()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b2()")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b2()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b3()")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a3()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b3()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a3()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b4()")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a4()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b4()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a4()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -72,8 +72,23 @@ TEST_CASE("t20010", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b1()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1()")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b2()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2()")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b3()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a3()")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b4()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a4()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20011/test_case.h b/tests/t20011/test_case.h index 26cea6ef..bda7d30b 100644 --- a/tests/t20011/test_case.h +++ b/tests/t20011/test_case.h @@ -28,22 +28,22 @@ TEST_CASE("t20011", "[test-case][sequence]") REQUIRE(model->name() == "t20011_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a(int)")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a(int)")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a(int)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a(int)")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "b(int)")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "c(int)")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "d(int)")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "b(int)")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "b(int)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "c(int)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "d(int)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "b(int)")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -65,8 +65,19 @@ TEST_CASE("t20011", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a(int)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a(int)")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "b(int)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "c(int)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "d(int)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "b(int)")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20012/test_case.h b/tests/t20012/test_case.h index 2b9f099f..1ffbf6df 100644 --- a/tests/t20012/test_case.h +++ b/tests/t20012/test_case.h @@ -28,56 +28,56 @@ TEST_CASE("t20012", "[test-case][sequence]") REQUIRE(model->name() == "t20012_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), "operator()()")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), _A("A"), "a()")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "aa()")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "aaa()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aa()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aaa()")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), _A("B"), "b()")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("B"), "bb()")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("B"), "bbb()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bb()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bbb()")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)"), _A("C"), "c()")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("C"), "cc()")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("C"), "ccc()")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "cc()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); + REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)"), _A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), "operator()()")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("C"), "ccc()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("R"), "r()")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("R"), _A("tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)"), "operator()()")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)"), _A("C"), "c()")); // @todo #168 // REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("D"), "add5(int)")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -123,8 +123,50 @@ TEST_CASE("t20012", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), + _A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), + "operator()()")); + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), + _A("A"), "a()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aa()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aaa()")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), + _A("B"), "b()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bb()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bbb()")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)"), + _A("C"), "c()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "cc()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)"), + _A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), + "operator()()")); + + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), + _A("R"), "r()")); + REQUIRE_THAT(src, + HasCall(_A("R"), + _A("tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)"), + "operator()()")); + REQUIRE_THAT(src, + HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)"), + _A("C"), "c()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t20013/test_case.h b/tests/t20013/test_case.h index b885fe88..3f3144d2 100644 --- a/tests/t20013/test_case.h +++ b/tests/t20013/test_case.h @@ -28,26 +28,25 @@ TEST_CASE("t20013", "[test-case][sequence]") REQUIRE(model->name() == "t20013_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT( - puml, HasCall(_A("tmain(int,char **)"), _A("B"), "b(int)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a1(int)")); + REQUIRE_THAT(src, HasCall(_A("tmain(int,char **)"), _A("B"), "b(int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1(int)")); REQUIRE_THAT( - puml, HasCall(_A("tmain(int,char **)"), _A("B"), "b(double)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a2(double)")); + src, HasCall(_A("tmain(int,char **)"), _A("B"), "b(double)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2(double)")); - REQUIRE_THAT(puml, - HasCall(_A("tmain(int,char **)"), _A("B"), "b(const char *)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a3(const char *)")); + REQUIRE_THAT( + src, HasCall(_A("tmain(int,char **)"), _A("B"), "b(const char *)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a3(const char *)")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -69,8 +68,22 @@ TEST_CASE("t20013", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain(int,char **)"), _A("B"), "b(int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1(int)")); + + REQUIRE_THAT( + src, HasCall(_A("tmain(int,char **)"), _A("B"), "b(double)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2(double)")); + + REQUIRE_THAT( + src, HasCall(_A("tmain(int,char **)"), _A("B"), "b(const char *)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a3(const char *)")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20014/test_case.h b/tests/t20014/test_case.h index e5910ec7..6f99d24e 100644 --- a/tests/t20014/test_case.h +++ b/tests/t20014/test_case.h @@ -28,24 +28,24 @@ TEST_CASE("t20014", "[test-case][sequence]") REQUIRE(model->name() == "t20014_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b1(int,int)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a1(int,int)")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b1(int,int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1(int,int)")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b2(int,int)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a2(int,int)")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b2(int,int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2(int,int)")); REQUIRE_THAT( - puml, HasCall(_A("tmain()"), _A("C"), "c1(int,int)")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("B"), "b1(int,int)")); + src, HasCall(_A("tmain()"), _A("C"), "c1(int,int)")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("B"), "b1(int,int)")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -68,8 +68,21 @@ TEST_CASE("t20014", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b1(int,int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1(int,int)")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b2(int,int)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2(int,int)")); + + REQUIRE_THAT( + src, HasCall(_A("tmain()"), _A("C"), "c1(int,int)")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("B"), "b1(int,int)")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20015/test_case.h b/tests/t20015/test_case.h index c56f2499..c2c50ddc 100644 --- a/tests/t20015/test_case.h +++ b/tests/t20015/test_case.h @@ -28,25 +28,25 @@ TEST_CASE("t20015", "[test-case][sequence]") REQUIRE(model->name() == "t20015_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "setup_a(std::shared_ptr &)")); - REQUIRE_THAT(puml, !HasCall(_A("B"), _A("detail::A"), "set_x(int)")); - REQUIRE_THAT(puml, !HasCall(_A("B"), _A("detail::A"), "set_y(int)")); - REQUIRE_THAT(puml, !HasCall(_A("B"), _A("detail::A"), "set_z(int)")); + REQUIRE_THAT(src, !HasCall(_A("B"), _A("detail::A"), "set_x(int)")); + REQUIRE_THAT(src, !HasCall(_A("B"), _A("detail::A"), "set_y(int)")); + REQUIRE_THAT(src, !HasCall(_A("B"), _A("detail::A"), "set_z(int)")); - REQUIRE_THAT(puml, !HasCall(_A("B"), _A("B"), "set_x(int)")); - REQUIRE_THAT(puml, !HasCall(_A("B"), _A("B"), "set_y(int)")); - REQUIRE_THAT(puml, !HasCall(_A("B"), _A("B"), "set_z(int)")); + REQUIRE_THAT(src, !HasCall(_A("B"), _A("B"), "set_x(int)")); + REQUIRE_THAT(src, !HasCall(_A("B"), _A("B"), "set_y(int)")); + REQUIRE_THAT(src, !HasCall(_A("B"), _A("B"), "set_z(int)")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -63,8 +63,22 @@ TEST_CASE("t20015", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("B"), + "setup_a(std::shared_ptr &)")); + REQUIRE_THAT(src, !HasCall(_A("B"), _A("detail::A"), "set_x(int)")); + REQUIRE_THAT(src, !HasCall(_A("B"), _A("detail::A"), "set_y(int)")); + REQUIRE_THAT(src, !HasCall(_A("B"), _A("detail::A"), "set_z(int)")); + + REQUIRE_THAT(src, !HasCall(_A("B"), _A("B"), "set_x(int)")); + REQUIRE_THAT(src, !HasCall(_A("B"), _A("B"), "set_y(int)")); + REQUIRE_THAT(src, !HasCall(_A("B"), _A("B"), "set_z(int)")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20016/test_case.h b/tests/t20016/test_case.h index 92ef295f..5110b8fe 100644 --- a/tests/t20016/test_case.h +++ b/tests/t20016/test_case.h @@ -28,20 +28,20 @@ TEST_CASE("t20016", "[test-case][sequence]") REQUIRE(model->name() == "t20016_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b1(long)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a1(int)")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b1(long)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1(int)")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b2(long)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a2(const long &)")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b2(long)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2(const long &)")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -61,8 +61,17 @@ TEST_CASE("t20016", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b1(long)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1(int)")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b2(long)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2(const long &)")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20017/test_case.h b/tests/t20017/test_case.h index e617b4a8..aa72a696 100644 --- a/tests/t20017/test_case.h +++ b/tests/t20017/test_case.h @@ -28,28 +28,28 @@ TEST_CASE("t20017", "[test-case][sequence]") REQUIRE(model->name() == "t20017_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasEntrypoint(_A("t20017.cc"), "tmain()")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasEntrypoint(_A("t20017.cc"), "tmain()")); + REQUIRE_THAT(src, HasCall(_A("t20017.cc"), _A("include/t20017_a.h"), "a1(int,int)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("t20017.cc"), _A("include/t20017_a.h"), "a2(int,int)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("t20017.cc"), _A("include/t20017_a.h"), "a3(int,int)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("t20017.cc"), _A("include/t20017_b.h"), "b1(int,int)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall( _A("t20017.cc"), _A("include/t20017_b.h"), "b2(int,int)")); - REQUIRE_THAT(puml, HasExitpoint(_A("t20017.cc"))); + REQUIRE_THAT(src, HasExitpoint(_A("t20017.cc"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -75,8 +75,27 @@ TEST_CASE("t20017", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + using mermaid::HasEntrypoint; + using mermaid::HasExitpoint; + + REQUIRE_THAT(src, HasEntrypoint(_A("t20017.cc"), "tmain()")); + REQUIRE_THAT(src, + HasCall(_A("t20017.cc"), _A("include/t20017_a.h"), "a1(int,int)")); + REQUIRE_THAT(src, + HasCall(_A("t20017.cc"), _A("include/t20017_a.h"), "a2(int,int)")); + REQUIRE_THAT(src, + HasCall(_A("t20017.cc"), _A("include/t20017_a.h"), "a3(int,int)")); + REQUIRE_THAT(src, + HasCall(_A("t20017.cc"), _A("include/t20017_b.h"), "b1(int,int)")); + REQUIRE_THAT(src, + HasCall( + _A("t20017.cc"), _A("include/t20017_b.h"), "b2(int,int)")); + REQUIRE_THAT(src, HasExitpoint(_A("t20017.cc"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20018/test_case.h b/tests/t20018/test_case.h index cb3d8d69..5a2448f1 100644 --- a/tests/t20018/test_case.h +++ b/tests/t20018/test_case.h @@ -29,31 +29,31 @@ TEST_CASE("t20018", "[test-case][sequence]") REQUIRE(model->name() == "t20018_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall( _A("tmain()"), _A("Answer,120>"), "__print()__")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("Answer,120>"), _A("Factorial<5>"), "__print(int)__")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("Factorial<5>"), _A("Factorial<4>"), "__print(int)__")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("Factorial<4>"), _A("Factorial<3>"), "__print(int)__")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("Factorial<3>"), _A("Factorial<2>"), "__print(int)__")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("Factorial<2>"), _A("Factorial<1>"), "__print(int)__")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("Factorial<1>"), _A("Factorial<0>"), "__print(int)__")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -78,8 +78,27 @@ TEST_CASE("t20018", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, + HasCall(_A("tmain()"), _A("Answer,120>"), "print()")); + REQUIRE_THAT(src, + HasCall(_A("Answer,120>"), _A("Factorial<5>"), + "print(int)")); + REQUIRE_THAT( + src, HasCall(_A("Factorial<5>"), _A("Factorial<4>"), "print(int)")); + REQUIRE_THAT( + src, HasCall(_A("Factorial<4>"), _A("Factorial<3>"), "print(int)")); + REQUIRE_THAT( + src, HasCall(_A("Factorial<3>"), _A("Factorial<2>"), "print(int)")); + REQUIRE_THAT( + src, HasCall(_A("Factorial<2>"), _A("Factorial<1>"), "print(int)")); + REQUIRE_THAT( + src, HasCall(_A("Factorial<1>"), _A("Factorial<0>"), "print(int)")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20019/test_case.h b/tests/t20019/test_case.h index 68de2fbd..e7622860 100644 --- a/tests/t20019/test_case.h +++ b/tests/t20019/test_case.h @@ -29,19 +29,19 @@ TEST_CASE("t20019", "[test-case][sequence]") REQUIRE(model->name() == "t20019_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("Base"), "name()")); - REQUIRE_THAT(puml, HasCall(_A("Base"), _A("D1"), "impl()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("Base"), "name()")); - REQUIRE_THAT(puml, HasCall(_A("Base"), _A("D2"), "impl()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("Base"), "name()")); + REQUIRE_THAT(src, HasCall(_A("Base"), _A("D1"), "impl()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("Base"), "name()")); + REQUIRE_THAT(src, HasCall(_A("Base"), _A("D2"), "impl()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -61,8 +61,16 @@ TEST_CASE("t20019", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("Base"), "name()")); + REQUIRE_THAT(src, HasCall(_A("Base"), _A("D1"), "impl()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("Base"), "name()")); + REQUIRE_THAT(src, HasCall(_A("Base"), _A("D2"), "impl()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20020/test_case.h b/tests/t20020/test_case.h index 63538cbf..b68a840d 100644 --- a/tests/t20020/test_case.h +++ b/tests/t20020/test_case.h @@ -28,32 +28,32 @@ TEST_CASE("t20020", "[test-case][sequence]") REQUIRE(model->name() == "t20020_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a1()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a1()")); REQUIRE_THAT( - puml, HasCallInControlCondition(_A("tmain()"), _A("A"), "a2()")); + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a2()")); REQUIRE_THAT( - puml, HasCallInControlCondition(_A("tmain()"), _A("A"), "a3()")); + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a3()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b1()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b2()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "log()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b1()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b2()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "log()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("C"), "c1() const")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("C"), "c1() const")); REQUIRE_THAT( - puml, HasCallInControlCondition(_A("C"), _A("C"), "c2() const")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("C"), "log() const")); + src, HasCallInControlCondition(_A("C"), _A("C"), "c2() const")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "log() const")); REQUIRE_THAT( - puml, HasCallInControlCondition(_A("tmain()"), _A("C"), "c3(int)")); + src, HasCallInControlCondition(_A("tmain()"), _A("C"), "c3(int)")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -81,8 +81,30 @@ TEST_CASE("t20020", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + using mermaid::HasCallInControlCondition; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a1()")); + REQUIRE_THAT( + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a2()")); + REQUIRE_THAT( + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a3()")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b1()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b2()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "log()")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("C"), "c1() const")); + REQUIRE_THAT( + src, HasCallInControlCondition(_A("C"), _A("C"), "c2() const")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "log() const")); + + REQUIRE_THAT( + src, HasCallInControlCondition(_A("tmain()"), _A("C"), "c3(int)")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20021/test_case.h b/tests/t20021/test_case.h index c4016afb..2eed83c1 100644 --- a/tests/t20021/test_case.h +++ b/tests/t20021/test_case.h @@ -28,37 +28,37 @@ TEST_CASE("t20021", "[test-case][sequence]") REQUIRE(model->name() == "t20021_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a1()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a1()")); REQUIRE_THAT( - puml, HasCallInControlCondition(_A("tmain()"), _A("A"), "a2()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a3()")); + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a3()")); - REQUIRE_THAT(puml, !HasCall(_A("tmain()"), _A("B"), "b1()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "b2()")); + REQUIRE_THAT(src, !HasCall(_A("tmain()"), _A("B"), "b1()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b2()")); REQUIRE_THAT( - puml, HasCallInControlCondition(_A("tmain()"), _A("C"), "c1()")); + src, HasCallInControlCondition(_A("tmain()"), _A("C"), "c1()")); REQUIRE_THAT( - puml, HasCallInControlCondition(_A("tmain()"), _A("C"), "c2()")); + src, HasCallInControlCondition(_A("tmain()"), _A("C"), "c2()")); // TODO: Why is this not working? // REQUIRE_THAT( // puml, HasCallInControlCondition(_A("tmain()"), _A("C"), // "c3()")); REQUIRE_THAT( - puml, HasCallInControlCondition(_A("tmain()"), _A("C"), "c4()")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("C"), "c5()")); - REQUIRE_THAT(puml, + src, HasCallInControlCondition(_A("tmain()"), _A("C"), "c4()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "c5()")); + REQUIRE_THAT(src, HasCallInControlCondition(_A("tmain()"), _A("C"), "contents()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -87,8 +87,31 @@ TEST_CASE("t20021", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + using mermaid::HasCallInControlCondition; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a1()")); + REQUIRE_THAT( + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a3()")); + + REQUIRE_THAT(src, !HasCall(_A("tmain()"), _A("B"), "b1()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "b2()")); + + REQUIRE_THAT( + src, HasCallInControlCondition(_A("tmain()"), _A("C"), "c1()")); + REQUIRE_THAT( + src, HasCallInControlCondition(_A("tmain()"), _A("C"), "c2()")); + + REQUIRE_THAT( + src, HasCallInControlCondition(_A("tmain()"), _A("C"), "c4()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "c5()")); + REQUIRE_THAT(src, + HasCallInControlCondition(_A("tmain()"), _A("C"), "contents()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20022/test_case.h b/tests/t20022/test_case.h index a3a2bbf0..19b88900 100644 --- a/tests/t20022/test_case.h +++ b/tests/t20022/test_case.h @@ -28,17 +28,17 @@ TEST_CASE("t20022", "[test-case][sequence]") REQUIRE(model->name() == "t20022_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("B"), "b()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("B"), "b()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -55,8 +55,14 @@ TEST_CASE("t20022", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("B"), "b()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20023/test_case.h b/tests/t20023/test_case.h index 087e2b93..ad50dbb6 100644 --- a/tests/t20023/test_case.h +++ b/tests/t20023/test_case.h @@ -28,20 +28,20 @@ TEST_CASE("t20023", "[test-case][sequence]") REQUIRE(model->name() == "t20023_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a1()")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a2()")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a3()")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a4()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a1()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a3()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a4()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -59,8 +59,17 @@ TEST_CASE("t20023", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a1()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a3()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a4()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20024/test_case.h b/tests/t20024/test_case.h index 9f5768b0..00257fe8 100644 --- a/tests/t20024/test_case.h +++ b/tests/t20024/test_case.h @@ -28,25 +28,25 @@ TEST_CASE("t20024", "[test-case][sequence]") REQUIRE(model->name() == "t20024_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "select(enum_a)")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a0()")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a1()")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a2()")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "a3()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "select(enum_a)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a0()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a1()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a3()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("B"), "select(colors)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("B"), "red()")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("B"), "orange()")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("B"), "green()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "select(colors)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "red()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "orange()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "green()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -65,8 +65,22 @@ TEST_CASE("t20024", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "select(enum_a)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a0()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a1()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "a3()")); + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("B"), "select(colors)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "red()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "orange()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "green()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20025/test_case.h b/tests/t20025/test_case.h index b46e0245..3ece860b 100644 --- a/tests/t20025/test_case.h +++ b/tests/t20025/test_case.h @@ -28,20 +28,20 @@ TEST_CASE("t20025", "[test-case][sequence]") REQUIRE(model->name() == "t20025_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); - REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "a1()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "a1()")); // REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "a2()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("add(int,int)"), "")); - REQUIRE_THAT(puml, !HasCall(_A("tmain()"), _A("add2(int,int)"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("add(int,int)"), "")); + REQUIRE_THAT(src, !HasCall(_A("tmain()"), _A("add2(int,int)"), "")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -59,8 +59,17 @@ TEST_CASE("t20025", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "a1()")); + // REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("add(int,int)"), "")); + REQUIRE_THAT(src, !HasCall(_A("tmain()"), _A("add2(int,int)"), "")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20026/test_case.h b/tests/t20026/test_case.h index da5dd601..1151622a 100644 --- a/tests/t20026/test_case.h +++ b/tests/t20026/test_case.h @@ -28,16 +28,16 @@ TEST_CASE("t20026", "[test-case][sequence]") REQUIRE(model->name() == "t20026_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -53,8 +53,13 @@ TEST_CASE("t20026", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20027/test_case.h b/tests/t20027/test_case.h index 5476d0fe..d91b462b 100644 --- a/tests/t20027/test_case.h +++ b/tests/t20027/test_case.h @@ -28,18 +28,18 @@ TEST_CASE("t20027", "[test-case][sequence]") REQUIRE(model->name() == "t20027_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a()")); - REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "aa()")); - REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "aaa()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "aa()")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "aaa()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -55,8 +55,15 @@ TEST_CASE("t20027", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "aa()")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "aaa()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20028/test_case.h b/tests/t20028/test_case.h index 01174a4d..48feb7a7 100644 --- a/tests/t20028/test_case.h +++ b/tests/t20028/test_case.h @@ -28,21 +28,21 @@ TEST_CASE("t20028", "[test-case][sequence]") REQUIRE(model->name() == "t20028_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist REQUIRE_THAT( - puml, HasCallInControlCondition(_A("tmain()"), _A("A"), "a()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "b()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "c()")); - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "d()")); - REQUIRE_THAT(puml, !HasCall(_A("tmain()"), _A("B"), "e()")); + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "b()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "c()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "d()")); + REQUIRE_THAT(src, !HasCall(_A("tmain()"), _A("B"), "e()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -61,8 +61,19 @@ TEST_CASE("t20028", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + using mermaid::HasCallInControlCondition; + + REQUIRE_THAT( + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "b()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "c()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "d()")); + REQUIRE_THAT(src, !HasCall(_A("tmain()"), _A("B"), "e()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20029/test_case.h b/tests/t20029/test_case.h index 17900066..80ac68e8 100644 --- a/tests/t20029/test_case.h +++ b/tests/t20029/test_case.h @@ -28,38 +28,38 @@ TEST_CASE("t20029", "[test-case][sequence]") REQUIRE(model->name() == "t20029_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist REQUIRE_THAT( - puml, HasCall(_A("tmain()"), _A("ConnectionPool"), "connect()")); - REQUIRE_THAT(puml, + src, HasCall(_A("tmain()"), _A("ConnectionPool"), "connect()")); + REQUIRE_THAT(src, HasCallInControlCondition(_A("tmain()"), _A("Encoder>"), "send(std::string &&)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("Encoder>"), _A("Encoder>"), "encode(std::string &&)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCall(_A("Encoder>"), _A("encode_b64(std::string &&)"), "")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasCallInControlCondition(_A("Retrier"), _A("ConnectionPool"), "send(const std::string &)")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, !HasCall( _A("ConnectionPool"), _A("ConnectionPool"), "connect_impl()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -85,8 +85,36 @@ TEST_CASE("t20029", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + using mermaid::HasCallInControlCondition; + + REQUIRE_THAT( + src, HasCall(_A("tmain()"), _A("ConnectionPool"), "connect()")); + REQUIRE_THAT(src, + HasCallInControlCondition(_A("tmain()"), + _A("Encoder>"), + "send(std::string &&)")); + + REQUIRE_THAT(src, + HasCall(_A("Encoder>"), + _A("Encoder>"), + "encode(std::string &&)")); + + REQUIRE_THAT(src, + HasCall(_A("Encoder>"), + _A("encode_b64(std::string &&)"), "")); + + REQUIRE_THAT(src, + HasCallInControlCondition(_A("Retrier"), + _A("ConnectionPool"), "send(const std::string &)")); + + REQUIRE_THAT(src, + !HasCall( + _A("ConnectionPool"), _A("ConnectionPool"), "connect_impl()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20030/test_case.h b/tests/t20030/test_case.h index 167e5ebb..38b24cdb 100644 --- a/tests/t20030/test_case.h +++ b/tests/t20030/test_case.h @@ -29,30 +29,30 @@ TEST_CASE("t20030", "[test-case][sequence]") REQUIRE(model->name() == "t20030_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain(int)"), _A("magic()"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain(int)"), _A("magic()"), "")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "create()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "create()")); REQUIRE_THAT( - puml, HasCall(_A("tmain(int)"), _A("A"), "operator+=(int)")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "add(int)")); + src, HasCall(_A("tmain(int)"), _A("A"), "operator+=(int)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "add(int)")); - REQUIRE_THAT(puml, HasCall(_A("tmain(bool,int)"), _A("A"), "A()")); + REQUIRE_THAT(src, HasCall(_A("tmain(bool,int)"), _A("A"), "A()")); REQUIRE_THAT( - puml, HasCall(_A("tmain(bool,int)"), _A("A"), "operator+=(int)")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "add(int)")); - REQUIRE_THAT(puml, + src, HasCall(_A("tmain(bool,int)"), _A("A"), "operator+=(int)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "add(int)")); + REQUIRE_THAT(src, HasCall(_A("tmain(bool,int)"), _A("A"), "operator=(const A &)")); - REQUIRE_THAT(puml, HasCall(_A("A"), _A("A"), "set(int)")); - REQUIRE_THAT(puml, HasCall(_A("tmain(bool,int)"), _A("A"), "value()")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "set(int)")); + REQUIRE_THAT(src, HasCall(_A("tmain(bool,int)"), _A("A"), "value()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -64,8 +64,27 @@ TEST_CASE("t20030", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain(int)"), _A("magic()"), "")); + + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "create()")); + REQUIRE_THAT( + src, HasCall(_A("tmain(int)"), _A("A"), "operator+=(int)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "add(int)")); + + REQUIRE_THAT(src, HasCall(_A("tmain(bool,int)"), _A("A"), "A()")); + REQUIRE_THAT( + src, HasCall(_A("tmain(bool,int)"), _A("A"), "operator+=(int)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "add(int)")); + REQUIRE_THAT(src, + HasCall(_A("tmain(bool,int)"), _A("A"), "operator=(const A &)")); + REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "set(int)")); + REQUIRE_THAT(src, HasCall(_A("tmain(bool,int)"), _A("A"), "value()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20031/test_case.h b/tests/t20031/test_case.h index 01a08bee..f9726b91 100644 --- a/tests/t20031/test_case.h +++ b/tests/t20031/test_case.h @@ -29,33 +29,33 @@ TEST_CASE("t20031", "[test-case][sequence]") REQUIRE(model->name() == "t20031_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, HasCall(_A("tmain(int)"), _A("magic()"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain(int)"), _A("magic()"), "")); - REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "create()")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "create()")); REQUIRE_THAT( - puml, !HasCall(_A("tmain(int)"), _A("A"), "operator+=(int)")); - REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "add(int)")); + src, !HasCall(_A("tmain(int)"), _A("A"), "operator+=(int)")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "add(int)")); - REQUIRE_THAT(puml, !HasCall(_A("tmain(bool,int)"), _A("A"), "A()")); + REQUIRE_THAT(src, !HasCall(_A("tmain(bool,int)"), _A("A"), "A()")); REQUIRE_THAT( - puml, !HasCall(_A("tmain(bool,int)"), _A("A"), "operator+=(int)")); - REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "add(int)")); - REQUIRE_THAT(puml, + src, !HasCall(_A("tmain(bool,int)"), _A("A"), "operator+=(int)")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "add(int)")); + REQUIRE_THAT(src, !HasCall(_A("tmain(bool,int)"), _A("A"), "operator=(const A &)")); - REQUIRE_THAT(puml, !HasCall(_A("A"), _A("A"), "set(int)")); - REQUIRE_THAT(puml, HasCall(_A("tmain(bool,int)"), _A("A"), "value()")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "set(int)")); + REQUIRE_THAT(src, HasCall(_A("tmain(bool,int)"), _A("A"), "value()")); + REQUIRE_THAT(src, !HasCall(_A("tmain(bool,int)::(lambda " "../../tests/t20031/t20031.cc:47:26)"), _A("zero()"), "")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -67,8 +67,31 @@ TEST_CASE("t20031", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain(int)"), _A("magic()"), "")); + + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "create()")); + REQUIRE_THAT( + src, !HasCall(_A("tmain(int)"), _A("A"), "operator+=(int)")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "add(int)")); + + REQUIRE_THAT(src, !HasCall(_A("tmain(bool,int)"), _A("A"), "A()")); + REQUIRE_THAT( + src, !HasCall(_A("tmain(bool,int)"), _A("A"), "operator+=(int)")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "add(int)")); + REQUIRE_THAT(src, + !HasCall(_A("tmain(bool,int)"), _A("A"), "operator=(const A &)")); + REQUIRE_THAT(src, !HasCall(_A("A"), _A("A"), "set(int)")); + REQUIRE_THAT(src, HasCall(_A("tmain(bool,int)"), _A("A"), "value()")); + REQUIRE_THAT(src, + !HasCall(_A("tmain(bool,int)::(lambda " + "../../tests/t20031/t20031.cc:47:26)"), + _A("zero()"), "")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20032/test_case.h b/tests/t20032/test_case.h index 6003423a..5116c4ba 100644 --- a/tests/t20032/test_case.h +++ b/tests/t20032/test_case.h @@ -30,32 +30,31 @@ TEST_CASE("t20032", "[test-case][sequence]") REQUIRE(model->name() == "t20032_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist + REQUIRE_THAT(src, HasCall(_A("tmain(int,char **)"), _A("B"), "b(int)")); REQUIRE_THAT( - puml, HasCall(_A("tmain(int,char **)"), _A("B"), "b(int)")); - REQUIRE_THAT( - puml, HasResponse(_A("tmain(int,char **)"), _A("B"), "int")); + src, HasResponse(_A("tmain(int,char **)"), _A("B"), "int")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a1(int)")); - REQUIRE_THAT(puml, HasResponse(_A("B"), _A("A"), "int")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1(int)")); + REQUIRE_THAT(src, HasResponse(_A("B"), _A("A"), "int")); REQUIRE_THAT( - puml, HasCall(_A("tmain(int,char **)"), _A("B"), "b(double)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a2(double)")); - REQUIRE_THAT(puml, HasResponse(_A("B"), _A("A"), "double")); + src, HasCall(_A("tmain(int,char **)"), _A("B"), "b(double)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2(double)")); + REQUIRE_THAT(src, HasResponse(_A("B"), _A("A"), "double")); - REQUIRE_THAT(puml, - HasCall(_A("tmain(int,char **)"), _A("B"), "b(const char *)")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a3(const char *)")); - REQUIRE_THAT(puml, HasResponse(_A("B"), _A("A"), "const char *")); + REQUIRE_THAT( + src, HasCall(_A("tmain(int,char **)"), _A("B"), "b(const char *)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a3(const char *)")); + REQUIRE_THAT(src, HasResponse(_A("B"), _A("A"), "const char *")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -77,8 +76,29 @@ TEST_CASE("t20032", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + using mermaid::HasResponse; + + REQUIRE_THAT(src, HasCall(_A("tmain(int,char **)"), _A("B"), "b(int)")); + REQUIRE_THAT( + src, HasResponse(_A("tmain(int,char **)"), _A("B"), "int")); + + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a1(int)")); + REQUIRE_THAT(src, HasResponse(_A("B"), _A("A"), "int")); + + REQUIRE_THAT( + src, HasCall(_A("tmain(int,char **)"), _A("B"), "b(double)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2(double)")); + REQUIRE_THAT(src, HasResponse(_A("B"), _A("A"), "double")); + + REQUIRE_THAT( + src, HasCall(_A("tmain(int,char **)"), _A("B"), "b(const char *)")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a3(const char *)")); + REQUIRE_THAT(src, HasResponse(_A("B"), _A("A"), "const char *")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20033/test_case.h b/tests/t20033/test_case.h index 41703b18..131acc81 100644 --- a/tests/t20033/test_case.h +++ b/tests/t20033/test_case.h @@ -29,22 +29,22 @@ TEST_CASE("t20033", "[test-case][sequence]") REQUIRE(model->name() == "t20033_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("tmain()"), _A("A"), "a1()")); + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a1()")); REQUIRE_THAT( - puml, HasCallInControlCondition(_A("tmain()"), _A("A"), "a2()")); + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a2()")); REQUIRE_THAT( - puml, HasCallInControlCondition(_A("tmain()"), _A("A"), "a3()")); + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a3()")); REQUIRE_THAT( - puml, HasCallInControlCondition(_A("tmain()"), _A("A"), "a4()")); + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a4()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -56,8 +56,20 @@ TEST_CASE("t20033", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + using mermaid::HasCallInControlCondition; + + REQUIRE_THAT(src, HasCall(_A("tmain()"), _A("A"), "a1()")); + REQUIRE_THAT( + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a2()")); + REQUIRE_THAT( + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a3()")); + REQUIRE_THAT( + src, HasCallInControlCondition(_A("tmain()"), _A("A"), "a4()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20034/test_case.h b/tests/t20034/test_case.h index 3ad62327..c08ef64f 100644 --- a/tests/t20034/test_case.h +++ b/tests/t20034/test_case.h @@ -29,25 +29,25 @@ TEST_CASE("t20034", "[test-case][sequence]") REQUIRE(model->name() == "t20034_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all calls exist - REQUIRE_THAT(puml, HasCall(_A("D"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("D"), _A("A"), "a2()")); - REQUIRE_THAT(puml, HasCall(_A("D"), _A("C"), "c3()")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("C"), "c2()")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("B"), "b2()")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("D"), _A("C"), "c3()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "c2()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("B"), "b2()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2()")); - REQUIRE_THAT(puml, HasCall(_A("D"), _A("C"), "c4()")); + REQUIRE_THAT(src, HasCall(_A("D"), _A("C"), "c4()")); - REQUIRE_THAT(puml, !HasCall(_A("C"), _A("B"), "b3()")); + REQUIRE_THAT(src, !HasCall(_A("C"), _A("B"), "b3()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -75,8 +75,22 @@ TEST_CASE("t20034", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("D"), _A("A"), "a2()")); + + REQUIRE_THAT(src, HasCall(_A("D"), _A("C"), "c3()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "c2()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("B"), "b2()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2()")); + + REQUIRE_THAT(src, HasCall(_A("D"), _A("C"), "c4()")); + + REQUIRE_THAT(src, !HasCall(_A("C"), _A("B"), "b3()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20035/test_case.h b/tests/t20035/test_case.h index b73c22f1..d4eb26dc 100644 --- a/tests/t20035/test_case.h +++ b/tests/t20035/test_case.h @@ -29,17 +29,17 @@ TEST_CASE("t20035", "[test-case][sequence]") REQUIRE(model->name() == "t20035_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, HasCall(_A("tmain(int,char **)"), _A("a(int)"), "")); - REQUIRE_THAT(puml, HasCall(_A("a(int)"), _A("b1(int)"), "")); - REQUIRE_THAT(puml, HasCall(_A("b1(int)"), _A("c(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("tmain(int,char **)"), _A("a(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("a(int)"), _A("b1(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("b1(int)"), _A("c(int)"), "")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -55,8 +55,15 @@ TEST_CASE("t20035", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("tmain(int,char **)"), _A("a(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("a(int)"), _A("b1(int)"), "")); + REQUIRE_THAT(src, HasCall(_A("b1(int)"), _A("c(int)"), "")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t20036/test_case.h b/tests/t20036/test_case.h index e3e6c548..3ecf5714 100644 --- a/tests/t20036/test_case.h +++ b/tests/t20036/test_case.h @@ -29,25 +29,25 @@ TEST_CASE("t20036", "[test-case][sequence]") REQUIRE(model->name() == "t20036_sequence"); { - auto puml = generate_sequence_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_sequence_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("C"), "c2()")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("B"), "b2()")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "c2()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("B"), "b2()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2()")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("B"), "b2()")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("B"), "b2()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2()")); - REQUIRE_THAT(puml, HasCall(_A("D"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("D"), _A("A"), "a2()")); - REQUIRE_THAT(puml, HasCall(_A("C"), _A("B"), "b1()")); - REQUIRE_THAT(puml, HasCall(_A("B"), _A("A"), "a2()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("B"), "b1()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2()")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -71,8 +71,23 @@ TEST_CASE("t20036", "[test-case][sequence]") } { - auto mmd = generate_sequence_mermaid(diagram, *model); + auto src = generate_sequence_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::SequenceDiagramAliasMatcher _A(src); + using mermaid::HasCall; + + REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "c2()")); + REQUIRE_THAT(src, HasCall(_A("C"), _A("B"), "b2()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2()")); + + REQUIRE_THAT(src, HasCall(_A("C"), _A("B"), "b2()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2()")); + + REQUIRE_THAT(src, HasCall(_A("D"), _A("A"), "a2()")); + + REQUIRE_THAT(src, HasCall(_A("C"), _A("B"), "b1()")); + REQUIRE_THAT(src, HasCall(_A("B"), _A("A"), "a2()")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/test_cases.h b/tests/test_cases.h index a6517616..7193e120 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -136,14 +136,19 @@ struct HasCallWithResultMatcher : ContainsMatcher { template class HasCallMatcher : public Catch::MatcherBase { T m_from, m_to, m_message; bool m_is_response; + std::string m_call_arrow, m_return_arrow; std::string call_pattern, response_pattern; public: - HasCallMatcher(T from, T to, T message, bool is_response = false) + HasCallMatcher(T from, T to, T message, bool is_response = false, + const std::string &call_arrow = "->", + const std::string &return_arrow = "-->") : m_from(from) , m_to{to} , m_message{message} , m_is_response{is_response} + , m_call_arrow{call_arrow} + , m_return_arrow{return_arrow} { util::replace_all(m_message, "(", "\\("); util::replace_all(m_message, ")", "\\)"); @@ -152,12 +157,12 @@ public: util::replace_all(m_message, "]", "\\]"); util::replace_all(m_message, "+", "\\+"); - call_pattern = fmt::format("{} -> {} " + call_pattern = fmt::format("{} {} {} " "(\\[\\[.*\\]\\] )?: {}", - m_from, m_to, m_message); + m_from, m_call_arrow, m_to, m_message); - response_pattern = - fmt::format("{} --> {} : //{}//", m_from, m_to, m_message); + response_pattern = fmt::format( + "{} {} {} : //{}//", m_from, m_return_arrow, m_to, m_message); } bool match(T const &in) const override @@ -181,7 +186,8 @@ public: { std::ostringstream ss; ss << "has call " - << fmt::format("{} -> {} : {}", m_from, m_to, m_message); + << fmt::format( + "{} {} {} : {}", m_from, m_call_arrow, m_to, m_message); return ss.str(); } }; @@ -190,7 +196,7 @@ auto HasCall(std::string const &from, std::string const &to, std::string const &message, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) { - return HasCallMatcher(from, to, message); + return HasCallMatcher(from, to, message, false); } auto HasResponse(std::string const &from, std::string const &to, @@ -213,13 +219,91 @@ auto HasCall(std::string const &from, std::string const &message, return HasCall(from, from, message, caseSensitivity); } -auto HasCallWithResponse(std::string const &from, std::string const &to, +namespace mermaid { +template class HasCallMatcher : public Catch::MatcherBase { + T m_from, m_to, m_message; + bool m_is_response; + std::string m_call_arrow, m_return_arrow; + std::string call_pattern, response_pattern; + +public: + HasCallMatcher(T from, T to, T message, bool is_response = false, + const std::string &call_arrow = "->>", + const std::string &return_arrow = "-->>") + : m_from(from) + , m_to{to} + , m_message{message} + , m_is_response{is_response} + , m_call_arrow{call_arrow} + , m_return_arrow{return_arrow} + { + util::replace_all(m_message, "(", "\\("); + util::replace_all(m_message, ")", "\\)"); + util::replace_all(m_message, "*", "\\*"); + util::replace_all(m_message, "[", "\\["); + util::replace_all(m_message, "]", "\\]"); + util::replace_all(m_message, "+", "\\+"); + + call_pattern = + fmt::format("{} {} {} : {}", m_from, m_call_arrow, m_to, m_message); + + response_pattern = fmt::format( + "{} {} {} : {}", m_from, m_return_arrow, m_to, m_message); + } + + bool match(T const &in) const override + { + std::istringstream fin(in); + std::string line; + + std::regex r{m_is_response ? response_pattern : call_pattern}; + + while (std::getline(fin, line)) { + std::smatch base_match; + std::regex_search(in, base_match, r); + if (base_match.size() > 0) + return true; + } + + return false; + } + + std::string describe() const override + { + std::ostringstream ss; + ss << "has call " + << fmt::format( + "{} {} {} : {}", m_from, m_call_arrow, m_to, m_message); + return ss.str(); + } +}; + +auto HasCall(std::string const &from, std::string const &to, std::string const &message, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) { - return ContainsMatcher(CasedString( - fmt::format("{} --> {}", to, from), caseSensitivity)) && - HasCallMatcher(from, to, message); + return mermaid::HasCallMatcher(from, to, message, false); +} + +auto HasCallInControlCondition(std::string const &from, std::string const &to, + std::string const &message, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return mermaid::HasCallMatcher(from, to, fmt::format("[{}]", message)); +} + +auto HasResponse(std::string const &from, std::string const &to, + std::string const &message, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return HasCallMatcher(to, from, message, true, "->>", "-->>"); +} + +auto HasCall(std::string const &from, std::string const &message, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return mermaid::HasCall(from, from, message, caseSensitivity); +} } ContainsMatcher HasEntrypoint(std::string const &to, std::string const &message, @@ -229,6 +313,15 @@ ContainsMatcher HasEntrypoint(std::string const &to, std::string const &message, CasedString(fmt::format("[-> {} : {}", to, message), caseSensitivity)); } +namespace mermaid { +ContainsMatcher HasEntrypoint(std::string const &to, std::string const &message, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher(CasedString( + fmt::format("* ->> {} : {}", to, message), caseSensitivity)); +} +} + ContainsMatcher HasExitpoint(std::string const &to, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) { @@ -236,6 +329,15 @@ ContainsMatcher HasExitpoint(std::string const &to, CasedString(fmt::format("[<-- {}", to), caseSensitivity)); } +namespace mermaid { +ContainsMatcher HasExitpoint(std::string const &to, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher( + CasedString(fmt::format("{} -->> *", to), caseSensitivity)); +} +} + std::string _NS(std::string_view s) { return fmt::format( @@ -326,27 +428,47 @@ struct AliasMatcher { patterns.push_back( std::regex{"class\\s" + alias_regex + "\\[\"" + name + "\"\\]"}); - // patterns.push_back( - // std::regex{"abstract\\s\"" + name + "\"\\sas\\s" + - // alias_regex}); - // patterns.push_back( - // std::regex{"enum\\s\"" + name + "\"\\sas\\s" + - // alias_regex}); - // patterns.push_back( - // std::regex{"package\\s\"" + name + "\"\\sas\\s" + - // alias_regex}); - // patterns.push_back( - // std::regex{"package\\s\\[" + name + "\\]\\sas\\s" + - // alias_regex}); - // patterns.push_back( - // std::regex{"file\\s\"" + name + "\"\\sas\\s" + - // alias_regex}); - // patterns.push_back( - // std::regex{"folder\\s\"" + name + "\"\\sas\\s" + - // alias_regex}); - // patterns.push_back( - // std::regex{"participant\\s\"" + name + "\"\\sas\\s" + - // alias_regex}); + + std::smatch base_match; + + for (const auto &line : mmd) { + for (const auto &pattern : patterns) { + if (std::regex_search(line, base_match, pattern) && + base_match.size() == 2) { + std::ssub_match base_sub_match = base_match[1]; + std::string alias = base_sub_match.str(); + return trim(alias); + } + } + } + + return "__INVALID__ALIAS__"; + } + + const std::vector mmd; +}; + +struct SequenceDiagramAliasMatcher { + SequenceDiagramAliasMatcher(const std::string &mmd_) + : mmd{split(mmd_, "\n")} + { + } + + std::string operator()(std::string name) + { + std::vector patterns; + + const std::string alias_regex("([A-Z]_[0-9]+)"); + + util::replace_all(name, "(", "\\("); + util::replace_all(name, ")", "\\)"); + util::replace_all(name, " ", "\\s"); + util::replace_all(name, "*", "\\*"); + util::replace_all(name, "[", "\\["); + util::replace_all(name, "]", "\\]"); + + patterns.push_back( + std::regex{"participant\\s" + alias_regex + "\\sas\\s" + name}); std::smatch base_match; @@ -678,6 +800,15 @@ ContainsMatcher HasComment(std::string const &comment, CasedString(fmt::format("' {}", comment), caseSensitivity)); } +namespace mermaid { +ContainsMatcher HasComment(std::string const &comment, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher( + CasedString(fmt::format("%% {}", comment), caseSensitivity)); +} +} + ContainsMatcher HasNote(std::string const &cls, std::string const &position, std::string const ¬e = "", CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) From 9872e2d2251fa19f922e74938b698311d00b7985 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 13 Sep 2023 00:24:45 +0200 Subject: [PATCH 17/24] Added mermaid test cases for package diagrams --- tests/t30001/.clang-uml | 12 ++++ tests/t30001/test_case.h | 61 ++++++++++++++----- tests/t30002/test_case.h | 124 ++++++++++++++++++++++++++------------- tests/t30003/test_case.h | 39 +++++++----- tests/t30004/test_case.h | 32 ++++++---- tests/t30005/test_case.h | 35 +++++++---- tests/t30006/test_case.h | 34 +++++++---- tests/t30007/test_case.h | 38 +++++++----- tests/t30008/test_case.h | 57 ++++++++++++------ tests/t30009/test_case.h | 35 +++++++---- tests/t30010/test_case.h | 49 ++++++++++------ tests/t30011/test_case.h | 49 ++++++++++------ tests/test_cases.h | 28 +++++++++ 13 files changed, 407 insertions(+), 186 deletions(-) diff --git a/tests/t30001/.clang-uml b/tests/t30001/.clang-uml index e5faba78..05767605 100644 --- a/tests/t30001/.clang-uml +++ b/tests/t30001/.clang-uml @@ -20,3 +20,15 @@ diagrams: - 'note right of {{ alias("A::AA::AAA") }}: A AAA note...' - '{% set e=element("A::AA") %} note top of {{ alias("A::AA") }} : {{ e.comment.formatted }}' - '{% set e=element("B::AA") %} note top of {{ alias("B::AA") }} : {{ e.comment.formatted }}' + mermaid: + before: + - "%% t30001 test diagram of type {{ diagram.type }}" + after: + - 'N_0001(A AAA note...)' + - 'N_0001 -.- {{ alias("A::AA::AAA") }}' + - '{% set e=element("A::AA") %}N_0002({{ e.comment.formatted }})' + - '{% set e=element("B::AA") %}N_0003({{ e.comment.formatted }})' + - 'N_0002 -.- {{ alias("A::AA") }}' + - 'N_0003 -.- {{ alias("B::AA") }}' + + diff --git a/tests/t30001/test_case.h b/tests/t30001/test_case.h index 50faf08b..0b5fab4a 100644 --- a/tests/t30001/test_case.h +++ b/tests/t30001/test_case.h @@ -29,39 +29,39 @@ TEST_CASE("t30001", "[test-case][package]") REQUIRE(model->name() == "t30001_package"); { - auto puml = generate_package_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_package_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsPackage("A")); - REQUIRE_THAT(puml, IsPackage("AAA")); - REQUIRE_THAT(puml, IsPackage("AAA")); + REQUIRE_THAT(src, IsPackage("A")); + REQUIRE_THAT(src, IsPackage("AAA")); + REQUIRE_THAT(src, IsPackage("AAA")); // TODO: Fix _A() to handle fully qualified names, right // now it only finds the first element with unqualified // name match - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasNote(_A("AA"), "top", "This is namespace AA in namespace A")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasLink(_A("AAA"), fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" "t30001/t30001.cc#L6", clanguml::util::get_git_commit()), "AAA")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasLink(_A("BBB"), fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" "t30001/t30001.cc#L8", clanguml::util::get_git_commit()), "BBB")); - REQUIRE_THAT(puml, HasComment("t30001 test diagram of type package")); + REQUIRE_THAT(src, HasComment("t30001 test diagram of type package")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -84,8 +84,41 @@ TEST_CASE("t30001", "[test-case][package]") } { - auto mmd = generate_package_mermaid(diagram, *model); + auto src = generate_package_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + using mermaid::HasComment; + using mermaid::HasLink; + using mermaid::HasPackageNote; + using mermaid::IsPackage; + + REQUIRE_THAT(src, IsPackage(_A("A"))); + REQUIRE_THAT(src, IsPackage(_A("AAA"))); + REQUIRE_THAT(src, IsPackage(_A("AAA"))); + + // TODO: Fix _A() to handle fully qualified names, right + // now it only finds the first element with unqualified + // name match + REQUIRE_THAT(src, + HasPackageNote( + _A("AA"), "top", "This is namespace AA in namespace A")); + + REQUIRE_THAT(src, + HasLink(_A("AAA"), + fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" + "t30001/t30001.cc#L6", + clanguml::util::get_git_commit()), + "AAA")); + + REQUIRE_THAT(src, + HasLink(_A("BBB"), + fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" + "t30001/t30001.cc#L8", + clanguml::util::get_git_commit()), + "BBB")); + + REQUIRE_THAT(src, HasComment("t30001 test diagram of type package")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t30002/test_case.h b/tests/t30002/test_case.h index 1ebcd105..4d8c0df0 100644 --- a/tests/t30002/test_case.h +++ b/tests/t30002/test_case.h @@ -29,50 +29,50 @@ TEST_CASE("t30002", "[test-case][package]") REQUIRE(model->name() == "t30002_package"); { - auto puml = generate_package_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_package_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsPackage("A1")); - REQUIRE_THAT(puml, IsPackage("A2")); - REQUIRE_THAT(puml, IsPackage("A3")); - REQUIRE_THAT(puml, IsPackage("A4")); - REQUIRE_THAT(puml, IsPackage("A5")); - REQUIRE_THAT(puml, IsPackage("A6")); - REQUIRE_THAT(puml, IsPackage("A7")); - REQUIRE_THAT(puml, IsPackage("A8")); - REQUIRE_THAT(puml, IsPackage("A9")); - REQUIRE_THAT(puml, IsPackage("A11")); - REQUIRE_THAT(puml, IsPackage("A12")); - REQUIRE_THAT(puml, IsPackage("A13")); - REQUIRE_THAT(puml, IsPackage("A14")); - REQUIRE_THAT(puml, IsPackage("A15")); - REQUIRE_THAT(puml, IsPackage("A16")); - REQUIRE_THAT(puml, IsPackage("A17")); - REQUIRE_THAT(puml, IsPackage("A18")); + REQUIRE_THAT(src, IsPackage("A1")); + REQUIRE_THAT(src, IsPackage("A2")); + REQUIRE_THAT(src, IsPackage("A3")); + REQUIRE_THAT(src, IsPackage("A4")); + REQUIRE_THAT(src, IsPackage("A5")); + REQUIRE_THAT(src, IsPackage("A6")); + REQUIRE_THAT(src, IsPackage("A7")); + REQUIRE_THAT(src, IsPackage("A8")); + REQUIRE_THAT(src, IsPackage("A9")); + REQUIRE_THAT(src, IsPackage("A11")); + REQUIRE_THAT(src, IsPackage("A12")); + REQUIRE_THAT(src, IsPackage("A13")); + REQUIRE_THAT(src, IsPackage("A14")); + REQUIRE_THAT(src, IsPackage("A15")); + REQUIRE_THAT(src, IsPackage("A16")); + REQUIRE_THAT(src, IsPackage("A17")); + REQUIRE_THAT(src, IsPackage("A18")); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A1"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A2"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A3"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A4"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A5"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A6"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A7"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A8"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A9"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A10"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A11"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A12"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A13"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A14"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A15"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A16"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A17"))); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A18"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A1"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A2"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A3"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A4"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A5"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A6"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A7"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A8"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A9"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A10"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A11"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A12"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A13"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A14"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A15"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A16"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A17"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("A18"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -123,8 +123,48 @@ TEST_CASE("t30002", "[test-case][package]") } { - auto mmd = generate_package_mermaid(diagram, *model); + auto src = generate_package_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); + using mermaid::IsPackage; + using mermaid::IsPackageDependency; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, IsPackage(_A("A1"))); + REQUIRE_THAT(src, IsPackage(_A("A2"))); + REQUIRE_THAT(src, IsPackage(_A("A3"))); + REQUIRE_THAT(src, IsPackage(_A("A4"))); + REQUIRE_THAT(src, IsPackage(_A("A5"))); + REQUIRE_THAT(src, IsPackage(_A("A6"))); + REQUIRE_THAT(src, IsPackage(_A("A7"))); + REQUIRE_THAT(src, IsPackage(_A("A8"))); + REQUIRE_THAT(src, IsPackage(_A("A9"))); + REQUIRE_THAT(src, IsPackage(_A("A11"))); + REQUIRE_THAT(src, IsPackage(_A("A12"))); + REQUIRE_THAT(src, IsPackage(_A("A13"))); + REQUIRE_THAT(src, IsPackage(_A("A14"))); + REQUIRE_THAT(src, IsPackage(_A("A15"))); + REQUIRE_THAT(src, IsPackage(_A("A16"))); + REQUIRE_THAT(src, IsPackage(_A("A17"))); + REQUIRE_THAT(src, IsPackage(_A("A18"))); + + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A1"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A2"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A3"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A4"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A5"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A6"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A7"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A8"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A9"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A10"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A11"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A12"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A13"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A14"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A15"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A16"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A17"))); + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("A18"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t30003/test_case.h b/tests/t30003/test_case.h index f001ca5e..09082966 100644 --- a/tests/t30003/test_case.h +++ b/tests/t30003/test_case.h @@ -28,22 +28,22 @@ TEST_CASE("t30003", "[test-case][package]") REQUIRE(model->name() == "t30003_package"); { - auto puml = generate_package_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_package_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsPackage("ns1")); - REQUIRE_THAT(puml, IsPackage("ns2")); - REQUIRE_THAT(puml, IsPackage("ns3")); - REQUIRE_THAT(puml, IsPackage("ns2_v1_0_0")); - REQUIRE_THAT(puml, IsPackage("ns2_v0_9_0")); + REQUIRE_THAT(src, IsPackage("ns1")); + REQUIRE_THAT(src, IsPackage("ns2")); + REQUIRE_THAT(src, IsPackage("ns3")); + REQUIRE_THAT(src, IsPackage("ns2_v1_0_0")); + REQUIRE_THAT(src, IsPackage("ns2_v0_9_0")); - REQUIRE_THAT(puml, IsDeprecated(_A("ns2_v0_9_0"))); - REQUIRE_THAT(puml, IsDeprecated(_A("ns3"))); + REQUIRE_THAT(src, IsDeprecated(_A("ns2_v0_9_0"))); + REQUIRE_THAT(src, IsDeprecated(_A("ns3"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -65,8 +65,19 @@ TEST_CASE("t30003", "[test-case][package]") } { - auto mmd = generate_package_mermaid(diagram, *model); + auto src = generate_package_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); + using mermaid::IsPackage; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, IsPackage(_A("ns1"))); + REQUIRE_THAT(src, IsPackage(_A("ns2"))); + REQUIRE_THAT(src, IsPackage(_A("ns3"))); + REQUIRE_THAT(src, IsPackage(_A("ns2_v1_0_0"))); + REQUIRE_THAT(src, IsPackage(_A("ns2_v0_9_0"))); + + // REQUIRE_THAT(src, IsDeprecated(_A("ns2_v0_9_0"))); + // REQUIRE_THAT(src, IsDeprecated(_A("ns3"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t30004/test_case.h b/tests/t30004/test_case.h index 61c5cd81..0eb17be6 100644 --- a/tests/t30004/test_case.h +++ b/tests/t30004/test_case.h @@ -29,19 +29,19 @@ TEST_CASE("t30004", "[test-case][package]") REQUIRE(model->name() == "t30004_package"); { - auto puml = generate_package_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_package_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsPackage("AAA")); - REQUIRE_THAT(puml, IsPackage("BBB")); - REQUIRE_THAT(puml, IsPackage("CCC")); - REQUIRE_THAT(puml, !IsPackage("DDD")); - REQUIRE_THAT(puml, IsPackage("EEE")); + REQUIRE_THAT(src, IsPackage("AAA")); + REQUIRE_THAT(src, IsPackage("BBB")); + REQUIRE_THAT(src, IsPackage("CCC")); + REQUIRE_THAT(src, !IsPackage("DDD")); + REQUIRE_THAT(src, IsPackage("EEE")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -60,8 +60,16 @@ TEST_CASE("t30004", "[test-case][package]") } { - auto mmd = generate_package_mermaid(diagram, *model); + auto src = generate_package_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); + using mermaid::IsPackage; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, IsPackage(_A("AAA"))); + REQUIRE_THAT(src, IsPackage(_A("BBB"))); + REQUIRE_THAT(src, IsPackage(_A("CCC"))); + REQUIRE_THAT(src, !IsPackage(_A("DDD"))); + REQUIRE_THAT(src, IsPackage(_A("EEE"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t30005/test_case.h b/tests/t30005/test_case.h index 3c297da7..75e5d45c 100644 --- a/tests/t30005/test_case.h +++ b/tests/t30005/test_case.h @@ -29,20 +29,20 @@ TEST_CASE("t30005", "[test-case][package]") REQUIRE(model->name() == "t30005_package"); { - auto puml = generate_package_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_package_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsPackage("AAA")); - REQUIRE_THAT(puml, IsPackage("BBB")); - REQUIRE_THAT(puml, IsPackage("CCC")); + REQUIRE_THAT(src, IsPackage("AAA")); + REQUIRE_THAT(src, IsPackage("BBB")); + REQUIRE_THAT(src, IsPackage("CCC")); - REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("AAA"))); - REQUIRE_THAT(puml, IsDependency(_A("CCC"), _A("AAA"))); + REQUIRE_THAT(src, IsDependency(_A("BBB"), _A("AAA"))); + REQUIRE_THAT(src, IsDependency(_A("CCC"), _A("AAA"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -67,8 +67,19 @@ TEST_CASE("t30005", "[test-case][package]") } { - auto mmd = generate_package_mermaid(diagram, *model); + auto src = generate_package_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::IsPackage; + using mermaid::IsPackageDependency; + + REQUIRE_THAT(src, IsPackage(_A("AAA"))); + REQUIRE_THAT(src, IsPackage(_A("BBB"))); + REQUIRE_THAT(src, IsPackage(_A("CCC"))); + + REQUIRE_THAT(src, IsPackageDependency(_A("BBB"), _A("AAA"))); + REQUIRE_THAT(src, IsPackageDependency(_A("CCC"), _A("AAA"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t30006/test_case.h b/tests/t30006/test_case.h index 618a393a..bed6eeca 100644 --- a/tests/t30006/test_case.h +++ b/tests/t30006/test_case.h @@ -29,20 +29,20 @@ TEST_CASE("t30006", "[test-case][package]") REQUIRE(model->name() == "t30006_package"); { - auto puml = generate_package_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_package_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsPackage("A")); - REQUIRE_THAT(puml, IsPackage("B")); - REQUIRE_THAT(puml, IsPackage("C")); + REQUIRE_THAT(src, IsPackage("A")); + REQUIRE_THAT(src, IsPackage("B")); + REQUIRE_THAT(src, IsPackage("C")); - REQUIRE_THAT(puml, IsDependency(_A("A"), _A("B"))); - REQUIRE_THAT(puml, IsDependency(_A("A"), _A("C"))); + REQUIRE_THAT(src, IsDependency(_A("A"), _A("B"))); + REQUIRE_THAT(src, IsDependency(_A("A"), _A("C"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -61,8 +61,18 @@ TEST_CASE("t30006", "[test-case][package]") } { - auto mmd = generate_package_mermaid(diagram, *model); + auto src = generate_package_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); + using mermaid::IsPackage; + using mermaid::IsPackageDependency; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, IsPackage(_A("A"))); + REQUIRE_THAT(src, IsPackage(_A("B"))); + REQUIRE_THAT(src, IsPackage(_A("C"))); + + REQUIRE_THAT(src, IsPackageDependency(_A("A"), _A("B"))); + REQUIRE_THAT(src, IsPackageDependency(_A("A"), _A("C"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t30007/test_case.h b/tests/t30007/test_case.h index 249f9a22..796f453b 100644 --- a/tests/t30007/test_case.h +++ b/tests/t30007/test_case.h @@ -29,23 +29,23 @@ TEST_CASE("t30007", "[test-case][package]") REQUIRE(model->name() == "t30007_package"); { - auto puml = generate_package_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_package_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsPackage("A")); - REQUIRE_THAT(puml, IsPackage("B")); - REQUIRE_THAT(puml, IsPackage("C")); + REQUIRE_THAT(src, IsPackage("A")); + REQUIRE_THAT(src, IsPackage("B")); + REQUIRE_THAT(src, IsPackage("C")); - REQUIRE_THAT(puml, IsDependency(_A("AA"), _A("B"))); - REQUIRE_THAT(puml, IsDependency(_A("AA"), _A("C"))); + REQUIRE_THAT(src, IsDependency(_A("AA"), _A("B"))); + REQUIRE_THAT(src, IsDependency(_A("AA"), _A("C"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("C"), "up", _A("AA"))); - REQUIRE_THAT(puml, IsLayoutHint(_A("C"), "left", _A("B"))); + REQUIRE_THAT(src, IsLayoutHint(_A("C"), "up", _A("AA"))); + REQUIRE_THAT(src, IsLayoutHint(_A("C"), "left", _A("B"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -65,8 +65,18 @@ TEST_CASE("t30007", "[test-case][package]") } { - auto mmd = generate_package_mermaid(diagram, *model); + auto src = generate_package_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); + using mermaid::IsPackage; + using mermaid::IsPackageDependency; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, IsPackage(_A("A"))); + REQUIRE_THAT(src, IsPackage(_A("B"))); + REQUIRE_THAT(src, IsPackage(_A("C"))); + + REQUIRE_THAT(src, IsPackageDependency(_A("AA"), _A("B"))); + REQUIRE_THAT(src, IsPackageDependency(_A("AA"), _A("C"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t30008/test_case.h b/tests/t30008/test_case.h index c737f815..8d724055 100644 --- a/tests/t30008/test_case.h +++ b/tests/t30008/test_case.h @@ -29,29 +29,29 @@ TEST_CASE("t30008", "[test-case][package]") REQUIRE(model->name() == "t30008_package"); { - auto puml = generate_package_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_package_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsPackage("A")); - REQUIRE_THAT(puml, IsPackage("B")); - REQUIRE_THAT(puml, IsPackage("C")); - REQUIRE_THAT(puml, !IsPackage("X")); + REQUIRE_THAT(src, IsPackage("A")); + REQUIRE_THAT(src, IsPackage("B")); + REQUIRE_THAT(src, IsPackage("C")); + REQUIRE_THAT(src, !IsPackage("X")); - REQUIRE_THAT(puml, IsDependency(_A("B"), _A("A"))); - REQUIRE_THAT(puml, IsDependency(_A("C"), _A("B"))); + REQUIRE_THAT(src, IsDependency(_A("B"), _A("A"))); + REQUIRE_THAT(src, IsDependency(_A("C"), _A("B"))); - REQUIRE_THAT(puml, IsPackage("D")); - REQUIRE_THAT(puml, IsPackage("E")); - REQUIRE_THAT(puml, IsPackage("F")); - REQUIRE_THAT(puml, !IsPackage("Y")); + REQUIRE_THAT(src, IsPackage("D")); + REQUIRE_THAT(src, IsPackage("E")); + REQUIRE_THAT(src, IsPackage("F")); + REQUIRE_THAT(src, !IsPackage("Y")); - REQUIRE_THAT(puml, IsDependency(_A("E"), _A("D"))); - REQUIRE_THAT(puml, IsDependency(_A("F"), _A("E"))); + REQUIRE_THAT(src, IsDependency(_A("E"), _A("D"))); + REQUIRE_THAT(src, IsDependency(_A("F"), _A("E"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -79,8 +79,27 @@ TEST_CASE("t30008", "[test-case][package]") } { - auto mmd = generate_package_mermaid(diagram, *model); + auto src = generate_package_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); + using mermaid::IsPackage; + using mermaid::IsPackageDependency; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, IsPackage(_A("A"))); + REQUIRE_THAT(src, IsPackage(_A("B"))); + REQUIRE_THAT(src, IsPackage(_A("C"))); + REQUIRE_THAT(src, !IsPackage(_A("X"))); + + REQUIRE_THAT(src, IsPackageDependency(_A("B"), _A("A"))); + REQUIRE_THAT(src, IsPackageDependency(_A("C"), _A("B"))); + + REQUIRE_THAT(src, IsPackage(_A("D"))); + REQUIRE_THAT(src, IsPackage(_A("E"))); + REQUIRE_THAT(src, IsPackage(_A("F"))); + REQUIRE_THAT(src, !IsPackage(_A("Y"))); + + REQUIRE_THAT(src, IsPackageDependency(_A("E"), _A("D"))); + REQUIRE_THAT(src, IsPackageDependency(_A("F"), _A("E"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t30009/test_case.h b/tests/t30009/test_case.h index 41e2575c..efb4902d 100644 --- a/tests/t30009/test_case.h +++ b/tests/t30009/test_case.h @@ -29,21 +29,21 @@ TEST_CASE("t30009", "[test-case][package]") REQUIRE(model->name() == "t30009_package"); { - auto puml = generate_package_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_package_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); // Check if all packages exist - REQUIRE_THAT(puml, IsPackage("One")); - REQUIRE_THAT(puml, IsPackage("Two")); - REQUIRE_THAT(puml, IsPackage("A")); - REQUIRE_THAT(puml, IsPackage("B")); - REQUIRE_THAT(puml, IsPackage("C")); - REQUIRE_THAT(puml, IsPackage("D")); + REQUIRE_THAT(src, IsPackage("One")); + REQUIRE_THAT(src, IsPackage("Two")); + REQUIRE_THAT(src, IsPackage("A")); + REQUIRE_THAT(src, IsPackage("B")); + REQUIRE_THAT(src, IsPackage("C")); + REQUIRE_THAT(src, IsPackage("D")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -66,8 +66,17 @@ TEST_CASE("t30009", "[test-case][package]") } { - auto mmd = generate_package_mermaid(diagram, *model); + auto src = generate_package_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); + using mermaid::IsPackage; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, IsPackage(_A("One"))); + REQUIRE_THAT(src, IsPackage(_A("Two"))); + REQUIRE_THAT(src, IsPackage(_A("A"))); + REQUIRE_THAT(src, IsPackage(_A("B"))); + REQUIRE_THAT(src, IsPackage(_A("C"))); + REQUIRE_THAT(src, IsPackage(_A("D"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t30010/test_case.h b/tests/t30010/test_case.h index b2bd5dca..03a1e1ca 100644 --- a/tests/t30010/test_case.h +++ b/tests/t30010/test_case.h @@ -29,25 +29,25 @@ TEST_CASE("t30010", "[test-case][package]") REQUIRE(model->name() == "t30010_package"); { - auto puml = generate_package_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_package_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsPackage("app")); - REQUIRE_THAT(puml, IsPackage("libraries")); - REQUIRE_THAT(puml, IsPackage("lib1")); - REQUIRE_THAT(puml, IsPackage("lib2")); - REQUIRE_THAT(puml, !IsPackage("library1")); - REQUIRE_THAT(puml, !IsPackage("library2")); + REQUIRE_THAT(src, IsPackage("app")); + REQUIRE_THAT(src, IsPackage("libraries")); + REQUIRE_THAT(src, IsPackage("lib1")); + REQUIRE_THAT(src, IsPackage("lib2")); + REQUIRE_THAT(src, !IsPackage("library1")); + REQUIRE_THAT(src, !IsPackage("library2")); - REQUIRE_THAT(puml, IsDependency(_A("app"), _A("lib1"))); - REQUIRE_THAT(puml, IsDependency(_A("app"), _A("lib2"))); - REQUIRE_THAT(puml, IsDependency(_A("app"), _A("lib3"))); - REQUIRE_THAT(puml, IsDependency(_A("app"), _A("lib4"))); + REQUIRE_THAT(src, IsDependency(_A("app"), _A("lib1"))); + REQUIRE_THAT(src, IsDependency(_A("app"), _A("lib2"))); + REQUIRE_THAT(src, IsDependency(_A("app"), _A("lib3"))); + REQUIRE_THAT(src, IsDependency(_A("app"), _A("lib4"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -59,8 +59,23 @@ TEST_CASE("t30010", "[test-case][package]") } { - auto mmd = generate_package_mermaid(diagram, *model); + auto src = generate_package_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); + using mermaid::IsPackage; + using mermaid::IsPackageDependency; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, IsPackage(_A("app"))); + REQUIRE_THAT(src, IsPackage(_A("libraries"))); + REQUIRE_THAT(src, IsPackage(_A("lib1"))); + REQUIRE_THAT(src, IsPackage(_A("lib2"))); + REQUIRE_THAT(src, !IsPackage(_A("library1"))); + REQUIRE_THAT(src, !IsPackage(_A("library2"))); + + REQUIRE_THAT(src, IsPackageDependency(_A("app"), _A("lib1"))); + REQUIRE_THAT(src, IsPackageDependency(_A("app"), _A("lib2"))); + REQUIRE_THAT(src, IsPackageDependency(_A("app"), _A("lib3"))); + REQUIRE_THAT(src, IsPackageDependency(_A("app"), _A("lib4"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/t30011/test_case.h b/tests/t30011/test_case.h index 3af06b7a..ac66a448 100644 --- a/tests/t30011/test_case.h +++ b/tests/t30011/test_case.h @@ -29,25 +29,25 @@ TEST_CASE("t30011", "[test-case][package]") REQUIRE(model->name() == "t30011_package"); { - auto puml = generate_package_puml(diagram, *model); - AliasMatcher _A(puml); + auto src = generate_package_puml(diagram, *model); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsPackage("app")); - REQUIRE_THAT(puml, IsPackage("libraries")); - REQUIRE_THAT(puml, IsPackage("lib1")); - REQUIRE_THAT(puml, IsPackage("lib2")); - REQUIRE_THAT(puml, !IsPackage("library1")); - REQUIRE_THAT(puml, !IsPackage("library2")); + REQUIRE_THAT(src, IsPackage("app")); + REQUIRE_THAT(src, IsPackage("libraries")); + REQUIRE_THAT(src, IsPackage("lib1")); + REQUIRE_THAT(src, IsPackage("lib2")); + REQUIRE_THAT(src, !IsPackage("library1")); + REQUIRE_THAT(src, !IsPackage("library2")); - REQUIRE_THAT(puml, IsDependency(_A("app"), _A("lib1"))); - REQUIRE_THAT(puml, IsDependency(_A("app"), _A("lib2"))); - REQUIRE_THAT(puml, IsDependency(_A("app"), _A("lib3"))); - REQUIRE_THAT(puml, IsDependency(_A("app"), _A("lib4"))); + REQUIRE_THAT(src, IsDependency(_A("app"), _A("lib1"))); + REQUIRE_THAT(src, IsDependency(_A("app"), _A("lib2"))); + REQUIRE_THAT(src, IsDependency(_A("app"), _A("lib3"))); + REQUIRE_THAT(src, IsDependency(_A("app"), _A("lib4"))); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -59,8 +59,23 @@ TEST_CASE("t30011", "[test-case][package]") } { - auto mmd = generate_package_mermaid(diagram, *model); + auto src = generate_package_mermaid(diagram, *model); + mermaid::AliasMatcher _A(src); + using mermaid::IsPackage; + using mermaid::IsPackageDependency; - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + REQUIRE_THAT(src, IsPackage(_A("app"))); + REQUIRE_THAT(src, IsPackage(_A("libraries"))); + REQUIRE_THAT(src, IsPackage(_A("lib1"))); + REQUIRE_THAT(src, IsPackage(_A("lib2"))); + REQUIRE_THAT(src, !IsPackage(_A("library1"))); + REQUIRE_THAT(src, !IsPackage(_A("library2"))); + + REQUIRE_THAT(src, IsPackageDependency(_A("app"), _A("lib1"))); + REQUIRE_THAT(src, IsPackageDependency(_A("app"), _A("lib2"))); + REQUIRE_THAT(src, IsPackageDependency(_A("app"), _A("lib3"))); + REQUIRE_THAT(src, IsPackageDependency(_A("app"), _A("lib4"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } \ No newline at end of file diff --git a/tests/test_cases.h b/tests/test_cases.h index 7193e120..6b2b8bf3 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -428,6 +428,8 @@ struct AliasMatcher { patterns.push_back( std::regex{"class\\s" + alias_regex + "\\[\"" + name + "\"\\]"}); + patterns.push_back( + std::regex{"subgraph\\s" + alias_regex + "\\[" + name + "\\]"}); std::smatch base_match; @@ -729,6 +731,17 @@ ContainsMatcher IsDependency(std::string const &from, std::string const &to, CasedString(fmt::format("{} ..> {}", from, to), caseSensitivity)); } +namespace mermaid { +ContainsMatcher IsPackageDependency(std::string const &from, + std::string const &to, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher( + CasedString(fmt::format("{} -.-> {}", from, to), caseSensitivity)); +} + +} + ContainsMatcher IsConstraint(std::string const &from, std::string const &to, std::string const &label = {}, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) @@ -825,6 +838,13 @@ ContainsMatcher HasNote(std::string const &cls, return ContainsMatcher( CasedString(fmt::format("note for {}", cls), caseSensitivity)); } +ContainsMatcher HasPackageNote(std::string const &cls, + std::string const &position = "", std::string const ¬e = "", + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher( + CasedString(fmt::format("-.- {}", cls), caseSensitivity)); +} } ContainsMatcher HasMemberNote(std::string const &cls, std::string const &member, @@ -1063,6 +1083,14 @@ ContainsMatcher IsPackage(std::string const &str, CasedString("package [" + str + "]", caseSensitivity)); } +namespace mermaid { +ContainsMatcher IsPackage(std::string const &str, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher(CasedString("subgraph " + str, caseSensitivity)); +} +} + ContainsMatcher IsFolder(std::string const &str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) { From a99e987d3ba482b7d5c434e006cc886edbbb3bc3 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 13 Sep 2023 16:16:07 +0200 Subject: [PATCH 18/24] Added mermaid test cases for include diagrams --- tests/t40001/.clang-uml | 4 +- tests/t40001/test_case.h | 58 ++++++++++++++++-------- tests/t40002/test_case.h | 97 ++++++++++++++++++++++++++++++---------- tests/t40003/test_case.h | 46 ++++++++++++------- tests/test_cases.h | 24 +++++++++- util/generate_mermaid.py | 2 +- 6 files changed, 171 insertions(+), 60 deletions(-) diff --git a/tests/t40001/.clang-uml b/tests/t40001/.clang-uml index eee88bce..14660735 100644 --- a/tests/t40001/.clang-uml +++ b/tests/t40001/.clang-uml @@ -22,6 +22,8 @@ diagrams: - 'note right of {{ alias("include/lib1") }}: This is a lib1 include dir' - 'note right of {{ alias("include/t40001_include1.h") }}: This is a t40001_include1.h include file' mermaid: + before: + - "%% t40001 test diagram of type {{ diagram.type }}" after: - 'N_00001(This is a lib1 include dir)-.-{{ alias("include/lib1") }}' - - 'N_00002(This is a lib1 include dir)-.-{{ alias("include/t40001_include1.h") }}' \ No newline at end of file + - 'N_00002(This is a t40001_include1.h include file)-.-{{ alias("include/t40001_include1.h") }}' \ No newline at end of file diff --git a/tests/t40001/test_case.h b/tests/t40001/test_case.h index 3905c6f9..545c8cd2 100644 --- a/tests/t40001/test_case.h +++ b/tests/t40001/test_case.h @@ -29,31 +29,30 @@ TEST_CASE("t40001", "[test-case][include]") REQUIRE(model->name() == "t40001_include"); { - auto puml = generate_include_puml(diagram, *model); + auto src = generate_include_puml(diagram, *model); - AliasMatcher _A(puml); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsFolder("lib1")); - REQUIRE_THAT(puml, IsFile("lib1.h")); - REQUIRE_THAT(puml, IsFile("t40001.cc")); - REQUIRE_THAT(puml, IsFile("t40001_include1.h")); + REQUIRE_THAT(src, IsFolder("lib1")); + REQUIRE_THAT(src, IsFile("lib1.h")); + REQUIRE_THAT(src, IsFile("t40001.cc")); + REQUIRE_THAT(src, IsFile("t40001_include1.h")); - REQUIRE_THAT(puml, IsFile("string")); - REQUIRE_THAT(puml, IsFile("yaml-cpp/yaml.h")); + REQUIRE_THAT(src, IsFile("string")); + REQUIRE_THAT(src, IsFile("yaml-cpp/yaml.h")); REQUIRE_THAT( - puml, IsAssociation(_A("t40001.cc"), _A("t40001_include1.h"))); - REQUIRE_THAT( - puml, IsAssociation(_A("t40001_include1.h"), _A("lib1.h"))); + src, IsAssociation(_A("t40001.cc"), _A("t40001_include1.h"))); + REQUIRE_THAT(src, IsAssociation(_A("t40001_include1.h"), _A("lib1.h"))); - REQUIRE_THAT(puml, IsDependency(_A("t40001_include1.h"), _A("string"))); + REQUIRE_THAT(src, IsDependency(_A("t40001_include1.h"), _A("string"))); - REQUIRE_THAT(puml, HasComment("t40001 test diagram of type include")); + REQUIRE_THAT(src, HasComment("t40001 test diagram of type include")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -81,8 +80,31 @@ TEST_CASE("t40001", "[test-case][include]") } { - auto mmd = generate_include_mermaid(diagram, *model); + auto src = generate_include_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::HasComment; + using mermaid::IsFile; + using mermaid::IsFolder; + using mermaid::IsIncludeDependency; + + REQUIRE_THAT(src, IsFolder(_A("lib1"))); + REQUIRE_THAT(src, IsFile(_A("lib1.h"))); + REQUIRE_THAT(src, IsFile(_A("t40001.cc"))); + REQUIRE_THAT(src, IsFile(_A("t40001_include1.h"))); + + REQUIRE_THAT(src, IsFile(_A("string"))); + REQUIRE_THAT(src, IsFile(_A("yaml-cpp/yaml.h"))); + + REQUIRE_THAT( + src, IsAssociation(_A("t40001.cc"), _A("t40001_include1.h"))); + REQUIRE_THAT(src, IsAssociation(_A("t40001_include1.h"), _A("lib1.h"))); + + REQUIRE_THAT( + src, IsIncludeDependency(_A("t40001_include1.h"), _A("string"))); + + REQUIRE_THAT(src, HasComment("t40001 test diagram of type include")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t40002/test_case.h b/tests/t40002/test_case.h index 7f70d770..5a6e451c 100644 --- a/tests/t40002/test_case.h +++ b/tests/t40002/test_case.h @@ -29,58 +29,58 @@ TEST_CASE("t40002", "[test-case][include]") REQUIRE(model->name() == "t40002_include"); { - auto puml = generate_include_puml(diagram, *model); + auto src = generate_include_puml(diagram, *model); - AliasMatcher _A(puml); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsFolder("lib1")); - REQUIRE_THAT(puml, IsFolder("lib2")); - REQUIRE_THAT(puml, IsFile("lib1.h")); - REQUIRE_THAT(puml, IsFile("lib2.h")); - REQUIRE_THAT(puml, !IsFile("lib2_detail.h")); - REQUIRE_THAT(puml, IsFile("t40002.cc")); - REQUIRE_THAT(puml, IsFile("lib1.cc")); - REQUIRE_THAT(puml, IsFile("lib2.cc")); + REQUIRE_THAT(src, IsFolder("lib1")); + REQUIRE_THAT(src, IsFolder("lib2")); + REQUIRE_THAT(src, IsFile("lib1.h")); + REQUIRE_THAT(src, IsFile("lib2.h")); + REQUIRE_THAT(src, !IsFile("lib2_detail.h")); + REQUIRE_THAT(src, IsFile("t40002.cc")); + REQUIRE_THAT(src, IsFile("lib1.cc")); + REQUIRE_THAT(src, IsFile("lib2.cc")); - REQUIRE_THAT(puml, !IsFile("string")); + REQUIRE_THAT(src, !IsFile("string")); - REQUIRE_THAT(puml, IsAssociation(_A("t40002.cc"), _A("lib1.h"))); - REQUIRE_THAT(puml, IsAssociation(_A("lib1.h"), _A("lib2.h"))); - REQUIRE_THAT(puml, IsAssociation(_A("lib1.cc"), _A("lib1.h"))); - REQUIRE_THAT(puml, IsAssociation(_A("lib2.cc"), _A("lib2.h"))); + REQUIRE_THAT(src, IsAssociation(_A("t40002.cc"), _A("lib1.h"))); + REQUIRE_THAT(src, IsAssociation(_A("lib1.h"), _A("lib2.h"))); + REQUIRE_THAT(src, IsAssociation(_A("lib1.cc"), _A("lib1.h"))); + REQUIRE_THAT(src, IsAssociation(_A("lib2.cc"), _A("lib2.h"))); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasLink(_A("t40002.cc"), fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" "t40002/src/t40002.cc#L0", clanguml::util::get_git_commit()), "t40002.cc")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasLink(_A("lib1.cc"), fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" "t40002/src/lib1/lib1.cc#L0", clanguml::util::get_git_commit()), "lib1.cc")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasLink(_A("lib1.h"), fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" "t40002/include/lib1/lib1.h#L0", clanguml::util::get_git_commit()), "lib1.h")); - REQUIRE_THAT(puml, + REQUIRE_THAT(src, HasLink(_A("lib2.h"), fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" "t40002/include/lib2/lib2.h#L0", clanguml::util::get_git_commit()), "lib2.h")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -112,8 +112,57 @@ TEST_CASE("t40002", "[test-case][include]") } { - auto mmd = generate_include_mermaid(diagram, *model); + auto src = generate_include_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::HasLink; + using mermaid::IsFile; + using mermaid::IsFolder; + + REQUIRE_THAT(src, IsFolder(_A("lib1"))); + REQUIRE_THAT(src, IsFolder(_A("lib2"))); + REQUIRE_THAT(src, IsFile(_A("lib1.h"))); + REQUIRE_THAT(src, IsFile(_A("lib2.h"))); + REQUIRE_THAT(src, !IsFile(_A("lib2_detail.h"))); + REQUIRE_THAT(src, IsFile(_A("t40002.cc"))); + REQUIRE_THAT(src, IsFile(_A("lib1.cc"))); + REQUIRE_THAT(src, IsFile(_A("lib2.cc"))); + + REQUIRE_THAT(src, !IsFile(_A("string"))); + + REQUIRE_THAT(src, IsAssociation(_A("t40002.cc"), _A("lib1.h"))); + REQUIRE_THAT(src, IsAssociation(_A("lib1.h"), _A("lib2.h"))); + REQUIRE_THAT(src, IsAssociation(_A("lib1.cc"), _A("lib1.h"))); + REQUIRE_THAT(src, IsAssociation(_A("lib2.cc"), _A("lib2.h"))); + + REQUIRE_THAT(src, + HasLink(_A("t40002.cc"), + fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" + "t40002/src/t40002.cc#L0", + clanguml::util::get_git_commit()), + "t40002.cc")); + + REQUIRE_THAT(src, + HasLink(_A("lib1.cc"), + fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" + "t40002/src/lib1/lib1.cc#L0", + clanguml::util::get_git_commit()), + "lib1.cc")); + + REQUIRE_THAT(src, + HasLink(_A("lib1.h"), + fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" + "t40002/include/lib1/lib1.h#L0", + clanguml::util::get_git_commit()), + "lib1.h")); + + REQUIRE_THAT(src, + HasLink(_A("lib2.h"), + fmt::format("https://github.com/bkryza/clang-uml/blob/{}/tests/" + "t40002/include/lib2/lib2.h#L0", + clanguml::util::get_git_commit()), + "lib2.h")); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/t40003/test_case.h b/tests/t40003/test_case.h index bcadef1a..88bb5bf7 100644 --- a/tests/t40003/test_case.h +++ b/tests/t40003/test_case.h @@ -29,25 +29,25 @@ TEST_CASE("t40003", "[test-case][include]") REQUIRE(model->name() == "t40003_include"); { - auto puml = generate_include_puml(diagram, *model); + auto src = generate_include_puml(diagram, *model); - AliasMatcher _A(puml); + AliasMatcher _A(src); - REQUIRE_THAT(puml, StartsWith("@startuml")); - REQUIRE_THAT(puml, EndsWith("@enduml\n")); + REQUIRE_THAT(src, StartsWith("@startuml")); + REQUIRE_THAT(src, EndsWith("@enduml\n")); - REQUIRE_THAT(puml, IsFolder("dependants")); - REQUIRE_THAT(puml, IsFolder("dependencies")); + REQUIRE_THAT(src, IsFolder("dependants")); + REQUIRE_THAT(src, IsFolder("dependencies")); - REQUIRE_THAT(puml, IsFile("t1.h")); - REQUIRE_THAT(puml, IsFile("t2.h")); - REQUIRE_THAT(puml, IsFile("t3.h")); + REQUIRE_THAT(src, IsFile("t1.h")); + REQUIRE_THAT(src, IsFile("t2.h")); + REQUIRE_THAT(src, IsFile("t3.h")); - REQUIRE_THAT(puml, !IsFile("t4.h")); - REQUIRE_THAT(puml, IsFile("t5.h")); - REQUIRE_THAT(puml, !IsFile("t6.h")); + REQUIRE_THAT(src, !IsFile("t4.h")); + REQUIRE_THAT(src, IsFile("t5.h")); + REQUIRE_THAT(src, !IsFile("t6.h")); - save_puml(config.output_directory(), diagram->name + ".puml", puml); + save_puml(config.output_directory(), diagram->name + ".puml", src); } { @@ -76,8 +76,24 @@ TEST_CASE("t40003", "[test-case][include]") } { - auto mmd = generate_include_mermaid(diagram, *model); + auto src = generate_include_mermaid(diagram, *model); - save_mermaid(config.output_directory(), diagram->name + ".mmd", mmd); + mermaid::AliasMatcher _A(src); + using mermaid::HasLink; + using mermaid::IsFile; + using mermaid::IsFolder; + + REQUIRE_THAT(src, IsFolder(_A("dependants"))); + REQUIRE_THAT(src, IsFolder(_A("dependencies"))); + + REQUIRE_THAT(src, IsFile(_A("t1.h"))); + REQUIRE_THAT(src, IsFile(_A("t2.h"))); + REQUIRE_THAT(src, IsFile(_A("t3.h"))); + + REQUIRE_THAT(src, !IsFile(_A("t4.h"))); + REQUIRE_THAT(src, IsFile(_A("t5.h"))); + REQUIRE_THAT(src, !IsFile(_A("t6.h"))); + + save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } } diff --git a/tests/test_cases.h b/tests/test_cases.h index 6b2b8bf3..12d4a6de 100644 --- a/tests/test_cases.h +++ b/tests/test_cases.h @@ -430,6 +430,8 @@ struct AliasMatcher { std::regex{"class\\s" + alias_regex + "\\[\"" + name + "\"\\]"}); patterns.push_back( std::regex{"subgraph\\s" + alias_regex + "\\[" + name + "\\]"}); + patterns.push_back( + std::regex{"\\s\\s" + alias_regex + "\\[" + name + "\\]"}); // file std::smatch base_match; @@ -739,7 +741,13 @@ ContainsMatcher IsPackageDependency(std::string const &from, return ContainsMatcher( CasedString(fmt::format("{} -.-> {}", from, to), caseSensitivity)); } - +ContainsMatcher IsIncludeDependency(std::string const &from, + std::string const &to, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher( + CasedString(fmt::format("{} -.-> {}", from, to), caseSensitivity)); +} } ContainsMatcher IsConstraint(std::string const &from, std::string const &to, @@ -1105,6 +1113,20 @@ ContainsMatcher IsFile(std::string const &str, CasedString("file \"" + str + "\"", caseSensitivity)); } +namespace mermaid { +ContainsMatcher IsFolder(std::string const &str, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher(CasedString("subgraph " + str, caseSensitivity)); +} + +ContainsMatcher IsFile(std::string const &str, + CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) +{ + return ContainsMatcher(CasedString(str + "[", caseSensitivity)); +} +} + ContainsMatcher IsDeprecated(std::string const &str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes) { diff --git a/util/generate_mermaid.py b/util/generate_mermaid.py index 45e6366a..b85cfc94 100644 --- a/util/generate_mermaid.py +++ b/util/generate_mermaid.py @@ -52,7 +52,7 @@ if not files: ok = 0 -with ThreadPoolExecutor(max_workers=10) as executor: +with ThreadPoolExecutor(max_workers=16) as executor: result = all(executor.map(generate_mermaid_diagram, files)) From 70e70888231938ba5310a8e0e28b9351beba21ef Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 13 Sep 2023 17:17:48 +0200 Subject: [PATCH 19/24] Fixed clang-tidy warnings --- .../generators/mermaid/class_diagram_generator.cc | 8 ++++---- src/common/generators/mermaid/generator.cc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/class_diagram/generators/mermaid/class_diagram_generator.cc b/src/class_diagram/generators/mermaid/class_diagram_generator.cc index f1cf57fd..0b115042 100644 --- a/src/class_diagram/generators/mermaid/class_diagram_generator.cc +++ b/src/class_diagram/generators/mermaid/class_diagram_generator.cc @@ -240,16 +240,16 @@ void generator::generate_method( std::vector method_mods; if (m.is_defaulted()) { - method_mods.push_back("default"); + method_mods.emplace_back("default"); } if (m.is_const()) { - method_mods.push_back("const"); + method_mods.emplace_back("const"); } if (m.is_constexpr()) { - method_mods.push_back("constexpr"); + method_mods.emplace_back("constexpr"); } if (m.is_consteval()) { - method_mods.push_back("consteval"); + method_mods.emplace_back("consteval"); } if (!method_mods.empty()) { diff --git a/src/common/generators/mermaid/generator.cc b/src/common/generators/mermaid/generator.cc index f7b270c4..355995d4 100644 --- a/src/common/generators/mermaid/generator.cc +++ b/src/common/generators/mermaid/generator.cc @@ -74,8 +74,8 @@ std::string to_mermaid(message_t r) std::string indent(const unsigned level) { - const auto kIndentWidth = 4U; - return std::string(level * kIndentWidth, ' '); + const auto kIndentWidth = 4UL; + return std::string(level * kIndentWidth, ' '); // NOLINT } std::string render_name(std::string name) From abd85534bcd4c3b57f1e2d6f8c683ddfae6d99fd Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 13 Sep 2023 18:54:23 +0200 Subject: [PATCH 20/24] Updated docs with Mermaid docs --- CHANGELOG.md | 4 +- README.md | 30 +++++++------ docs/architecture.md | 2 + docs/common_options.md | 39 +++++++++++----- docs/configuration_file.md | 9 +++- docs/generator_types.md | 70 ++++++++++++++++++++++++++++- docs/img/mermaid_aggregation.png | Bin 0 -> 1128 bytes docs/img/mermaid_association.png | Bin 0 -> 772 bytes docs/img/mermaid_composition.png | Bin 0 -> 867 bytes docs/img/mermaid_dependency.png | Bin 0 -> 1047 bytes docs/img/mermaid_inheritance.png | Bin 0 -> 1098 bytes docs/img/mermaid_instantiation.png | Bin 0 -> 1338 bytes docs/img/mermaid_nested.png | Bin 0 -> 976 bytes docs/interactive_svg_diagrams.md | 10 +++-- docs/quick_start.md | 8 +++- 15 files changed, 137 insertions(+), 35 deletions(-) create mode 100644 docs/img/mermaid_aggregation.png create mode 100644 docs/img/mermaid_association.png create mode 100644 docs/img/mermaid_composition.png create mode 100644 docs/img/mermaid_dependency.png create mode 100644 docs/img/mermaid_inheritance.png create mode 100644 docs/img/mermaid_instantiation.png create mode 100644 docs/img/mermaid_nested.png diff --git a/CHANGELOG.md b/CHANGELOG.md index b2dd19ff..a43daf91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,11 @@ # CHANGELOG + * Added MermaidJS diagram generators (#27) + ### 0.3.9 * Added `from_to` and `to` location constraints to sequence diagrams (#154) * Fixed 'else if' statement generation in sequence diagrams (#81) - * Implemented removal of redundant dependency relationhips (#28) + * Implemented removal of redundant dependency relationships (#28) * Add option to disable generation of dependency relation to template arguments (#141) * Added configuration file validation (#57) diff --git a/README.md b/README.md index 5edf5ccd..8fd3f0e9 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ YAML configuration files. The main idea behind the project is to easily maintain up-to-date diagrams within a code-base or document legacy code. The configuration file or files for `clang-uml` define the types and contents of each generated diagram. -The diagrams can be generated in [PlantUML](https://plantuml.com) and JSON formats. +The diagrams can be generated in [PlantUML](https://plantuml.com), +[MermaidJS](https://mermaid.js.org/) and JSON formats. `clang-uml` currently supports C++ up to version 17 with partial support for C++ 20. @@ -35,8 +36,8 @@ Main features supported so far include: * Template specialization and instantiation based on deduced context - [_example_](docs/test_cases/t00062.md) * Relationship inference from C++ containers and smart pointers - [_example_](docs/test_cases/t00007.md) * Diagram content filtering based on namespaces, elements and relationships - [_example_](docs/test_cases/t00040.md) - * Optional package generation from namespaces - [_example_](docs/test_cases/t00036.md) - * Optional package generation from subdirectories - [_example_](docs/test_cases/t00065.md) + * Optional package generation from namespaces (only PlantUML) - [_example_](docs/test_cases/t00036.md) + * Optional package generation from subdirectories (only PlantUML) - [_example_](docs/test_cases/t00065.md) * Interactive links to online code to classes, methods and class fields in SVG diagrams - [_example_](https://raw.githubusercontent.com/bkryza/clang-uml/master/docs/test_cases/t00002_class.svg) * Support for plain C99/C11 code (struct and units relationships) - [_example_](docs/test_cases/t00057.md) * C++20 concept constraints - [_example_](docs/test_cases/t00059.md) @@ -370,17 +371,17 @@ results in the following diagram (via PlantUML) based on include directives in t ### Default mappings -| UML | PlantUML | -| ---- | --- | -| Inheritance | ![extension](docs/img/puml_inheritance.png) | -| Association | ![association](docs/img/puml_association.png) | -| Dependency | ![dependency](docs/img/puml_dependency.png) | -| Aggregation | ![aggregation](docs/img/puml_aggregation.png) | -| Composition | ![composition](docs/img/puml_composition.png) | -| Template specialization/instantiation | ![specialization](docs/img/puml_instantiation.png) | -| Nesting (inner class/enum) | ![nesting](docs/img/puml_nested.png) | -| Include (local) | ![association](docs/img/puml_association.png) | -| Include (system) | ![dependency](docs/img/puml_dependency.png) | +| UML | PlantUML | MermaidJS | +| ---- | --- |------------------------------------------------| +| Inheritance | ![extension](docs/img/puml_inheritance.png) | ![extension](docs/img/mermaid_inheritance.png) | +| Association | ![association](docs/img/puml_association.png) | ![association](docs/img/mermaid_association.png) | +| Dependency | ![dependency](docs/img/puml_dependency.png) | ![dependency](docs/img/mermaid_dependency.png) | +| Aggregation | ![aggregation](docs/img/puml_aggregation.png) | ![aggregation](docs/img/mermaid_aggregation.png) | +| Composition | ![composition](docs/img/puml_composition.png) | ![composition](docs/img/mermaid_composition.png) | +| Template specialization/instantiation | ![specialization](docs/img/puml_instantiation.png) | ![specialization](docs/img/mermaid_instantiation.png) | +| Nesting (inner class/enum) | ![nesting](docs/img/puml_nested.png) | ![nesting](docs/img/mermaid_nested.png) | +| Include (local) | ![association](docs/img/puml_association.png) | ![association](docs/img/mermaid_association.png) | +| Include (system) | ![dependency](docs/img/puml_dependency.png) | ![dependency](docs/img/mermaid_dependency.png) | ### Diagram content filtering @@ -433,6 +434,7 @@ This project relies on the following great tools: * [Clang LibTooling](https://clang.llvm.org/docs/LibTooling.html) - a C++ library for creating tools based on Clang * [PlantUML](https://plantuml.com/) - language and diagram for generating UML diagrams +* [MermaidJS](https://mermaid.js.org/) - JavaScript based diagramming and charting tool * [Catch2](https://github.com/catchorg/Catch2) - C++ unit test framework * [glob](https://github.com/p-ranav/glob) - Unix style path expansion for C++ * [indicators](https://github.com/p-ranav/indicators) - Activity indicators for modern C++ diff --git a/docs/architecture.md b/docs/architecture.md index 24cd6415..2367eb42 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -134,12 +134,14 @@ Diagram generators convert the `clang-uml`'s internal UML model into actual diagram in one of the supported formats: - PlantUML +- MermaidJS - JSON Each diagram generator extends a common interface appropriate for the selected output format, i.e.: - [PlantUML](classclanguml_1_1common_1_1generators_1_1plantuml_1_1generator.html) +- [MermaidJS](classclanguml_1_1common_1_1generators_1_1mermaid_1_1generator.html) - [JSON](classclanguml_1_1common_1_1generators_1_1json_1_1generator.html) and renders the output to a file. For each diagram type there is a separate diff --git a/docs/common_options.md b/docs/common_options.md index d8f77ac8..f2535835 100644 --- a/docs/common_options.md +++ b/docs/common_options.md @@ -4,7 +4,7 @@ * [Overall configuration file structure](#overall-configuration-file-structure) * [Translation unit glob patterns](#translation-unit-glob-patterns) -* [PlantUML custom directives](#plantuml-custom-directives) +* [Custom directives](#custom-directives) * [Adding debug information in the generated diagrams](#adding-debug-information-in-the-generated-diagrams) * [Resolving include path and compiler flags issues](#resolving-include-path-and-compiler-flags-issues) * [Use '--query-driver' command line option](#use---query-driver-command-line-option) @@ -63,9 +63,10 @@ For small projects, the `glob` property can be omitted, which will result in `cl from `compile_commands.json` for the diagram. However for large projects, constraining the number of translation units for each diagram to absolute minimum will significantly decrease the diagram generation times. -## PlantUML custom directives -In case it's necessary to add some custom PlantUML declarations before or after the generated diagram content, -it can be achieved simply using the `plantuml` configuration properties, for instance: +## Custom directives +In case it's necessary to add some custom PlantUML or MermaidJS declarations +before or after the generated diagram content, it can be achieved simply using +the `plantuml` or `mermaid` configuration properties, for instance for PlantUML: ```yaml plantuml: @@ -75,23 +76,37 @@ it can be achieved simply using the `plantuml` configuration properties, for ins - note left of {{ alias("ns1::ns2::MyClass") }} This is my class. ``` -These directive are useful for instance for adding notes to elements in the diagrams or customizing diagram layout -or style. +or for MermaidJS: -Please note that when referring to diagram elements in the PlantUML directives, they must be added using Jinja -templates `alias` command as in the example above. +```yaml + mermaid: + before: + - direction LR + after: + - note for {{ alias("ns1::ns2::MyClass") }} "This is my class." +``` -More options can be found in the official PlantUML [documentation](https://plantuml.com/). +These directive are useful for instance for adding notes to elements in the +diagrams or customizing diagram layout or style. + +Please note that when referring to diagram elements in the PlantUML directives, +they must be added using Jinja templates `alias` command as in the example above. + +More options can be found in the official docs for each respective generator: + * [PlantUML](https://plantuml.com/) + * [MermaidJS](https://mermaid.js.org/intro/) ## Adding debug information in the generated diagrams -Sometimes it is useful for debugging issues with the diagrams to have information on the exact source location, -from which given declaration or call expression was derived. By adding option: +Sometimes it is useful for debugging issues with the diagrams to have information +on the exact source location, from which given declaration or call expression was +derived. By adding option: ```yaml debug_mode: true ``` -the generated PlantUML diagram will contain comments before each line containing the source location of the +the generated PlantUML diagram will contain comments before each line containing +the source location of the specific diagram element. ## Resolving include path and compiler flags issues diff --git a/docs/configuration_file.md b/docs/configuration_file.md index 1b0fe40a..77b39b64 100644 --- a/docs/configuration_file.md +++ b/docs/configuration_file.md @@ -54,7 +54,10 @@ * `plantuml` - verbatim PlantUML directives which should be added to a diagram * `before` - list of directives which will be added before the generated diagram * `after` - list of directives which will be added after the generated diagram - +* `mermaid` - verbatim MermaidJS directives which should be added to a diagram + * `before` - list of directives which will be added before the generated diagram + * `after` - list of directives which will be added after the generated diagram + * ## Example complete config ```yaml @@ -138,6 +141,10 @@ diagrams: # Add this line to the beginning of the resulting puml file before: - 'title clang-uml class diagram model' + mermaid: + # Add this line at the end of a Mermaid diagram + end: + - 'direction LR' ``` ## Determining config file location diff --git a/docs/generator_types.md b/docs/generator_types.md index 9d8de7ea..e52642ab 100644 --- a/docs/generator_types.md +++ b/docs/generator_types.md @@ -3,17 +3,19 @@ * [PlantUML](#plantuml) +* [MermaidJS](#mermaidjs) * [JSON](#json) -Currently, there are 2 types of diagram generators: `plantuml` and `json`. +Currently, there are 3 types of diagram generators: `plantuml`, `mermaid` +and `json`. To specify, which generators should be used on the command line use option `-g`. For instance to generate both types of diagrams run `clang-uml` as follows: ```bash -clang-uml -g plantuml -g json +clang-uml -g plantuml -g mermaid -g json ``` By default, only `plantuml` diagrams are generated. @@ -92,6 +94,70 @@ __ The footer at the end is added by default, but can be disabled with `--no-metadata` command line option. +## MermaidJS + +This generator, creates UML diagrams in textual MermaidJS format, which can then +be used directly in some Markdown renderers (e.g. GitHub) or converted to +various image formats using [mermaid-cli](https://github.com/mermaid-js/mermaid-cli). + +In case there is a need for adding custom MermaidJS directives to generated +diagrams, they can be included directly in the diagram configuration. For +example: + +```yaml + mermaid: + before: + - direction LR + after: + - 'note for {{ alias("inheritable_diagram_options") }} "Options common to all diagram types."' + - 'note for {{ alias("config") }} "General options not used by diagrams."' +``` + +will add before the diagram contents (right after diagram type, +e.g. `classDiagram`) diagram direction hint, and after each diagram contents +2 notes attached to elements. + +An example MermaidJS diagram is presented below: + +``` +classDiagram + class C_0001371951663534295727["A"] + class C_0001371951663534295727 { + +A() : [default] void + +A(int i) : void + +A(A &&) : [default] void + +A(const A &) : void + +A(T t) : void + +~A() : [default] void + +operator=(A && other) : A & + +operator=(A & other) : A & + +operator++() : A & + +auto_method() : int + +basic_method() : void + +const_method() : [const] void + +create_from_int(int i) : A$ + +default_int(int i = 12) : int + +default_string(int i, std::string s = "abc") : std::string + +double_int(const int i) : int + -private_method() : void + #protected_method() : void + +size() : [const,constexpr] std::size_t + +static_method() : int$ + +sum(const double a, const double b) : int + -a_ : int + +auto_member : const unsigned long + -b_ : int + -c_ : int + #compare : std::function<bool (const int)> + -private_member : int + #protected_member : int + +public_member : int + +static_const_int : const int + +static_int : int + } + click C_0001371951663534295727 href "https://github.com/bkryza/clang-uml/blob/70e70888231938ba5310a8e0e28b9351beba21ef/tests/t00003/t00003.cc#L7" "A" +``` + ## JSON Generates a JSON representation of the intermediate `clang-uml` model, which diff --git a/docs/img/mermaid_aggregation.png b/docs/img/mermaid_aggregation.png new file mode 100644 index 0000000000000000000000000000000000000000..10a052b7102374c3d7a03876ddadb0b96cdaa83f GIT binary patch literal 1128 zcmV-u1eg1XP)X0{{R3L&#HO00004XF*Lt006O% z3;baP0000WV@Og>004R>004l5008;`004mK004C`008P>0026e000+ooVrmw0005? zP)t-slX2VG&GP^M|J>Z$$H&L|`uh9(`?n`T6gwu>ii$r!KX`b5)z#(e>;KHm z+j4Swe}8}A;NZ~E&|_m`L_|iNov7vI_obz=O-)cyQBkwAviJA*+|Tr@tE)&zNLyQ9 zzrW4T&);`3lAPk=^WEL?u)XT){O|Ao+}!MpjFm$}L}+Me&CSjJ{{G+J-*~R%m4rY0b)x>L;_|D zd}IIs00(qQO+^Ri2@Mbq7EYc3nE(I*OG!jQR5;6HU|?jT9$*+MrZKayQq43rb`DN1 zZYr6^!^_7nASfg(LJiYI#l$5frKDwK<>VqnojsYRIcPgNIlHK+f(?V1=jtZw?m?Dm zo?hO3KE7&j!@$P*`3D3B1&5Ff7(&CsBmC45W$+fH*ajBAiXg$HMg|3wF7-CRo>AV+tp2;S%`dEl%d(v+t)u~;-tw_rjlzI zQW-LB`iz;gX3v>Bk8HD0%D4Fo7A{)6gnWmgn#MGhW$7|X%o;+q48;Hd#FUNAV2*N{ z0000bbVXQnWMOn=I%9HWVRU5xGB7eTEigGPF*8&#HaajcIyE;dFfckWF!f|7p8x;= zC3HntbYx+4WjbwdWNBu305UK#Gc7PVEip4xF*Q0hI65^lD=;uRFfa*AF#G@j02y>e uSaefwW^{L9a%BK#Zf|X6EpuaXWo2%2Xm51y1HV21000045bDP46hOx7_4S6Fo+k-*%fF5l=vUu6XH6#@b=BKpZ@>< z|MKO_@87@w`t@u3_U&O|VJlXw`1kMM+qZA~`}?h}t!-^>4;?ym<;s=J%uFLABSS;O zNs}i1{{8#s&z~DNZuIf-F)%PlN=kbD`t_?XZCFen(4yxm=x(zt6F46!(U^-5;g zAqO7z4~Y(DtS2K>yI2?Iu;v_GlyfSsRcUtB|IG&P8P7BO*d6%Ku;1KME%D6pmxs=| zerA8Mr8_}GX5pnp)5AAfOf8$sP`LPFNLBT8mp%0XNBE*%1-ef>w<4+fttPjTWwXO+ z@h(-C1DjU%6o#$5Hm|j2X5P(LiC>R#Tktu2o~qEZcPqn^Ywt>`PbE(M-d`8}&6lT* zrFOFM)h6YWrpLRw3;rnHnPj28rYRJFu4q9i4;B-JXpC>2OC7#SED>l#?<8XAWf znpqiGSQ(jW8yHv_7*xNkk4Djuo1c=IR*9~`%*qt1L2k!CaPkG&5S*V@Ql40p%8;Iy gpPQ;%474mYuQ(&Wzopr0B7@5Q~&?~ literal 0 HcmV?d00001 diff --git a/docs/img/mermaid_composition.png b/docs/img/mermaid_composition.png new file mode 100644 index 0000000000000000000000000000000000000000..3562b65a0f2ecfd89821d998d428751bc1f8474b GIT binary patch literal 867 zcmeAS@N?(olHy`uVBq!ia0vp^zCbL=!3-pwPXs3eDVB6cUq=Rpjs4tz5?O(Kg=CK) zprR@@28M45bDP46hOx7_4S6Fo+k-*%fHRz`&>$;1l9Hx$ySQv!DL| z|9|Jso#V%k|N8ao_wV1kcI^rZ3bM7e?dhOySuHdtQs2|A3S() z;lhQ~)YRbM;P2nR-#Pzf&6+iyo}QMLmbJCDckkYvQh0mUy34I?Efy9Qfq{WHZrr$e z^X8=dn=$?+`ue&iCMK?~u5NB_E9M-`&dIX3x9{oc*|%@s{{8#!T=@F#-P;KhCfL~6 zBqk;vK79DkpFcZx>~L~&nlfcdVPWBk6DR)u{rmCb#~CwbxVX5?nlUnTlODOeKa2F% z<)s|coV{C7e$wv-zRw?~ELPYnSv~Xf;mgwdJG!>>v%c)@JbC>*+oR|OhyO4$oiyg2 z=zsUkQpbIwPtEzc_!O@jEHP3s(U}uJMPJFND`#`SsqHUjM10;+@kzEVODdSd+et|^ zjdx*GTM`39URwZf)r;oCz%WxSag8WRNi0dVN-jzTQVd20M#j1Zmb!+X0{{R3L&#HO00004XF*Lt006O% z3;baP0000WV@Og>004R>004l5008;`004mK004C`008P>0026e000+ooVrmw0004Z zP)t-slX2VG&GP^M|LN)J_xJbu`uexGw^mkGsHmv^{{HRl?T?R-J3Bi)Jw3w0!qn8% zX=!OPGBPnSF_My!`}_O(`T4Q2u}n-%FfcG;Vq)v->+0(2iHV6iIyyl?LC43(&(F_f zWMq|Y55Dp}UNl_U9 z00DSOL_t(I%hi-=GXp^ohF2p55wjA;nGj@c96PQgNFuIfca59G8SB1@`}px%q5OcI z5A>I*>bL8ezGft;0K}Q}UucCz;%LRLl2W%QT3LC8r&1KnTSeq*pO{MhHMNx1)jNcJ z(;6C^sN5WI3j3l3TL@ZfNC2&^y(3JCLOWH*Fpwf$-90j9=IPZ~AMTsGpD{Lo%Am&B z5T@&kGN#2o+krwHhdw;Q*l008B8iR^3T1eXB>;-j()h$AQ4~U^rgeQL4G@|&OluBf zc-XY&7XZ{2%UoPS$FgA>D@a>i)AjW@KqhOLrVE7)-842c0O>7B+TI}qY36Q@?_mmV zug!TBV+wPe?_&!71I}}w(@xvmW=K;jIS(A-y+MpTLLteyeT-Ga_N2(k>Df6YM83!f z=o`+|=ek7P)wRQi06+Vt-6%4>%?qMI>h7M>Y)lXhLiQGYcywCp?;rB?th~Gm`;j2_ zX1$A}K_agTq&c_0O#1-ZnMT6Xq0%-0001R)MObuXVRU6WV{&C-bY%cCFfubOFgYzT zGgL7)IxsRiG&3tOFgh?W$#l~%0000bbVXQnWMOn=I&E)cX=Zrljsi4q5t+#Mivof_uxY7@A}Vu=KS*?$Ln_Q} z!F2vUf8b0-m%1ie{$N@-r#Lo*9RoooE^snsr-w6t(s$Qi_3qyL+~>Xbx%ckftB9h8 zdAh&p4gi2BF&vD6kpjEdQCB$Pr)dlrUdq5xZ~*YD$YU?%FwA`z;W2R2#diUK_Zi3pbRHZW*lf13u`!KCv$nP- zm&*kL0gV-P%H@{!_mArJw$;^x)m7)yr_SBo-NnVl-rnBa+}yAiMr5-K zC6a*$4=gs@zTv)Oe}CU%u}Gy-E|*IpkwB1;nVBONUstIft*q>h59mfmN6N~|qN1Yk zcqlbBqrSdfq0n2c+m)4-dcD4itxt+B33@)H>w;8g+e3}#mC3vaG~eUeNjkm5Z>!ZhI5=2T zRK#RvH8pi9mB!`e9kbaCL19^0dF}1}b8}{!ZBM6LF&d4XogL@Tvp^6G4<{8A6xY>V zlSsN+T3SLvLQp7_N~Nl+t3!VrJOsbOp;U4h=#uVHk_Hnu4v_-6Ex+t}{MeZvs`UPF z8A}9lv1ex)bb8t~Z~7bjPSn7So6)m@g~zDx=Xm$jPtD%>z~{YFXHJraS*c5}R`Fxh z=$rW))gu&KH1TujGfEPkMkXhepVV+R9iFfJbeR&Nl-^Y$0{u`*wPJosd(ZU89FeRs z{%JHeC2E=)5)&7UpI~KU-;}fwa1n3&zrMHU>hdigA1Xf%a}SY^7ZM~ucaGkkx}D|g zbr_An1*0m`CayG9HP*INHq`WXf1lboR6@=1?&g*GwpRQmz9ISjXX!6*&4h>}{ilT* zMUSm9wQYXnB0?haBl(Iim{ht`I-`32h|trW;_6cOTu2p(`|K@WA}9)&&j!;^+gp)& z>c9M6Tc#mZ&6w<+%MAnRU*BsJup-39PveSBCAMld-DimI>$Vx;>T;r|k#I!Z#{zVZ zDtY?TS4!a1zQcjyIcX^zCWevEgaJS!(E$kLM+j6vEGh_t48Wkz`XiATBy!1Qx$qxB zHam@#Ui^On8uKCgUxC^|ABF{9FDB5~=^SoKJ`>2uVP`WD1@JItPC+J{^UQTT7;XZH L5EbkTrSty*|Ctq( literal 0 HcmV?d00001 diff --git a/docs/img/mermaid_instantiation.png b/docs/img/mermaid_instantiation.png new file mode 100644 index 0000000000000000000000000000000000000000..cde3a2659ee19b9d3ff37b18d20e602bb9b8e889 GIT binary patch literal 1338 zcmZ8fdsLDK6#r&vt8_h2%g(8_TrJmdfaWo>CIZSs5dAcrkBJH@T0X*wwK8QLo%SHj z5Sp5^skkz?q?#t`#Nz`s5jq9}K96W9K1j(2%D&G2+U_~`{?6~-`#bmCb8jw{;%&F> zz%~E?>Pb zP65CVZ~)NL006}YfKQW)8~oe>z{;QM6M(y$qE_`9Ef&kh#)e+6Z)|K-C=>>RK_Zc4 zXJ><;zpJZjRaMo(!a`S9*X`T4gMxxQJu#u75!bHepwSqiP`J3bD3kT^c=y7?!vg|> zv$MHkv2<+A_~y+Ni9~+?{{6tfKuJkSbaXTZgZ1_G&&bGr{#>Hf&KeAs*;&iLfR0Ec zudJ-7)#{3h3MP|@!{JCI3Y(o#Tl-R_($CCn%*5{X!>S6p0TS=l3*Z20ZlwdOkI%a;vVSy@yn z6@$S=MaA;@52aF-PPdYupRZD>luD)9Y#tsSe)sO( zA0HprXfy>$s&KzFXBQ+41`~-|CMHY^3(yvm?(XhhUS3!%HaMTrdU|?bVBp{RM>%g>%YV=xkmi>rEjHItL8qoboZoOeP(%EO1X{r#hQy;-SzTUl8VAJ4?& zi7eKoqM~x4u&T7Q)WgFAfj|@$746u6$_aYAkD^H4SgV-rSLhJgl1d=swoGod+qq+J z{SE3ORBj<)(E)DV(KH&p{19zFrxH>3$5X#)L+Tp&3d1CmIgIY$(!ON(~4w{DVsdPP0GFc(KeuUtCVKJaSj z?|uSFp=s4Xdz0f`mC-#}mo2-7~U_2!|A-hd8ruQb34-ii*QJzNZjtg1%ZD^IUE5*49~&z82eC>dYQ8TjOo4t~T76aSIovcgatAcJpdwoK=4LUMs2YL{QDXu(~wu z<>d3!xC1-?@=?o1c8O9HI#|g4!e4AQ^Fp(#)77Sfr`d)|w+Ec8M185)dd>9NygS}b z!S|@Q+%b+iymlOJ@i@Qg_laI$v)L)&j^j<1&8n6&pG)Y!G$C`Gv?C&1u uf&GUGU{XvfJMtm}h)qnoz<{x!VT?ppTvF=XrslIy6F|UGuunW`oPPl5^_znL literal 0 HcmV?d00001 diff --git a/docs/img/mermaid_nested.png b/docs/img/mermaid_nested.png new file mode 100644 index 0000000000000000000000000000000000000000..144c5c4f4b5e8c2d8caad612aef2884f0da7e9e1 GIT binary patch literal 976 zcmeAS@N?(olHy`uVBq!ia0vp^zCbL=!3-pwPXs3eDVB6cUq=Rpjs4tz5?O(Kg=CK) zprR@@28M45bDP46hOx7_4S6Fo+k-*%fHRz`!^uz$e6Ya^dZpXFvV_ z|NqaQKMx;1JaFK^nl)?Iu3h{1@#DjX568#HD=RCDii%1|NT{l+CMPE!KYsl0-@mud zfBF3Rb8~aExVX5nv2jaF%bq=ZE?v5`d-v|9rX~Xe14&8A&d$!SU%yT*x^wQ(^W3}~ zAt9lr;?Ca|j5D=I= zdGf!1|0d?&G*tC0D9HQu>(`GTKQb~h6crV3+_=%7b1l>}@8+!=SFc``k&)@mx-zwM z-S6MO!o$OzoSeRY|2`r2`r++&+S=L_6cmmgJ$m!z%}Mz;ubzB2Yt}4wc6M7^TX%PN zH#fJ5c{k1+csg<7#8s3jbE{gaxSYHn`+<;$18?5oM))lZ*20RnY( z^`fF8V|AbI?yeAzTnS0>ZQHhO*s!6jtnARXTRy(tva+&^7A=}LZ=RHtR8UaRt5>g{ zK7A4z8oF-Xx;uC7yng*UB_-wAvuE??&$qI&l9Q9u(a~A5WXb#Y?;9E#8XFsD%$V`v z!v_N?V<}*?F(!GtyD+73*Q5YB>?NMQuI$e_c?I}PX8&`n1xkx~x;TbdoK8+iNLeJ8 zAn|3H;pPpSHf}C52tI6*=BJk@7Z)dISI6k+CCMYUAeZrI}lcr6aI(hjS6INH% zRMAilci&j&;BKYMTS`m5eo3@pc2-Un_VO_{HQw$}pu2WWu7=^+Yv<%1MJ+3~ zn+6AO?5N;6q^oGiIdlG;NnW0F+LkR<&J-7UE~s$dAmQAp6K9+XHdhwuoG|Cfh{}tr zV>Ic^6crPl9*`ihf=Badke>GX6>HWcXosy^wd{yN!B4fA;M2k3@$tunuQ)_DvglSz zTYjB2E4n61(>Pn>iqRD&2Bir(ds62y^#cPtbL5k!OIYCB*~Vvq#c5S*V@Ql40p k%8;IypPQ;%474mYuQ(&W -`clang-uml` in combination with PlantUML's link generation in diagrams allows to generate interactive diagrams, -where clicking on any class, method or call expression can direct the user directly to the source code or some other +`clang-uml` in combination with PlantUML's link generation in diagrams allows to +generate interactive diagrams, where clicking on any class, method or call +expression can direct the user directly to the source code or some other diagram or document available online. -For instance to generate links to GitHub repository directly for most of diagram elements simple add this to your -`.clang-uml` file: +For instance to generate links to GitHub repository directly for most diagram +elements simple add this to your `.clang-uml` file: + ```yaml generate_links: link: 'https://github.com/myorg/myrepo/blob/{{ git.commit }}/{{ element.source.path }}#L{{ element.source.line }}' diff --git a/docs/quick_start.md b/docs/quick_start.md index 254a836a..c687784e 100644 --- a/docs/quick_start.md +++ b/docs/quick_start.md @@ -44,8 +44,14 @@ To add an initial class diagram to your project, follow these steps: ``` 4. Generate SVG images from the PlantUML diagrams: ```bash - plantuml -tsvg puml/*.puml + plantuml -tsvg diagrams/*.puml ``` + or generate also MermaidJS diagram (requires [mermaid-cli](https://github.com/mermaid-js/mermaid-cli)): + ``` + clang-uml --progress -n some_class_diagram -g mermaid + mmdc -i diagrams/some_class_diagram.mmd -o diagrams/some_class_diagram.svg + ``` + 5. Add another diagram: ```bash clang-uml --add-sequence-diagram another_diagram From 627c2e5cbe3e283082e298428e7392caaa68eb41 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 13 Sep 2023 19:47:34 +0200 Subject: [PATCH 21/24] Fixed clanguml_diagrams target --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e776c9bd..a5a4a0d3 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,8 @@ clanguml_diagrams: debug # Convert .mmd files to svg images python3 util/generate_mermaid.py docs/diagrams/*.mmd # Format generated SVG files - python3 util/format_svg.py docs/diagrams/*.svg + python3 util/format_svg.py docs/diagrams/plantuml/*.svg + python3 util/format_svg.py docs/diagrams/mermaid/*.svg .PHONY: submodules submodules: From 7e22b0b6825968b1b4d6787cd3fd6894a88e2fa6 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 13 Sep 2023 19:50:08 +0200 Subject: [PATCH 22/24] Updated docs --- docs/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 81f0e489..8d146c4c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,7 +7,8 @@ YAML configuration files. The main idea behind the project is to easily maintain up-to-date diagrams within a code-base or document legacy code. The configuration file or files for `clang-uml` define the types and contents of each generated diagram. -The diagrams can be generated in [PlantUML](https://plantuml.com) and JSON formats. +The diagrams can be generated in [PlantUML](https://plantuml.com), +[MermaidJS](https://mermaid.js.org/) and JSON formats. Example sequence diagram generated using `clang-uml` from [this code](https://github.com/bkryza/clang-uml/blob/master/tests/t20029/t20029.cc): ![Sample sequence diagram](test_cases/t20029_sequence.svg) From 509358b88f710260645a2dc359fe543ca06386b4 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 13 Sep 2023 20:07:10 +0200 Subject: [PATCH 23/24] Updated test cases documentation --- docs/test_cases/t00002.md | 7 +- docs/test_cases/t00002_class.svg | 68 +-- docs/test_cases/t00002_class_mermaid.svg | 95 +++- docs/test_cases/t00003.md | 2 +- docs/test_cases/t00003_class.svg | 126 +++--- docs/test_cases/t00003_class_mermaid.svg | 24 +- docs/test_cases/t00004.md | 2 +- docs/test_cases/t00004_class.svg | 86 ++-- docs/test_cases/t00004_class_mermaid.svg | 290 ++++++------ docs/test_cases/t00005.md | 2 +- docs/test_cases/t00005_class.svg | 110 ++--- docs/test_cases/t00005_class_mermaid.svg | 26 +- docs/test_cases/t00006.md | 2 +- docs/test_cases/t00006_class.svg | 134 +++--- docs/test_cases/t00006_class_mermaid.svg | 52 ++- docs/test_cases/t00007.md | 2 +- docs/test_cases/t00007_class.svg | 30 +- docs/test_cases/t00007_class_mermaid.svg | 10 +- docs/test_cases/t00008.md | 2 +- docs/test_cases/t00008_class.svg | 82 ++-- docs/test_cases/t00008_class_mermaid.svg | 82 ++-- docs/test_cases/t00009.md | 2 +- docs/test_cases/t00009_class.svg | 38 +- docs/test_cases/t00009_class_mermaid.svg | 30 +- docs/test_cases/t00010.md | 2 +- docs/test_cases/t00010_class.svg | 38 +- docs/test_cases/t00010_class_mermaid.svg | 24 +- docs/test_cases/t00011.md | 2 +- docs/test_cases/t00011_class.svg | 30 +- docs/test_cases/t00011_class_mermaid.svg | 22 +- docs/test_cases/t00012.md | 2 +- docs/test_cases/t00012_class.svg | 76 ++-- docs/test_cases/t00012_class_mermaid.svg | 50 ++- docs/test_cases/t00013.md | 2 +- docs/test_cases/t00013_class.svg | 130 +++--- docs/test_cases/t00013_class_mermaid.svg | 104 +++-- docs/test_cases/t00014.md | 2 +- docs/test_cases/t00014_class.svg | 150 +++---- docs/test_cases/t00014_class_mermaid.svg | 140 +++--- docs/test_cases/t00015.md | 2 +- docs/test_cases/t00015_class.svg | 22 +- docs/test_cases/t00015_class_mermaid.svg | 12 +- docs/test_cases/t00016.md | 2 +- docs/test_cases/t00016_class.svg | 26 +- docs/test_cases/t00016_class_mermaid.svg | 44 +- docs/test_cases/t00017.md | 2 +- docs/test_cases/t00017_class.svg | 70 +-- docs/test_cases/t00017_class_mermaid.svg | 26 +- docs/test_cases/t00018.md | 2 +- docs/test_cases/t00018_class.svg | 66 +-- docs/test_cases/t00018_class_mermaid.svg | 42 +- docs/test_cases/t00019.md | 2 +- docs/test_cases/t00019_class.svg | 90 ++-- docs/test_cases/t00019_class_mermaid.svg | 102 +++-- docs/test_cases/t00020.md | 2 +- docs/test_cases/t00020_class.svg | 94 ++-- docs/test_cases/t00020_class_mermaid.svg | 232 +++++----- docs/test_cases/t00021.md | 2 +- docs/test_cases/t00021_class.svg | 82 ++-- docs/test_cases/t00021_class_mermaid.svg | 292 ++++++------ docs/test_cases/t00022.md | 2 +- docs/test_cases/t00022_class.svg | 42 +- docs/test_cases/t00022_class_mermaid.svg | 8 +- docs/test_cases/t00023.md | 2 +- docs/test_cases/t00023_class.svg | 54 +-- docs/test_cases/t00023_class_mermaid.svg | 28 +- docs/test_cases/t00024.md | 2 +- docs/test_cases/t00024_class.svg | 62 +-- docs/test_cases/t00024_class_mermaid.svg | 10 +- docs/test_cases/t00025.md | 2 +- docs/test_cases/t00025_class.svg | 66 +-- docs/test_cases/t00025_class_mermaid.svg | 38 +- docs/test_cases/t00026.md | 2 +- docs/test_cases/t00026_class.svg | 82 ++-- docs/test_cases/t00026_class_mermaid.svg | 76 ++-- docs/test_cases/t00027.md | 2 +- docs/test_cases/t00027_class.svg | 98 ++--- docs/test_cases/t00027_class_mermaid.svg | 96 ++-- docs/test_cases/t00028.md | 2 +- docs/test_cases/t00028_class.svg | 88 ++-- docs/test_cases/t00028_class_mermaid.svg | 100 ++--- docs/test_cases/t00029.md | 2 +- docs/test_cases/t00029_class.svg | 50 +-- docs/test_cases/t00029_class_mermaid.svg | 42 +- docs/test_cases/t00030.md | 2 +- docs/test_cases/t00030_class.svg | 46 +- docs/test_cases/t00030_class_mermaid.svg | 14 +- docs/test_cases/t00031.md | 2 +- docs/test_cases/t00031_class.svg | 56 +-- docs/test_cases/t00031_class_mermaid.svg | 60 +-- docs/test_cases/t00032.md | 2 +- docs/test_cases/t00032_class.svg | 54 +-- docs/test_cases/t00032_class_mermaid.svg | 24 +- docs/test_cases/t00033.md | 2 +- docs/test_cases/t00033_class.svg | 54 +-- docs/test_cases/t00033_class_mermaid.svg | 54 ++- docs/test_cases/t00034.md | 2 +- docs/test_cases/t00034_class.svg | 46 +- docs/test_cases/t00034_class_mermaid.svg | 56 +-- docs/test_cases/t00035.md | 2 +- docs/test_cases/t00035_class.svg | 22 +- docs/test_cases/t00035_class_mermaid.svg | 12 +- docs/test_cases/t00036.md | 2 +- docs/test_cases/t00036_class.svg | 40 +- docs/test_cases/t00036_class_mermaid.svg | 38 +- docs/test_cases/t00037.md | 2 +- docs/test_cases/t00037_class.svg | 58 +-- docs/test_cases/t00037_class_mermaid.svg | 10 +- docs/test_cases/t00038.md | 2 +- docs/test_cases/t00038_class.svg | 54 +-- docs/test_cases/t00038_class_mermaid.svg | 158 ++++--- docs/test_cases/t00039.md | 2 +- docs/test_cases/t00039_class.svg | 78 ++-- docs/test_cases/t00039_class_mermaid.svg | 30 +- docs/test_cases/t00040.md | 2 +- docs/test_cases/t00040_class.svg | 38 +- docs/test_cases/t00040_class_mermaid.svg | 10 +- docs/test_cases/t00041.md | 2 +- docs/test_cases/t00041_class.svg | 58 +-- docs/test_cases/t00041_class_mermaid.svg | 20 +- docs/test_cases/t00042.md | 2 +- docs/test_cases/t00042_class.svg | 42 +- docs/test_cases/t00042_class_mermaid.svg | 38 +- docs/test_cases/t00043.md | 2 +- docs/test_cases/t00043_class.svg | 90 ++-- docs/test_cases/t00043_class_mermaid.svg | 84 ++-- docs/test_cases/t00044.md | 2 +- docs/test_cases/t00044_class.svg | 42 +- docs/test_cases/t00044_class_mermaid.svg | 46 +- docs/test_cases/t00045.md | 2 +- docs/test_cases/t00045_class.svg | 74 ++-- docs/test_cases/t00045_class_mermaid.svg | 38 +- docs/test_cases/t00046.md | 2 +- docs/test_cases/t00046_class.svg | 66 +-- docs/test_cases/t00046_class_mermaid.svg | 26 +- docs/test_cases/t00047.md | 2 +- docs/test_cases/t00047_class.svg | 18 +- docs/test_cases/t00047_class_mermaid.svg | 28 +- docs/test_cases/t00048.md | 2 +- docs/test_cases/t00048_class.svg | 74 ++-- docs/test_cases/t00048_class_mermaid.svg | 14 +- docs/test_cases/t00049.md | 2 +- docs/test_cases/t00049_class.svg | 50 +-- docs/test_cases/t00049_class_mermaid.svg | 30 +- docs/test_cases/t00050.md | 30 +- docs/test_cases/t00050_class.svg | 70 +-- docs/test_cases/t00050_class_mermaid.svg | 313 ++++++++++++- docs/test_cases/t00051.md | 2 +- docs/test_cases/t00051_class.svg | 82 ++-- docs/test_cases/t00051_class_mermaid.svg | 72 +-- docs/test_cases/t00052.md | 2 +- docs/test_cases/t00052_class.svg | 42 +- docs/test_cases/t00052_class_mermaid.svg | 26 +- docs/test_cases/t00053.md | 2 +- docs/test_cases/t00053_class.svg | 70 +-- docs/test_cases/t00053_class_mermaid.svg | 72 +-- docs/test_cases/t00054.md | 2 +- docs/test_cases/t00054_class.svg | 78 ++-- docs/test_cases/t00054_class_mermaid.svg | 72 +-- docs/test_cases/t00055.md | 2 +- docs/test_cases/t00055_class.svg | 42 +- docs/test_cases/t00055_class_mermaid.svg | 22 +- docs/test_cases/t00056.md | 2 +- docs/test_cases/t00056_class.svg | 94 ++-- docs/test_cases/t00056_class_mermaid.svg | 30 +- docs/test_cases/t00057.md | 2 +- docs/test_cases/t00057_class.svg | 126 +++--- docs/test_cases/t00057_class_mermaid.svg | 22 +- docs/test_cases/t00058.md | 2 +- docs/test_cases/t00058_class.svg | 54 +-- docs/test_cases/t00058_class_mermaid.svg | 42 +- docs/test_cases/t00059.md | 2 +- docs/test_cases/t00059_class.svg | 94 ++-- docs/test_cases/t00059_class_mermaid.svg | 160 +++---- docs/test_cases/t00060.md | 2 +- docs/test_cases/t00060_class.svg | 38 +- docs/test_cases/t00060_class_mermaid.svg | 14 +- docs/test_cases/t00061.md | 2 +- docs/test_cases/t00061_class.svg | 6 +- docs/test_cases/t00061_class_mermaid.svg | 4 +- docs/test_cases/t00062.md | 2 +- docs/test_cases/t00062_class.svg | 198 ++++----- docs/test_cases/t00062_class_mermaid.svg | 172 +++++--- docs/test_cases/t00063.md | 2 +- docs/test_cases/t00063_class.svg | 6 +- docs/test_cases/t00063_class_mermaid.svg | 4 +- docs/test_cases/t00064.md | 2 +- docs/test_cases/t00064_class.svg | 118 ++--- docs/test_cases/t00064_class_mermaid.svg | 208 +++++---- docs/test_cases/t00065.md | 2 +- docs/test_cases/t00065_class.svg | 102 ++--- docs/test_cases/t00065_class_mermaid.svg | 142 +++--- docs/test_cases/t00066.md | 2 +- docs/test_cases/t00066_class.svg | 126 +++--- docs/test_cases/t00066_class_mermaid.svg | 24 +- docs/test_cases/t00067.md | 2 +- docs/test_cases/t00067_class.svg | 86 ++-- docs/test_cases/t00067_class_mermaid.svg | 12 +- docs/test_cases/t20001.md | 7 +- docs/test_cases/t20001_sequence.svg | 74 ++-- docs/test_cases/t20001_sequence_mermaid.svg | 26 +- docs/test_cases/t20002.md | 2 +- docs/test_cases/t20002_sequence.svg | 48 +- docs/test_cases/t20002_sequence_mermaid.svg | 2 +- docs/test_cases/t20003.md | 2 +- docs/test_cases/t20003_sequence.svg | 48 +- docs/test_cases/t20003_sequence_mermaid.svg | 2 +- docs/test_cases/t20004.md | 2 +- docs/test_cases/t20004_sequence.svg | 120 ++--- docs/test_cases/t20004_sequence_mermaid.svg | 2 +- docs/test_cases/t20005.md | 2 +- docs/test_cases/t20005_sequence.svg | 36 +- docs/test_cases/t20005_sequence_mermaid.svg | 2 +- docs/test_cases/t20006.md | 2 +- docs/test_cases/t20006_sequence.svg | 162 +++---- docs/test_cases/t20006_sequence_mermaid.svg | 2 +- docs/test_cases/t20007.md | 2 +- docs/test_cases/t20007_sequence.svg | 48 +- docs/test_cases/t20007_sequence_mermaid.svg | 2 +- docs/test_cases/t20008.md | 2 +- docs/test_cases/t20008_sequence.svg | 84 ++-- docs/test_cases/t20008_sequence_mermaid.svg | 2 +- docs/test_cases/t20009.md | 2 +- docs/test_cases/t20009_sequence.svg | 84 ++-- docs/test_cases/t20009_sequence_mermaid.svg | 2 +- docs/test_cases/t20010.md | 2 +- docs/test_cases/t20010_sequence.svg | 72 +-- docs/test_cases/t20010_sequence_mermaid.svg | 2 +- docs/test_cases/t20011.md | 2 +- docs/test_cases/t20011_sequence.svg | 72 +-- docs/test_cases/t20011_sequence_mermaid.svg | 2 +- docs/test_cases/t20012.md | 2 +- docs/test_cases/t20012_sequence.svg | 198 ++++----- docs/test_cases/t20012_sequence_mermaid.svg | 2 +- docs/test_cases/t20013.md | 2 +- docs/test_cases/t20013_sequence.svg | 60 +-- docs/test_cases/t20013_sequence_mermaid.svg | 2 +- docs/test_cases/t20014.md | 2 +- docs/test_cases/t20014_sequence.svg | 72 +-- docs/test_cases/t20014_sequence_mermaid.svg | 2 +- docs/test_cases/t20015.md | 2 +- docs/test_cases/t20015_sequence.svg | 24 +- docs/test_cases/t20015_sequence_mermaid.svg | 2 +- docs/test_cases/t20016.md | 2 +- docs/test_cases/t20016_sequence.svg | 48 +- docs/test_cases/t20016_sequence_mermaid.svg | 2 +- docs/test_cases/t20017.md | 2 +- docs/test_cases/t20017_sequence.svg | 48 +- docs/test_cases/t20017_sequence_mermaid.svg | 2 +- docs/test_cases/t20018.md | 2 +- docs/test_cases/t20018_sequence.svg | 96 ++-- docs/test_cases/t20018_sequence_mermaid.svg | 2 +- docs/test_cases/t20019.md | 2 +- docs/test_cases/t20019_sequence.svg | 84 ++-- docs/test_cases/t20019_sequence_mermaid.svg | 2 +- docs/test_cases/t20020.md | 2 +- docs/test_cases/t20020_sequence.svg | 124 +++--- docs/test_cases/t20020_sequence_mermaid.svg | 2 +- docs/test_cases/t20021.md | 2 +- docs/test_cases/t20021_sequence.svg | 106 ++--- docs/test_cases/t20021_sequence_mermaid.svg | 2 +- docs/test_cases/t20022.md | 2 +- docs/test_cases/t20022_sequence.svg | 42 +- docs/test_cases/t20022_sequence_mermaid.svg | 2 +- docs/test_cases/t20023.md | 2 +- docs/test_cases/t20023_sequence.svg | 50 +-- docs/test_cases/t20023_sequence_mermaid.svg | 2 +- docs/test_cases/t20024.md | 2 +- docs/test_cases/t20024_sequence.svg | 88 ++-- docs/test_cases/t20024_sequence_mermaid.svg | 2 +- docs/test_cases/t20025.md | 2 +- docs/test_cases/t20025_sequence.svg | 42 +- docs/test_cases/t20025_sequence_mermaid.svg | 2 +- docs/test_cases/t20026.md | 2 +- docs/test_cases/t20026_sequence.svg | 24 +- docs/test_cases/t20026_sequence_mermaid.svg | 2 +- docs/test_cases/t20027.md | 2 +- docs/test_cases/t20027_sequence.svg | 24 +- docs/test_cases/t20027_sequence_mermaid.svg | 2 +- docs/test_cases/t20028.md | 2 +- docs/test_cases/t20028_sequence.svg | 44 +- docs/test_cases/t20028_sequence_mermaid.svg | 2 +- docs/test_cases/t20029.md | 2 +- docs/test_cases/t20029_sequence.svg | 80 ++-- docs/test_cases/t20029_sequence_mermaid.svg | 2 +- docs/test_cases/t20030.md | 2 +- docs/test_cases/t20030_sequence.svg | 112 ++--- docs/test_cases/t20030_sequence_mermaid.svg | 2 +- docs/test_cases/t20031.md | 2 +- docs/test_cases/t20031_sequence.svg | 58 +-- docs/test_cases/t20031_sequence_mermaid.svg | 2 +- docs/test_cases/t20032.md | 2 +- docs/test_cases/t20032_sequence.svg | 60 +-- docs/test_cases/t20032_sequence_mermaid.svg | 2 +- docs/test_cases/t20033.md | 2 +- docs/test_cases/t20033_sequence.svg | 128 +++--- docs/test_cases/t20033_sequence_mermaid.svg | 2 +- docs/test_cases/t20034.md | 2 +- docs/test_cases/t20034_sequence.svg | 76 ++-- docs/test_cases/t20034_sequence_mermaid.svg | 2 +- docs/test_cases/t20035.md | 2 +- docs/test_cases/t20035_sequence.svg | 32 +- docs/test_cases/t20035_sequence_mermaid.svg | 2 +- docs/test_cases/t20036.md | 2 +- docs/test_cases/t20036_sequence.svg | 64 +-- docs/test_cases/t20036_sequence_mermaid.svg | 2 +- docs/test_cases/t30001.md | 14 +- docs/test_cases/t30001_package.svg | 48 +- docs/test_cases/t30001_package_mermaid.svg | 211 ++++++++- docs/test_cases/t30002.md | 2 +- docs/test_cases/t30002_package.svg | 94 ++-- docs/test_cases/t30002_package_mermaid.svg | 463 +++++++++++++++++++- docs/test_cases/t30003.md | 2 +- docs/test_cases/t30003_package.svg | 26 +- docs/test_cases/t30003_package_mermaid.svg | 114 ++++- docs/test_cases/t30004.md | 2 +- docs/test_cases/t30004_package.svg | 30 +- docs/test_cases/t30004_package_mermaid.svg | 179 +++++++- docs/test_cases/t30005.md | 2 +- docs/test_cases/t30005_package.svg | 38 +- docs/test_cases/t30005_package_mermaid.svg | 147 ++++++- docs/test_cases/t30006.md | 2 +- docs/test_cases/t30006_package.svg | 16 +- docs/test_cases/t30006_package_mermaid.svg | 107 ++++- docs/test_cases/t30007.md | 2 +- docs/test_cases/t30007_package.svg | 20 +- docs/test_cases/t30007_package_mermaid.svg | 118 ++++- docs/test_cases/t30008.md | 2 +- docs/test_cases/t30008_package.svg | 34 +- docs/test_cases/t30008_package_mermaid.svg | 177 +++++++- docs/test_cases/t30009.md | 2 +- docs/test_cases/t30009_package.svg | 42 +- docs/test_cases/t30009_package_mermaid.svg | 155 ++++++- docs/test_cases/t30010.md | 2 +- docs/test_cases/t30010_package_mermaid.svg | 139 +++++- docs/test_cases/t30011.md | 2 +- docs/test_cases/t30011_package_mermaid.svg | 139 +++++- docs/test_cases/t40001.md | 6 +- docs/test_cases/t40001_include.svg | 30 +- docs/test_cases/t40001_include_mermaid.svg | 238 +++++++++- docs/test_cases/t40002.md | 2 +- docs/test_cases/t40002_include.svg | 34 +- docs/test_cases/t40002_include_mermaid.svg | 209 ++++++++- docs/test_cases/t40003.md | 2 +- docs/test_cases/t40003_include.svg | 50 +-- docs/test_cases/t40003_include_mermaid.svg | 291 +++++++++++- docs/test_cases/t90000.md | 2 +- docs/test_cases/t90000_class_mermaid.svg | 2 +- util/format_svg.py | 9 +- 349 files changed, 9257 insertions(+), 5799 deletions(-) diff --git a/docs/test_cases/t00002.md b/docs/test_cases/t00002.md index 07593295..c48273ae 100644 --- a/docs/test_cases/t00002.md +++ b/docs/test_cases/t00002.md @@ -22,6 +22,11 @@ diagrams: note right of {{ alias("D") }} {{ comment("D").text }} end note + mermaid: + after: + - '{% set e=element("A") %} note for {{ e.alias }} "{{ trim(e.comment.brief.0) }}"' + - '{% set e=element("clanguml::t00002::B") %} note for {{ e.alias }} "{{ trim(e.comment.brief.0) }}"' + - 'note for {{ alias("D") }} "{{ comment("D").text }}"' ``` ## Source code File t00002.cc @@ -620,7 +625,7 @@ private: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00002_class.svg b/docs/test_cases/t00002_class.svg index e9cffe1c..19c4b806 100644 --- a/docs/test_cases/t00002_class.svg +++ b/docs/test_cases/t00002_class.svg @@ -1,6 +1,6 @@ - + @@ -9,123 +9,123 @@ - - + + A - + - + foo_a() = 0 : void - + - + foo_c() = 0 : void - - + + B - + - + foo_a() : void - - + + C - + - + foo_c() : void - - + + D - + - + foo_a() : void - + - + foo_c() : void - + - + as : std::vector<A *> - - + + E - + - + foo_a() : void - + - + foo_c() : void - + - + as : std::vector<A *> - + This is class A - + This is class B - + This is class D diff --git a/docs/test_cases/t00002_class_mermaid.svg b/docs/test_cases/t00002_class_mermaid.svg index c2e3f998..d7463afe 100644 --- a/docs/test_cases/t00002_class_mermaid.svg +++ b/docs/test_cases/t00002_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,14 +50,17 @@ - - - - - - - - + + + + + + + + + + + @@ -78,7 +81,7 @@ - +
@@ -107,7 +110,7 @@ - +
@@ -136,9 +139,36 @@ + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
- + @@ -167,7 +197,7 @@ - + @@ -191,7 +221,7 @@ - + @@ -215,7 +245,7 @@ - + @@ -249,7 +279,7 @@ - + @@ -283,6 +313,39 @@ + + + + + +
+ This is class A +
+
+
+
+ + + + + +
+ This is class B +
+
+
+
+ + + + + +
+
This is class D
which is a little like B
and a little like C
+
+
+
+
diff --git a/docs/test_cases/t00003.md b/docs/test_cases/t00003.md index 67f9cd09..8c5ae9f0 100644 --- a/docs/test_cases/t00003.md +++ b/docs/test_cases/t00003.md @@ -833,7 +833,7 @@ int A::static_int = 1; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00003_class.svg b/docs/test_cases/t00003_class.svg index b5e80234..1e1531c2 100644 --- a/docs/test_cases/t00003_class.svg +++ b/docs/test_cases/t00003_class.svg @@ -1,6 +1,6 @@ - + @@ -9,227 +9,227 @@ - - + + A - + - + A() = default : void - + - + A(int i) : void - + - + A(A &&) = default : void - + - + A(const A &) = deleted : void A<T>(T t) : void - + - + ~A() = default : void - + - + operator=(A && other) noexcept : A & - + - + operator=(A & other) noexcept : A & - + - + operator++() : A & - + - + auto_method() : int - + - + basic_method() : void - + - + const_method() const : void - + - + create_from_int(int i) : A - + - + default_int(int i = 12) : int - + - + default_string(int i, std::string s = "abc") : std::string - + - + double_int(const int i) : int - + - + private_method() : void - + - + protected_method() : void - + - + size() constexpr const : std::size_t - + - + static_method() : int - + - + sum(const double a, const double b) : int - + - + a_ : int - + - + auto_member : const unsigned long - + - + b_ : int - + - + c_ : int - + - + compare : std::function<bool (const int)> - + - + private_member : int - + - + protected_member : int - + - + public_member : int - + - + static_const_int : const int - + - + static_int : int diff --git a/docs/test_cases/t00003_class_mermaid.svg b/docs/test_cases/t00003_class_mermaid.svg index 5e91cf2e..4594d1f7 100644 --- a/docs/test_cases/t00003_class_mermaid.svg +++ b/docs/test_cases/t00003_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -52,7 +52,7 @@ - + @@ -118,9 +118,9 @@ +static_int : int
- +
- +A() : void + +A() : [default] void
@@ -128,9 +128,9 @@ +A(int i) : void
- +
- +A(A &&) : void + +A(A &&) : [default] void
@@ -143,9 +143,9 @@ +A(T t) : void - +
- +~A() : void + +~A() : [default] void
@@ -173,9 +173,9 @@ +basic_method() : void - +
- +const_method() : void + +const_method() : [const] void
@@ -208,9 +208,9 @@ #protected_method() : void - +
- +size() : std::size_t + +size() : [const,constexpr] std::size_t
diff --git a/docs/test_cases/t00004.md b/docs/test_cases/t00004.md index 712fc9c6..c42e3995 100644 --- a/docs/test_cases/t00004.md +++ b/docs/test_cases/t00004.md @@ -530,7 +530,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00004_class.svg b/docs/test_cases/t00004_class.svg index d2e512cb..e276f324 100644 --- a/docs/test_cases/t00004_class.svg +++ b/docs/test_cases/t00004_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + B - - + + B::AA @@ -28,38 +28,38 @@ AA_3 - - + + A - + - + foo() const : void - + - + foo2() const : void - - + + A::AA - - + + A::AA::Lights @@ -69,16 +69,16 @@ Red - - + + A::AA::AAA - - + + C::B @@ -87,8 +87,8 @@ - - + + C @@ -97,38 +97,38 @@ - + - + b_int : B<int> - + - + t : T - - + + C::AA - - + + C::AA::AAA - - + + C::AA::CCC @@ -137,8 +137,8 @@ CCC_2 - - + + C::B @@ -147,15 +147,15 @@ - + - + b : V - - + + C::CC @@ -164,16 +164,16 @@ CC_2 - - + + detail::D - - + + detail::D::AA @@ -183,8 +183,8 @@ AA_3 - - + + detail::D::DD diff --git a/docs/test_cases/t00004_class_mermaid.svg b/docs/test_cases/t00004_class_mermaid.svg index d3147d30..3df6e59a 100644 --- a/docs/test_cases/t00004_class_mermaid.svg +++ b/docs/test_cases/t00004_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,71 +50,77 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - + -
- -
-
-
-
- - -
- [nested] +
- + -
- -
-
-
-
- - -
- [nested] +
- +
- + + +
- + + + +
+ + + +
+
+
+
+ + + +
+ + + +
+
+
+
+
@@ -125,72 +131,78 @@ - - - + + +
- [nested] +
- - - + + +
- [nested] +
- + -
- -
-
-
-
- - -
- [nested] +
- + -
- -
-
-
-
- - - -
- -
-
-
-
- - -
- [nested] + + +
+
+
+
+ + + +
+ + + +
+
+
+
+ + + +
+ + + +
+
+
+
+ + + +
+ +
@@ -198,7 +210,7 @@
- + @@ -217,15 +229,15 @@ - + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -233,17 +245,17 @@ B::AA
- +
AA_1
- +
AA_2
- +
AA_3
@@ -251,11 +263,11 @@
- + - - - + + +
@@ -267,20 +279,20 @@ A
- +
- +foo() : void + +foo() : [const] void
- +
- +foo2() : void + +foo2() : [const] void
- + @@ -299,15 +311,15 @@ - + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -315,17 +327,17 @@ A::AA::Lights - +
Green
- +
Yellow
- +
Red
@@ -333,7 +345,7 @@
- + @@ -352,7 +364,7 @@ - + @@ -371,7 +383,7 @@ - + @@ -400,7 +412,7 @@ - + @@ -419,7 +431,7 @@ - + @@ -438,15 +450,15 @@ - + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -454,12 +466,12 @@ C::AA::CCC - +
CCC_1
- +
CCC_2
@@ -467,7 +479,7 @@
- + @@ -491,15 +503,15 @@ - + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -507,12 +519,12 @@ C::CC - +
CC_1
- +
CC_2
@@ -520,7 +532,7 @@
- + @@ -539,15 +551,15 @@ - + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -555,17 +567,17 @@ detail::D::AA - +
AA_1
- +
AA_2
- +
AA_3
@@ -573,7 +585,7 @@
- + diff --git a/docs/test_cases/t00005.md b/docs/test_cases/t00005.md index fe152111..50b87e4b 100644 --- a/docs/test_cases/t00005.md +++ b/docs/test_cases/t00005.md @@ -520,7 +520,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00005_class.svg b/docs/test_cases/t00005_class.svg index 6070b1dd..75ed326f 100644 --- a/docs/test_cases/t00005_class.svg +++ b/docs/test_cases/t00005_class.svg @@ -1,6 +1,6 @@ - + @@ -9,205 +9,205 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + a : A - + - + b : B * - + - + c : C & - + - + d : const D * - + - + e : const E & - + - + f : F && - + - + g : G ** - + - + h : H *** - + - + i : I *& - + - + j : volatile J * - + - + k : K * - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00005_class_mermaid.svg b/docs/test_cases/t00005_class_mermaid.svg index 7643ce4c..d24eed87 100644 --- a/docs/test_cases/t00005_class_mermaid.svg +++ b/docs/test_cases/t00005_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -186,7 +186,7 @@ - + @@ -205,7 +205,7 @@ - + @@ -224,7 +224,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -300,7 +300,7 @@ - + @@ -319,7 +319,7 @@ - + @@ -338,7 +338,7 @@ - + @@ -357,7 +357,7 @@ - + @@ -376,7 +376,7 @@ - + @@ -395,7 +395,7 @@ - + diff --git a/docs/test_cases/t00006.md b/docs/test_cases/t00006.md index 7f90693e..27c44d24 100644 --- a/docs/test_cases/t00006.md +++ b/docs/test_cases/t00006.md @@ -701,7 +701,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00006_class.svg b/docs/test_cases/t00006_class.svg index fcf595a4..7195a8d1 100644 --- a/docs/test_cases/t00006_class.svg +++ b/docs/test_cases/t00006_class.svg @@ -1,6 +1,6 @@ - + @@ -9,136 +9,136 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + L - - + + M - - + + N - - + + NN - - + + NNN - - + + custom_container @@ -147,15 +147,15 @@ - + - + data : std::vector<T> - - + + custom_container @@ -164,103 +164,103 @@ - - + + R - + - + a : std::vector<A> - + - + b : std::vector<B *> - + - + c : std::map<int,C> - + - + d : std::map<int,D *> - + - + e : custom_container<E> - + - + f : std::vector<std::vector<F>> - + - + g : std::map<int,std::vector<G *>> - + - + h : std::array<H,10> - + - + i : std::array<I *,5> - + - + j : J[10] - + - + k : K *[20] - + - + lm : std::vector<std::pair<L,M>> - + - + ns : std::tuple<N,NN,NNN> diff --git a/docs/test_cases/t00006_class_mermaid.svg b/docs/test_cases/t00006_class_mermaid.svg index 3c8f0c9b..5926bc36 100644 --- a/docs/test_cases/t00006_class_mermaid.svg +++ b/docs/test_cases/t00006_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -70,20 +70,24 @@ - +
- + + +
- +
- + + +
@@ -266,7 +270,7 @@
- + @@ -285,7 +289,7 @@
- + @@ -304,7 +308,7 @@
- + @@ -323,7 +327,7 @@ - + @@ -342,7 +346,7 @@ - + @@ -361,7 +365,7 @@ - + @@ -380,7 +384,7 @@ - + @@ -399,7 +403,7 @@ - + @@ -418,7 +422,7 @@ - + @@ -437,7 +441,7 @@ - + @@ -456,7 +460,7 @@ - + @@ -475,7 +479,7 @@ - + @@ -494,7 +498,7 @@ - + @@ -513,7 +517,7 @@ - + @@ -532,7 +536,7 @@ - + @@ -551,7 +555,7 @@ - + @@ -570,7 +574,7 @@ - + @@ -594,7 +598,7 @@ - + @@ -613,7 +617,7 @@ - + diff --git a/docs/test_cases/t00007.md b/docs/test_cases/t00007.md index 410b5a7b..1710a4c5 100644 --- a/docs/test_cases/t00007.md +++ b/docs/test_cases/t00007.md @@ -174,7 +174,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00007_class.svg b/docs/test_cases/t00007_class.svg index b902e5d7..068bb90a 100644 --- a/docs/test_cases/t00007_class.svg +++ b/docs/test_cases/t00007_class.svg @@ -1,6 +1,6 @@ - + @@ -9,57 +9,57 @@ - - + + A - - + + B - - + + C - - + + R - + - + a : std::unique_ptr<A> - + - + b : std::shared_ptr<B> - + - + c : std::weak_ptr<C> diff --git a/docs/test_cases/t00007_class_mermaid.svg b/docs/test_cases/t00007_class_mermaid.svg index 182b5119..ab6659d1 100644 --- a/docs/test_cases/t00007_class_mermaid.svg +++ b/docs/test_cases/t00007_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -147,7 +147,7 @@ - + diff --git a/docs/test_cases/t00008.md b/docs/test_cases/t00008.md index 50bf46b6..31dfe453 100644 --- a/docs/test_cases/t00008.md +++ b/docs/test_cases/t00008.md @@ -563,7 +563,7 @@ template <> struct E::nested_template { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00008_class.svg b/docs/test_cases/t00008_class.svg index 192e051d..7c614411 100644 --- a/docs/test_cases/t00008_class.svg +++ b/docs/test_cases/t00008_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,50 +19,50 @@ - + - + comparator : CMP - + - + ints : std::array<int,N> - + - + pointer : T * - + - + reference : T & - + - + value : T - + - + values : std::vector<P> - - + + Vector @@ -71,15 +71,15 @@ - + - + values : std::vector<T> - - + + B @@ -88,15 +88,15 @@ - + - + template_template : C<T> - - + + B @@ -105,8 +105,8 @@ - - + + D @@ -115,31 +115,31 @@ D<Items...>(std::tuple<Items...> *) : void - + - + add(int i) : void - + - + ints : B<int,Vector> - - + + E - - + + E::nested_template @@ -147,16 +147,16 @@ ET - + - + get(ET * d) : DT * - - + + E::nested_template @@ -164,11 +164,11 @@ char - + - + getDecl(char * c) : DeclType * diff --git a/docs/test_cases/t00008_class_mermaid.svg b/docs/test_cases/t00008_class_mermaid.svg index 51d49a31..cea158c5 100644 --- a/docs/test_cases/t00008_class_mermaid.svg +++ b/docs/test_cases/t00008_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,18 +50,20 @@ - + - - - + + + - +
- + + +
@@ -77,40 +79,42 @@
- - - -
- - [nested] - -
-
-
-
- - - -
- - [nested] - -
-
-
-
- +
- + + + +
+
+
+
+ + + +
+ + + +
+
+
+
+ + + +
+ + +
- + @@ -159,7 +163,7 @@
- + @@ -183,7 +187,7 @@
- + @@ -207,7 +211,7 @@ - + @@ -226,7 +230,7 @@ - + @@ -260,7 +264,7 @@ - + @@ -279,7 +283,7 @@ - + @@ -303,7 +307,7 @@ - + diff --git a/docs/test_cases/t00009.md b/docs/test_cases/t00009.md index d6360228..dc54e8ec 100644 --- a/docs/test_cases/t00009.md +++ b/docs/test_cases/t00009.md @@ -245,7 +245,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00009_class.svg b/docs/test_cases/t00009_class.svg index 72c861d5..35e7fe25 100644 --- a/docs/test_cases/t00009_class.svg +++ b/docs/test_cases/t00009_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,15 +19,15 @@ - + - + value : T - - + + A @@ -36,8 +36,8 @@ - - + + A @@ -46,8 +46,8 @@ - - + + A @@ -56,33 +56,33 @@ - - + + B - + - + aint : A<int> - + - + astring : A<std::string> * - + - + avector : A<std::vector<std::string>> & diff --git a/docs/test_cases/t00009_class_mermaid.svg b/docs/test_cases/t00009_class_mermaid.svg index baab15d2..49cb1ab8 100644 --- a/docs/test_cases/t00009_class_mermaid.svg +++ b/docs/test_cases/t00009_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -58,29 +58,35 @@ - +
- + + +
- +
- + + +
- +
- + + +
@@ -120,7 +126,7 @@
- + @@ -144,7 +150,7 @@
- + @@ -163,7 +169,7 @@
- + @@ -182,7 +188,7 @@ - + @@ -201,7 +207,7 @@ - + diff --git a/docs/test_cases/t00010.md b/docs/test_cases/t00010.md index cefeaf32..24296f4e 100644 --- a/docs/test_cases/t00010.md +++ b/docs/test_cases/t00010.md @@ -255,7 +255,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00010_class.svg b/docs/test_cases/t00010_class.svg index 1f81df81..b1af3869 100644 --- a/docs/test_cases/t00010_class.svg +++ b/docs/test_cases/t00010_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,22 +19,22 @@ - + - + first : T - + - + second : P - - + + A @@ -43,8 +43,8 @@ - - + + B @@ -53,15 +53,15 @@ - + - + astring : A<T,std::string> - - + + B @@ -70,19 +70,19 @@ - - + + C - + - + aintstring : B<int> diff --git a/docs/test_cases/t00010_class_mermaid.svg b/docs/test_cases/t00010_class_mermaid.svg index ca38fd41..1c45921a 100644 --- a/docs/test_cases/t00010_class_mermaid.svg +++ b/docs/test_cases/t00010_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -56,11 +56,13 @@ - +
- + + +
@@ -76,11 +78,13 @@
- +
- + + +
@@ -98,7 +102,7 @@
- + @@ -127,7 +131,7 @@
- + @@ -146,7 +150,7 @@
- + @@ -170,7 +174,7 @@ - + @@ -189,7 +193,7 @@ - + diff --git a/docs/test_cases/t00011.md b/docs/test_cases/t00011.md index 5de47443..508a7018 100644 --- a/docs/test_cases/t00011.md +++ b/docs/test_cases/t00011.md @@ -214,7 +214,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00011_class.svg b/docs/test_cases/t00011_class.svg index 3f09cc83..b0fda56a 100644 --- a/docs/test_cases/t00011_class.svg +++ b/docs/test_cases/t00011_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + D @@ -19,48 +19,48 @@ - + - + value : T - - + + A - + - + foo() : void - - + + B - + - + foo() : void - + - + m_a : A * diff --git a/docs/test_cases/t00011_class_mermaid.svg b/docs/test_cases/t00011_class_mermaid.svg index 6ce25e26..511eef8e 100644 --- a/docs/test_cases/t00011_class_mermaid.svg +++ b/docs/test_cases/t00011_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,22 +50,22 @@ - - + + - - - + + +
- +<> + +[friend]
- +
@@ -78,7 +78,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -126,7 +126,7 @@ - + diff --git a/docs/test_cases/t00012.md b/docs/test_cases/t00012.md index 5b9c0bf6..5a409d41 100644 --- a/docs/test_cases/t00012.md +++ b/docs/test_cases/t00012.md @@ -556,7 +556,7 @@ class R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00012_class.svg b/docs/test_cases/t00012_class.svg index e1950354..edab9d6d 100644 --- a/docs/test_cases/t00012_class.svg +++ b/docs/test_cases/t00012_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,22 +19,22 @@ - + - + value : T - + - + values : std::variant<Ts...> - - + + B @@ -43,15 +43,15 @@ - + - + ints : std::array<int,sizeof...(Is)> - - + + C @@ -60,15 +60,15 @@ - + - + ints : std::array<T,sizeof...(Is)> - - + + A @@ -77,8 +77,8 @@ - - + + A @@ -87,8 +87,8 @@ - - + + B @@ -97,8 +97,8 @@ - - + + B @@ -107,8 +107,8 @@ - - + + C @@ -117,50 +117,50 @@ - - + + R - + - + a1 : A<int,std::string,float> - + - + a2 : A<int,std::string,bool> - + - + b1 : B<3,2,1> - + - + b2 : B<1,1,1,1> - + - + c1 : C<std::map<int,std::vector<std::vector<std::vector<std::string>>>>,3,3,3> - + Long template annotation diff --git a/docs/test_cases/t00012_class_mermaid.svg b/docs/test_cases/t00012_class_mermaid.svg index 6f87bda8..a0652127 100644 --- a/docs/test_cases/t00012_class_mermaid.svg +++ b/docs/test_cases/t00012_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -62,47 +62,57 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
@@ -164,7 +174,7 @@
- + @@ -193,7 +203,7 @@
- + @@ -217,7 +227,7 @@
- + @@ -241,7 +251,7 @@ - + @@ -260,7 +270,7 @@ - + @@ -279,7 +289,7 @@ - + @@ -298,7 +308,7 @@ - + @@ -317,7 +327,7 @@ - + @@ -336,7 +346,7 @@ - + diff --git a/docs/test_cases/t00013.md b/docs/test_cases/t00013.md index 574aca69..64ad8575 100644 --- a/docs/test_cases/t00013.md +++ b/docs/test_cases/t00013.md @@ -907,7 +907,7 @@ private: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00013_class.svg b/docs/test_cases/t00013_class.svg index 59a13c1b..3145c0ab 100644 --- a/docs/test_cases/t00013_class.svg +++ b/docs/test_cases/t00013_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + ABCD::F @@ -19,15 +19,15 @@ - + - + f : T - - + + ABCD::F @@ -36,75 +36,75 @@ - - + + A - + - + a : int - - + + B - + - + b : int - - + + C - + - + c : int - - + + D - + - + print(R * r) : void - + - + d : int - - + + E @@ -113,15 +113,15 @@ - + - + e : T - - + + G @@ -130,22 +130,22 @@ - + - + args : std::tuple<Args...> - + - + g : T - - + + E @@ -154,8 +154,8 @@ - - + + G @@ -164,8 +164,8 @@ - - + + E @@ -174,93 +174,93 @@ - - + + R - + - + get_a(A * a) : int - + - + get_b(B & b) : int - + - + get_c(C c) : int - + - + get_const_b(const B & b) : int - + - + get_d(D && d) : int - + - + get_d2(D && d) : int get_e<T>(E<T> e) : T get_f<T>(const F<T> & f) : T - + - + get_int_e(const E<int> & e) : int - + - + get_int_e2(E<int> & e) : int - + - + get_int_f(const ABCD::F<int> & f) : int - + - + estring : E<std::string> - + - + gintstring : G<int,float,std::string> diff --git a/docs/test_cases/t00013_class_mermaid.svg b/docs/test_cases/t00013_class_mermaid.svg index 8cb4717f..45d31678 100644 --- a/docs/test_cases/t00013_class_mermaid.svg +++ b/docs/test_cases/t00013_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -67,119 +67,145 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
@@ -208,7 +234,7 @@
- + @@ -232,7 +258,7 @@
- + @@ -251,7 +277,7 @@
- + @@ -275,7 +301,7 @@ - + @@ -299,7 +325,7 @@ - + @@ -323,7 +349,7 @@ - + @@ -352,7 +378,7 @@ - + @@ -376,7 +402,7 @@ - + @@ -405,7 +431,7 @@ - + @@ -424,7 +450,7 @@ - + @@ -443,7 +469,7 @@ - + @@ -462,7 +488,7 @@ - + diff --git a/docs/test_cases/t00014.md b/docs/test_cases/t00014.md index c75fbbee..1b21783a 100644 --- a/docs/test_cases/t00014.md +++ b/docs/test_cases/t00014.md @@ -974,7 +974,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00014_class.svg b/docs/test_cases/t00014_class.svg index a0c1c38c..65767a96 100644 --- a/docs/test_cases/t00014_class.svg +++ b/docs/test_cases/t00014_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,37 +19,37 @@ - + - + p : P - + - + t : T - - + + B - + - + value : std::string - - + + A @@ -58,8 +58,8 @@ - - + + A @@ -68,8 +68,8 @@ - - + + A @@ -78,8 +78,8 @@ - - + + A @@ -88,8 +88,8 @@ - - + + A @@ -98,8 +98,8 @@ - - + + A @@ -108,8 +108,8 @@ - - + + A @@ -118,8 +118,8 @@ - - + + A @@ -128,8 +128,8 @@ - - + + A @@ -138,8 +138,8 @@ - - + + A @@ -148,8 +148,8 @@ - - + + A @@ -158,8 +158,8 @@ - - + + A @@ -168,8 +168,8 @@ - - + + A @@ -178,8 +178,8 @@ - - + + A @@ -188,8 +188,8 @@ - - + + A @@ -198,8 +198,8 @@ - - + + R @@ -208,116 +208,116 @@ - + - + abool : APtr<bool> - + - + aboolfloat : AAPtr<bool,float> - + - + afloat : ASharedPtr<float> - + - + atfloat : AAPtr<T,float> - + - + bapair : PairPairBA<bool> - + - + boolstring : A<bool,std::string> - + - + bs : BVector - + - + bs2 : BVector2 - + - + bstringstring : BStringString - + - + cb : SimpleCallback<ACharString> - + - + floatstring : AStringPtr<float> - + - + gcb : GenericCallback<AWCharString> - + - + intstring : AIntString - + - + stringstring : AStringString - + - + vcb : VoidCallback - + - + vps : VectorPtr<B> diff --git a/docs/test_cases/t00014_class_mermaid.svg b/docs/test_cases/t00014_class_mermaid.svg index 802d0c05..34fb5f98 100644 --- a/docs/test_cases/t00014_class_mermaid.svg +++ b/docs/test_cases/t00014_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -85,137 +85,167 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
@@ -385,20 +415,24 @@
- +
- + + +
- +
- + + +
@@ -416,7 +450,7 @@
- + @@ -445,7 +479,7 @@
- + @@ -469,7 +503,7 @@
- + @@ -488,7 +522,7 @@ - + @@ -507,7 +541,7 @@ - + @@ -526,7 +560,7 @@ - + @@ -545,7 +579,7 @@ - + @@ -564,7 +598,7 @@ - + @@ -583,7 +617,7 @@ - + @@ -602,7 +636,7 @@ - + @@ -621,7 +655,7 @@ - + @@ -640,7 +674,7 @@ - + @@ -659,7 +693,7 @@ - + @@ -678,7 +712,7 @@ - + @@ -697,7 +731,7 @@ - + @@ -716,7 +750,7 @@ - + @@ -735,7 +769,7 @@ - + @@ -754,7 +788,7 @@ - + diff --git a/docs/test_cases/t00015.md b/docs/test_cases/t00015.md index 206a036d..7d271daf 100644 --- a/docs/test_cases/t00015.md +++ b/docs/test_cases/t00015.md @@ -189,7 +189,7 @@ class B : public ns1::ns2::Anon { }; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00015_class.svg b/docs/test_cases/t00015_class.svg index 793a44fa..6b7826d8 100644 --- a/docs/test_cases/t00015_class.svg +++ b/docs/test_cases/t00015_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + ns1::A - - + + ns1::ns2_v0_9_0::A - - + + ns1::Anon - - + + ns3::ns1::ns2::Anon - - + + ns3::B diff --git a/docs/test_cases/t00015_class_mermaid.svg b/docs/test_cases/t00015_class_mermaid.svg index 9e34b027..0eb06101 100644 --- a/docs/test_cases/t00015_class_mermaid.svg +++ b/docs/test_cases/t00015_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -84,7 +84,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -141,7 +141,7 @@ - + @@ -160,7 +160,7 @@ - + diff --git a/docs/test_cases/t00016.md b/docs/test_cases/t00016.md index 301d2d9e..4d390c9a 100644 --- a/docs/test_cases/t00016.md +++ b/docs/test_cases/t00016.md @@ -275,7 +275,7 @@ template <> struct is_numeric { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00016_class.svg b/docs/test_cases/t00016_class.svg index 5951fc48..31ad6bc7 100644 --- a/docs/test_cases/t00016_class.svg +++ b/docs/test_cases/t00016_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + is_numeric @@ -21,8 +21,8 @@ value : enum - - + + is_numeric @@ -33,8 +33,8 @@ value : enum - - + + is_numeric @@ -45,8 +45,8 @@ value : enum - - + + is_numeric @@ -57,8 +57,8 @@ value : enum - - + + is_numeric @@ -69,8 +69,8 @@ value : enum - - + + is_numeric diff --git a/docs/test_cases/t00016_class_mermaid.svg b/docs/test_cases/t00016_class_mermaid.svg index 8c53c83c..b57ce00c 100644 --- a/docs/test_cases/t00016_class_mermaid.svg +++ b/docs/test_cases/t00016_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -57,54 +57,64 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- + @@ -128,7 +138,7 @@
- + @@ -152,7 +162,7 @@
- + @@ -176,7 +186,7 @@ - + @@ -200,7 +210,7 @@ - + @@ -224,7 +234,7 @@ - + diff --git a/docs/test_cases/t00017.md b/docs/test_cases/t00017.md index 3f89805b..98b5b270 100644 --- a/docs/test_cases/t00017.md +++ b/docs/test_cases/t00017.md @@ -579,7 +579,7 @@ private: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00017_class.svg b/docs/test_cases/t00017_class.svg index 48ae2fb9..1d899dc8 100644 --- a/docs/test_cases/t00017_class.svg +++ b/docs/test_cases/t00017_class.svg @@ -1,6 +1,6 @@ - + @@ -9,135 +9,135 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J - - + + K - - + + R - + - + R(int & some_int, C & cc, const E & ee, F && ff, I *& ii) : void - + - + some_int : int - + - + some_int_pointer : int * - + - + some_int_pointer_pointer : int ** - + - + some_int_reference : int & diff --git a/docs/test_cases/t00017_class_mermaid.svg b/docs/test_cases/t00017_class_mermaid.svg index 2034f400..7aaa99b8 100644 --- a/docs/test_cases/t00017_class_mermaid.svg +++ b/docs/test_cases/t00017_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -186,7 +186,7 @@ - + @@ -205,7 +205,7 @@ - + @@ -224,7 +224,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -300,7 +300,7 @@ - + @@ -319,7 +319,7 @@ - + @@ -338,7 +338,7 @@ - + @@ -357,7 +357,7 @@ - + @@ -376,7 +376,7 @@ - + @@ -395,7 +395,7 @@ - + diff --git a/docs/test_cases/t00018.md b/docs/test_cases/t00018.md index 9869b572..d5cd987d 100644 --- a/docs/test_cases/t00018.md +++ b/docs/test_cases/t00018.md @@ -556,7 +556,7 @@ void widget::draw(const clanguml::t00018::widget &w) } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00018_class.svg b/docs/test_cases/t00018_class.svg index f615c215..330371d7 100644 --- a/docs/test_cases/t00018_class.svg +++ b/docs/test_cases/t00018_class.svg @@ -1,6 +1,6 @@ - + @@ -9,121 +9,121 @@ - - + + impl::widget - + - + widget(int n) : void - + - + draw(const widget & w) const : void - + - + draw(const widget & w) : void - + - + n : int - - + + widget - + - + widget(int) : void - + - + widget(widget &&) : void - + - + widget(const widget &) = deleted : void - + - + ~widget() : void - + - + operator=(widget &&) : widget & - + - + operator=(const widget &) = deleted : widget & - + - + draw() const : void - + - + draw() : void - + - + shown() const : bool - + - + pImpl : std::unique_ptr<impl::widget> diff --git a/docs/test_cases/t00018_class_mermaid.svg b/docs/test_cases/t00018_class_mermaid.svg index 4bddd61e..c1ad2ba0 100644 --- a/docs/test_cases/t00018_class_mermaid.svg +++ b/docs/test_cases/t00018_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,20 +50,22 @@ - - + + - +
- + + +
- + - +
- +draw() : void + +draw() : [const] void
@@ -176,9 +178,9 @@ +draw() : void - +
- +shown() : bool + +shown() : [const] bool
diff --git a/docs/test_cases/t00019.md b/docs/test_cases/t00019.md index d77281ad..18a2233d 100644 --- a/docs/test_cases/t00019.md +++ b/docs/test_cases/t00019.md @@ -739,7 +739,7 @@ class Base { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00019_class.svg b/docs/test_cases/t00019_class.svg index eb2a6169..f385fcf5 100644 --- a/docs/test_cases/t00019_class.svg +++ b/docs/test_cases/t00019_class.svg @@ -1,6 +1,6 @@ - + @@ -9,45 +9,45 @@ - - + + Base - + - + Base() = default : void - + - + ~Base() constexpr = default : void - + - + m1() : int - + - + m2() : std::string - - + + Layer1 @@ -55,23 +55,23 @@ LowerLayer - + - + m1() : int - + - + m2() : std::string - - + + Layer2 @@ -79,16 +79,16 @@ LowerLayer - + - + all_calls_count() const : int - - + + Layer3 @@ -96,51 +96,51 @@ LowerLayer - + - + m1() : int - + - + m1_calls() const : int - + - + m2() : std::string - + - + m2_calls() const : int - + - + m_m1_calls : int - + - + m_m2_calls : int - - + + Layer3 @@ -149,8 +149,8 @@ - - + + Layer2 @@ -159,8 +159,8 @@ - - + + Layer1 @@ -169,19 +169,19 @@ - - + + A - + - + layers : std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> diff --git a/docs/test_cases/t00019_class_mermaid.svg b/docs/test_cases/t00019_class_mermaid.svg index eb369a12..32dfe464 100644 --- a/docs/test_cases/t00019_class_mermaid.svg +++ b/docs/test_cases/t00019_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,20 +50,22 @@ - - - - - - - + + + + + + + - +
- + + +
@@ -77,11 +79,13 @@
- +
- + + +
@@ -95,11 +99,13 @@
- +
- + + +
@@ -113,7 +119,7 @@
- +
@@ -126,11 +132,11 @@ - + - - - + + +
@@ -142,22 +148,22 @@ Base
- +
- -Base() : void + -Base() : [default] void
- +
- -~Base() : void + -~Base() : [default,constexpr] void
- +
-m1() : int
- +
-m2() : std::string
@@ -165,7 +171,7 @@
- + @@ -194,11 +200,11 @@ - + - - - + + +
@@ -210,19 +216,19 @@ Layer2<LowerLayer>
- +
- -all_calls_count() : int + -all_calls_count() : [const] int
- + - - - + + +
@@ -234,40 +240,40 @@ Layer3<LowerLayer>
- +
-m_m1_calls : int
- +
-m_m2_calls : int
- +
-m1() : int
- +
- -m1_calls() : int + -m1_calls() : [const] int
- +
-m2() : std::string
- +
- -m2_calls() : int + -m2_calls() : [const] int
- + @@ -286,7 +292,7 @@ - + @@ -305,7 +311,7 @@ - + @@ -324,7 +330,7 @@ - + diff --git a/docs/test_cases/t00020.md b/docs/test_cases/t00020.md index 0a0a9c16..a962d6b6 100644 --- a/docs/test_cases/t00020.md +++ b/docs/test_cases/t00020.md @@ -736,7 +736,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00020_class.svg b/docs/test_cases/t00020_class.svg index 813e86be..a2ca8e3c 100644 --- a/docs/test_cases/t00020_class.svg +++ b/docs/test_cases/t00020_class.svg @@ -1,6 +1,6 @@ - + @@ -9,175 +9,175 @@ - - + + ProductA - + - + ~ProductA() constexpr = default : void - + - + sell(int price) const = 0 : bool - - + + ProductA1 - + - + sell(int price) const : bool - - + + ProductA2 - + - + sell(int price) const : bool - - + + ProductB - + - + ~ProductB() constexpr = default : void - + - + buy(int price) const = 0 : bool - - + + ProductB1 - + - + buy(int price) const : bool - - + + ProductB2 - + - + buy(int price) const : bool - - + + AbstractFactory - + - + make_a() const = 0 : std::unique_ptr<ProductA> - + - + make_b() const = 0 : std::unique_ptr<ProductB> - - + + Factory1 - + - + make_a() const : std::unique_ptr<ProductA> - + - + make_b() const : std::unique_ptr<ProductB> - - + + Factory2 - + - + make_a() const : std::unique_ptr<ProductA> - + - + make_b() const : std::unique_ptr<ProductB> diff --git a/docs/test_cases/t00020_class_mermaid.svg b/docs/test_cases/t00020_class_mermaid.svg index b86b1e86..cfa8e199 100644 --- a/docs/test_cases/t00020_class_mermaid.svg +++ b/docs/test_cases/t00020_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,18 +50,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -100,11 +100,46 @@ - +
- + + + +
+
+
+
+ + + +
+ + + +
+
+
+
+ + + +
+ + + +
+
+
+
+ + + +
+ + +
@@ -118,47 +153,24 @@
- +
- + + +
- +
- -
-
-
-
- - - -
- -
-
-
-
- - - -
- -
-
-
-
- - - -
- + + +
@@ -174,11 +186,11 @@
- + - - - + + +
@@ -190,24 +202,24 @@ ProductA
- +
- +~ProductA() : void + +~ProductA() : [default,constexpr] void
- +
- +sell(int price) : bool + +sell(int price) : [const] bool
- + - - - + + +
@@ -219,19 +231,19 @@ ProductA1
- +
- +sell(int price) : bool + +sell(int price) : [const] bool
- + - - - + + +
@@ -243,19 +255,19 @@ ProductA2
- +
- +sell(int price) : bool + +sell(int price) : [const] bool
- + - - - + + +
@@ -267,24 +279,24 @@ ProductB
- +
- +~ProductB() : void + +~ProductB() : [default,constexpr] void
- +
- +buy(int price) : bool + +buy(int price) : [const] bool
- + - - - + + +
@@ -296,19 +308,19 @@ ProductB1
- +
- +buy(int price) : bool + +buy(int price) : [const] bool
- + - - - + + +
@@ -320,19 +332,19 @@ ProductB2
- +
- +buy(int price) : bool + +buy(int price) : [const] bool
- + - - - + + +
@@ -344,24 +356,24 @@ AbstractFactory
- +
- +make_a() : std::unique_ptr<ProductA> + +make_a() : [const] std::unique_ptr<ProductA>
- +
- +make_b() : std::unique_ptr<ProductB> + +make_b() : [const] std::unique_ptr<ProductB>
- + - - - + + +
@@ -373,24 +385,24 @@ Factory1
- +
- +make_a() : std::unique_ptr<ProductA> + +make_a() : [const] std::unique_ptr<ProductA>
- +
- +make_b() : std::unique_ptr<ProductB> + +make_b() : [const] std::unique_ptr<ProductB>
- + - - - + + +
@@ -402,14 +414,14 @@ Factory2
- +
- +make_a() : std::unique_ptr<ProductA> + +make_a() : [const] std::unique_ptr<ProductA>
- +
- +make_b() : std::unique_ptr<ProductB> + +make_b() : [const] std::unique_ptr<ProductB>
diff --git a/docs/test_cases/t00021.md b/docs/test_cases/t00021.md index 8a2f2fb8..397d2607 100644 --- a/docs/test_cases/t00021.md +++ b/docs/test_cases/t00021.md @@ -657,7 +657,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00021_class.svg b/docs/test_cases/t00021_class.svg index 94d0915e..39ec0cd5 100644 --- a/docs/test_cases/t00021_class.svg +++ b/docs/test_cases/t00021_class.svg @@ -1,6 +1,6 @@ - + @@ -9,152 +9,152 @@ - - + + Visitor - + - + ~Visitor() constexpr = default : void - + - + visit_A(const A & item) const = 0 : void - + - + visit_B(const B & item) const = 0 : void - - + + Visitor1 - + - + visit_A(const A & item) const : void - + - + visit_B(const B & item) const : void - - + + Visitor2 - + - + visit_A(const A & item) const : void - + - + visit_B(const B & item) const : void - - + + Visitor3 - + - + visit_A(const A & item) const : void - + - + visit_B(const B & item) const : void - - + + Item - + - + ~Item() constexpr = default : void - + - + accept(const Visitor & visitor) const = 0 : void - - + + A - + - + accept(const Visitor & visitor) const : void - - + + B - + - + accept(const Visitor & visitor) const : void diff --git a/docs/test_cases/t00021_class_mermaid.svg b/docs/test_cases/t00021_class_mermaid.svg index 34d2e02e..8fe319e9 100644 --- a/docs/test_cases/t00021_class_mermaid.svg +++ b/docs/test_cases/t00021_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,29 +50,64 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - +
- + + + +
+
+
+
+ + + +
+ + + +
+
+
+
+ + + +
+ + + +
+
+
+
+ + + +
+ + +
@@ -86,11 +121,24 @@
- +
- + + + +
+
+
+
+ + + +
+ + +
@@ -104,11 +152,24 @@
- +
- + + + +
+
+
+
+ + + +
+ + +
@@ -122,11 +183,24 @@
- +
- + + + +
+
+
+
+ + + +
+ + +
@@ -140,65 +214,13 @@
- +
- -
-
-
-
- - - -
- -
-
-
-
- - - -
- -
-
-
-
- - - -
- -
-
-
-
- - - -
- -
-
-
-
- - - -
- -
-
-
-
- - - -
- + + +
@@ -214,11 +236,11 @@
-
+ - - - + + +
@@ -230,29 +252,29 @@ Visitor
- +
- +~Visitor() : void + +~Visitor() : [default,constexpr] void
- +
- +visit_A(const A & item) : void + +visit_A(const A & item) : [const] void
- +
- +visit_B(const B & item) : void + +visit_B(const B & item) : [const] void
- + - - - + + +
@@ -264,24 +286,24 @@ Visitor1
- +
- +visit_A(const A & item) : void + +visit_A(const A & item) : [const] void
- +
- +visit_B(const B & item) : void + +visit_B(const B & item) : [const] void
- + - - - + + +
@@ -293,24 +315,24 @@ Visitor2
- +
- +visit_A(const A & item) : void + +visit_A(const A & item) : [const] void
- +
- +visit_B(const B & item) : void + +visit_B(const B & item) : [const] void
- + - - - + + +
@@ -322,24 +344,24 @@ Visitor3
- +
- +visit_A(const A & item) : void + +visit_A(const A & item) : [const] void
- +
- +visit_B(const B & item) : void + +visit_B(const B & item) : [const] void
- + - - - + + +
@@ -351,24 +373,24 @@ Item
- +
- +~Item() : void + +~Item() : [default,constexpr] void
- +
- +accept(const Visitor & visitor) : void + +accept(const Visitor & visitor) : [const] void
- + - - - + + +
@@ -380,19 +402,19 @@ A
- +
- +accept(const Visitor & visitor) : void + +accept(const Visitor & visitor) : [const] void
- + - - - + + +
@@ -404,9 +426,9 @@ B
- +
- +accept(const Visitor & visitor) : void + +accept(const Visitor & visitor) : [const] void
diff --git a/docs/test_cases/t00022.md b/docs/test_cases/t00022.md index fc763b8e..8556cb6d 100644 --- a/docs/test_cases/t00022.md +++ b/docs/test_cases/t00022.md @@ -320,7 +320,7 @@ protected: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00022_class.svg b/docs/test_cases/t00022_class.svg index e7fda857..e5036a25 100644 --- a/docs/test_cases/t00022_class.svg +++ b/docs/test_cases/t00022_class.svg @@ -1,6 +1,6 @@ - + @@ -9,76 +9,76 @@ - - + + A - + - + method1() = 0 : void - + - + method2() = 0 : void - + - + template_method() : void - - + + A1 - + - + method1() : void - + - + method2() : void - - + + A2 - + - + method1() : void - + - + method2() : void diff --git a/docs/test_cases/t00022_class_mermaid.svg b/docs/test_cases/t00022_class_mermaid.svg index c275fa85..90f77c1b 100644 --- a/docs/test_cases/t00022_class_mermaid.svg +++ b/docs/test_cases/t00022_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -74,7 +74,7 @@ - + @@ -108,7 +108,7 @@
- + @@ -137,7 +137,7 @@ - + diff --git a/docs/test_cases/t00023.md b/docs/test_cases/t00023.md index 28f32d60..c4fb4c92 100644 --- a/docs/test_cases/t00023.md +++ b/docs/test_cases/t00023.md @@ -400,7 +400,7 @@ private: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00023_class.svg b/docs/test_cases/t00023_class.svg index 673fc00d..0b30fab2 100644 --- a/docs/test_cases/t00023_class.svg +++ b/docs/test_cases/t00023_class.svg @@ -1,6 +1,6 @@ - + @@ -9,102 +9,102 @@ - - + + Strategy - + - + ~Strategy() constexpr = default : void - + - + algorithm() = 0 : void - - + + StrategyA - + - + algorithm() : void - - + + StrategyB - + - + algorithm() : void - - + + StrategyC - + - + algorithm() : void - - + + Context - + - + Context(std::unique_ptr<Strategy> strategy) : void - + - + apply() : void - + - + m_strategy : std::unique_ptr<Strategy> diff --git a/docs/test_cases/t00023_class_mermaid.svg b/docs/test_cases/t00023_class_mermaid.svg index 2d2898c6..012d3109 100644 --- a/docs/test_cases/t00023_class_mermaid.svg +++ b/docs/test_cases/t00023_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,9 +50,9 @@ - + - + @@ -96,11 +96,11 @@ - + - - - + + +
@@ -112,12 +112,12 @@ Strategy
- +
- +~Strategy() : void + +~Strategy() : [default,constexpr] void
- +
+algorithm() : void
@@ -125,7 +125,7 @@ - + @@ -149,7 +149,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -197,7 +197,7 @@ - + diff --git a/docs/test_cases/t00024.md b/docs/test_cases/t00024.md index 15793475..1acf38a3 100644 --- a/docs/test_cases/t00024.md +++ b/docs/test_cases/t00024.md @@ -451,7 +451,7 @@ private: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00024_class.svg b/docs/test_cases/t00024_class.svg index e4a72557..0f7f46b6 100644 --- a/docs/test_cases/t00024_class.svg +++ b/docs/test_cases/t00024_class.svg @@ -1,6 +1,6 @@ - + @@ -9,115 +9,115 @@ - - + + Target - + - + ~Target() = 0 : void - + - + m1() = 0 : void - + - + m2() = 0 : void - - + + Target1 - + - + m1() : void - + - + m2() : void - - + + Target2 - + - + m1() : void - + - + m2() : void - - + + Proxy - + - + Proxy(std::shared_ptr<Target> target) : void - + - + m1() : void - + - + m2() : void - + - + m_target : std::shared_ptr<Target> diff --git a/docs/test_cases/t00024_class_mermaid.svg b/docs/test_cases/t00024_class_mermaid.svg index 118279bb..e4f10d43 100644 --- a/docs/test_cases/t00024_class_mermaid.svg +++ b/docs/test_cases/t00024_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -96,7 +96,7 @@ - + @@ -130,7 +130,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -188,7 +188,7 @@ - + diff --git a/docs/test_cases/t00025.md b/docs/test_cases/t00025.md index ae1b5f29..15ccdb9b 100644 --- a/docs/test_cases/t00025.md +++ b/docs/test_cases/t00025.md @@ -442,7 +442,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00025_class.svg b/docs/test_cases/t00025_class.svg index af0adb76..dd6d260b 100644 --- a/docs/test_cases/t00025_class.svg +++ b/docs/test_cases/t00025_class.svg @@ -1,6 +1,6 @@ - + @@ -9,52 +9,52 @@ - - + + Target1 - + - + m1() : void - + - + m2() : void - - + + Target2 - + - + m1() : void - + - + m2() : void - - + + Proxy @@ -62,38 +62,38 @@ T - + - + Proxy(std::shared_ptr<T> target) : void - + - + m1() : void - + - + m2() : void - + - + m_target : std::shared_ptr<T> - - + + Proxy @@ -102,8 +102,8 @@ - - + + Proxy @@ -112,26 +112,26 @@ - - + + ProxyHolder - + - + proxy1 : Proxy<Target1> - + - + proxy2 : Proxy<Target2> diff --git a/docs/test_cases/t00025_class_mermaid.svg b/docs/test_cases/t00025_class_mermaid.svg index 68e5828d..60883db7 100644 --- a/docs/test_cases/t00025_class_mermaid.svg +++ b/docs/test_cases/t00025_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -58,38 +58,46 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
@@ -118,7 +126,7 @@
- + @@ -147,7 +155,7 @@
- + @@ -176,7 +184,7 @@
- + @@ -215,7 +223,7 @@ - + @@ -234,7 +242,7 @@ - + @@ -253,7 +261,7 @@ - + diff --git a/docs/test_cases/t00026.md b/docs/test_cases/t00026.md index 33f19e1a..3bfa639b 100644 --- a/docs/test_cases/t00026.md +++ b/docs/test_cases/t00026.md @@ -582,7 +582,7 @@ struct StringMemento { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00026_class.svg b/docs/test_cases/t00026_class.svg index f7c9cfb5..3c3444f7 100644 --- a/docs/test_cases/t00026_class.svg +++ b/docs/test_cases/t00026_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + Memento @@ -18,31 +18,31 @@ T - + - + Memento(T && v) : void - + - + value() const : T - + - + m_value : T - - + + Originator @@ -50,52 +50,52 @@ T - + - + Originator(T && v) : void - + - + load(const Memento<T> & m) : void - + - + memoize_value() const : Memento<T> - + - + print() const : void - + - + set(T && v) : void - + - + m_value : T - - + + Caretaker @@ -103,30 +103,30 @@ T - + - + set_state(const std::string & s, Memento<T> && m) : void - + - + state(const std::string & n) : Memento<T> & - + - + m_mementos : std::unordered_map<std::string,Memento<T>> - - + + Caretaker @@ -135,8 +135,8 @@ - - + + Originator @@ -145,26 +145,26 @@ - - + + StringMemento - + - + caretaker : Caretaker<std::string> - + - + originator : Originator<std::string> diff --git a/docs/test_cases/t00026_class_mermaid.svg b/docs/test_cases/t00026_class_mermaid.svg index 90054c70..e40562f5 100644 --- a/docs/test_cases/t00026_class_mermaid.svg +++ b/docs/test_cases/t00026_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,24 +50,26 @@ - - - - - - + + + + + + - +
- + + +
- +
@@ -78,25 +80,29 @@ - +
- + + +
- +
- + + +
- +
@@ -107,7 +113,7 @@ - + - +
- +value() : T + +value() : [const] T
- + - - - + + +
@@ -170,32 +176,32 @@ Originator<T>
- +
-m_value : T
- +
+Originator(T && v) : void
- +
+load(const Memento & m) : void
- +
- +memoize_value() : Memento<T> + +memoize_value() : [const] Memento<T>
- +
- +print() : void + +print() : [const] void
- +
+set(T && v) : void
@@ -203,7 +209,7 @@
- + @@ -237,7 +243,7 @@
- + @@ -256,7 +262,7 @@ - + @@ -275,7 +281,7 @@ - + diff --git a/docs/test_cases/t00027.md b/docs/test_cases/t00027.md index f7ff0cff..fd520716 100644 --- a/docs/test_cases/t00027.md +++ b/docs/test_cases/t00027.md @@ -710,7 +710,7 @@ struct Window { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00027_class.svg b/docs/test_cases/t00027_class.svg index 3edd483c..9ac82bf9 100644 --- a/docs/test_cases/t00027_class.svg +++ b/docs/test_cases/t00027_class.svg @@ -1,6 +1,6 @@ - + @@ -9,39 +9,39 @@ - - + + Shape - + - + ~Shape() constexpr = default : void - + - + display() = 0 : void - - + + Line - - + + Line @@ -49,24 +49,24 @@ T<>... - + - + display() : void - - + + Text - - + + Text @@ -74,31 +74,31 @@ T<>... - + - + display() : void - - + + ShapeDecorator - + - + display() = 0 : void - - + + Color @@ -106,16 +106,16 @@ T - + - + display() : void - - + + Weight @@ -123,16 +123,16 @@ T - + - + display() : void - - + + Line @@ -141,8 +141,8 @@ - - + + Line @@ -151,8 +151,8 @@ - - + + Text @@ -161,8 +161,8 @@ - - + + Text @@ -171,40 +171,40 @@ - - + + Window - + - + border : Line<Color,Weight> - + - + description : Text<Color> - + - + divider : Line<Color> - + - + title : Text<Color,Weight> diff --git a/docs/test_cases/t00027_class_mermaid.svg b/docs/test_cases/t00027_class_mermaid.svg index dc7a0549..81baedaf 100644 --- a/docs/test_cases/t00027_class_mermaid.svg +++ b/docs/test_cases/t00027_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,18 +50,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -100,43 +100,51 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
@@ -147,7 +155,7 @@ - +
@@ -158,7 +166,7 @@ - +
@@ -169,7 +177,7 @@ - +
@@ -182,11 +190,11 @@ - + - - - + + +
@@ -198,12 +206,12 @@ Shape
- +
- +~Shape() : void + +~Shape() : [default,constexpr] void
- +
+display() : void
@@ -211,7 +219,7 @@
- + @@ -230,7 +238,7 @@
- + @@ -254,7 +262,7 @@ - + @@ -273,7 +281,7 @@ - + @@ -297,7 +305,7 @@ - + @@ -321,7 +329,7 @@ - + @@ -345,7 +353,7 @@ - + @@ -369,7 +377,7 @@ - + @@ -388,7 +396,7 @@ - + @@ -407,7 +415,7 @@ - + @@ -426,7 +434,7 @@ - + @@ -445,7 +453,7 @@ - + diff --git a/docs/test_cases/t00028.md b/docs/test_cases/t00028.md index 79959c91..c6a1545b 100644 --- a/docs/test_cases/t00028.md +++ b/docs/test_cases/t00028.md @@ -461,7 +461,7 @@ class R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00028_class.svg b/docs/test_cases/t00028_class.svg index d276803a..76ccc984 100644 --- a/docs/test_cases/t00028_class.svg +++ b/docs/test_cases/t00028_class.svg @@ -1,6 +1,6 @@ - + @@ -9,54 +9,54 @@ - - + + A - + A class note. - - + + B - + B class note. - - + + C - + C class note. - - + + D - + D class note. - - + + E @@ -65,26 +65,26 @@ - + - + param : T - + E template class note. - - + + G - - + + F @@ -94,11 +94,11 @@ three - + F enum note. - - + + E @@ -107,70 +107,70 @@ - - + + R - + - + R(C & c) : void - + - + aaa : A - + - + bbb : B * - + - + ccc : C & - + - + ddd : std::vector<std::shared_ptr<D>> - + - + eee : E<int> - + - + ggg : G ** - + R class note. - + R contains an instance of A. - + Reference to C. diff --git a/docs/test_cases/t00028_class_mermaid.svg b/docs/test_cases/t00028_class_mermaid.svg index d5b762aa..6090b9b0 100644 --- a/docs/test_cases/t00028_class_mermaid.svg +++ b/docs/test_cases/t00028_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,33 +50,35 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - +
- + + +
- +
@@ -87,7 +89,7 @@ - +
@@ -98,7 +100,7 @@ - +
@@ -109,7 +111,7 @@ - +
@@ -120,7 +122,7 @@ - +
@@ -131,7 +133,7 @@ - + - +
one
- +
two
- +
three
@@ -369,7 +371,7 @@
- + @@ -388,7 +390,7 @@
- + @@ -442,7 +444,7 @@ - + @@ -453,7 +455,7 @@ - + @@ -464,7 +466,7 @@ - + @@ -475,7 +477,7 @@ - + @@ -486,7 +488,7 @@ - + @@ -497,7 +499,7 @@ - + @@ -508,7 +510,7 @@ - + @@ -519,7 +521,7 @@ - + diff --git a/docs/test_cases/t00029.md b/docs/test_cases/t00029.md index f65247bf..3d463517 100644 --- a/docs/test_cases/t00029.md +++ b/docs/test_cases/t00029.md @@ -312,7 +312,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00029_class.svg b/docs/test_cases/t00029_class.svg index 2ab0a3da..e394baeb 100644 --- a/docs/test_cases/t00029_class.svg +++ b/docs/test_cases/t00029_class.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - + + A - - + + C @@ -27,15 +27,15 @@ - + - + param : T - - + + E @@ -45,65 +45,65 @@ three - - + + G1 - - + + G2 - - + + G3 - - + + G4 - - + + R - + - + g1 : G1 - + - + g3 : G3 & - + - + g4 : std::shared_ptr<G4> diff --git a/docs/test_cases/t00029_class_mermaid.svg b/docs/test_cases/t00029_class_mermaid.svg index 27cfdc73..781ce2ac 100644 --- a/docs/test_cases/t00029_class_mermaid.svg +++ b/docs/test_cases/t00029_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,11 +50,11 @@ - - + + - +
@@ -65,7 +65,7 @@ - + - +
one
- +
two
- +
three
@@ -155,7 +155,7 @@
- + @@ -174,7 +174,7 @@
- + @@ -193,7 +193,7 @@ - + @@ -212,7 +212,7 @@ - + @@ -231,7 +231,7 @@ - + diff --git a/docs/test_cases/t00030.md b/docs/test_cases/t00030.md index 9978f9ca..76522228 100644 --- a/docs/test_cases/t00030.md +++ b/docs/test_cases/t00030.md @@ -279,7 +279,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00030_class.svg b/docs/test_cases/t00030_class.svg index c453f91a..7374e73d 100644 --- a/docs/test_cases/t00030_class.svg +++ b/docs/test_cases/t00030_class.svg @@ -1,6 +1,6 @@ - + @@ -9,87 +9,87 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + aaa : A - + - + bbb : std::vector<B> - + - + ccc : std::vector<C> - + - + ddd : D - + - + eee : E * diff --git a/docs/test_cases/t00030_class_mermaid.svg b/docs/test_cases/t00030_class_mermaid.svg index cb269976..c3126a44 100644 --- a/docs/test_cases/t00030_class_mermaid.svg +++ b/docs/test_cases/t00030_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -164,7 +164,7 @@ - + @@ -183,7 +183,7 @@ - + @@ -202,7 +202,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -240,7 +240,7 @@ - + @@ -259,7 +259,7 @@ - + diff --git a/docs/test_cases/t00031.md b/docs/test_cases/t00031.md index 92883c60..c4189cc1 100644 --- a/docs/test_cases/t00031.md +++ b/docs/test_cases/t00031.md @@ -334,7 +334,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00031_class.svg b/docs/test_cases/t00031_class.svg index bc60d6a0..bbeb27af 100644 --- a/docs/test_cases/t00031_class.svg +++ b/docs/test_cases/t00031_class.svg @@ -1,33 +1,33 @@ - + - + - + - - - + + + A - - + + B @@ -37,8 +37,8 @@ three - - + + @@ -48,23 +48,23 @@ - + - + ttt : T - - + + D - - + + C @@ -73,47 +73,47 @@ - - + + R - + - + add_b(B b) : void - + - + aaa : A * - + - + bbb : std::vector<B> - + - + ccc : C<int> - + - + ddd : D * diff --git a/docs/test_cases/t00031_class_mermaid.svg b/docs/test_cases/t00031_class_mermaid.svg index 1f5a6c06..6e6ae3cb 100644 --- a/docs/test_cases/t00031_class_mermaid.svg +++ b/docs/test_cases/t00031_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,28 +50,32 @@ - - - - - - + + + + + + - +
- + + +
- +
- + + +
@@ -87,7 +91,7 @@
- +
@@ -98,7 +102,7 @@ - +
@@ -109,7 +113,7 @@ - + - +
one
- +
two
- +
three
@@ -175,7 +179,7 @@
- + @@ -199,7 +203,7 @@
- + @@ -218,7 +222,7 @@ - + @@ -237,7 +241,7 @@ - + diff --git a/docs/test_cases/t00032.md b/docs/test_cases/t00032.md index 39c61b99..a89bcbd6 100644 --- a/docs/test_cases/t00032.md +++ b/docs/test_cases/t00032.md @@ -429,7 +429,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00032_class.svg b/docs/test_cases/t00032_class.svg index a347a031..19b48ccc 100644 --- a/docs/test_cases/t00032_class.svg +++ b/docs/test_cases/t00032_class.svg @@ -1,6 +1,6 @@ - + @@ -9,69 +9,69 @@ - - + + Base - - + + TBase - - + + A - + - + operator()() : void - - + + B - + - + operator()() : void - - + + C - + - + operator()() : void - - + + Overload @@ -80,15 +80,15 @@ - + - + counter : L - - + + Overload @@ -97,19 +97,19 @@ - - + + R - + - + overload : Overload<TBase,int,A,B,C> diff --git a/docs/test_cases/t00032_class_mermaid.svg b/docs/test_cases/t00032_class_mermaid.svg index 978d59ff..83a16aac 100644 --- a/docs/test_cases/t00032_class_mermaid.svg +++ b/docs/test_cases/t00032_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -68,11 +68,13 @@ - +
- + + +
@@ -126,7 +128,7 @@
- + @@ -145,7 +147,7 @@
- + @@ -164,7 +166,7 @@ - + @@ -188,7 +190,7 @@ - + @@ -212,7 +214,7 @@ - + @@ -236,7 +238,7 @@ - + @@ -260,7 +262,7 @@ - + @@ -279,7 +281,7 @@ - + diff --git a/docs/test_cases/t00033.md b/docs/test_cases/t00033.md index cc153e41..ced2d5af 100644 --- a/docs/test_cases/t00033.md +++ b/docs/test_cases/t00033.md @@ -377,7 +377,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00033_class.svg b/docs/test_cases/t00033_class.svg index 6a83d9d2..1568f5cc 100644 --- a/docs/test_cases/t00033_class.svg +++ b/docs/test_cases/t00033_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,15 +19,15 @@ - + - + aaa : T - - + + B @@ -36,15 +36,15 @@ - + - + bbb : T - - + + C @@ -53,30 +53,30 @@ - + - + ccc : T - - + + D - + - + ddd : int - - + + C @@ -85,8 +85,8 @@ - - + + B @@ -95,8 +95,8 @@ - - + + A @@ -105,19 +105,19 @@ - - + + R - + - + abc : A<B<std::unique_ptr<C<D>>>> diff --git a/docs/test_cases/t00033_class_mermaid.svg b/docs/test_cases/t00033_class_mermaid.svg index 49b807b4..5726ca14 100644 --- a/docs/test_cases/t00033_class_mermaid.svg +++ b/docs/test_cases/t00033_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -59,56 +59,68 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
@@ -126,7 +138,7 @@
- + @@ -150,7 +162,7 @@
- + @@ -174,7 +186,7 @@
- + @@ -198,7 +210,7 @@ - + @@ -222,7 +234,7 @@ - + @@ -241,7 +253,7 @@ - + @@ -260,7 +272,7 @@ - + @@ -279,7 +291,7 @@ - + diff --git a/docs/test_cases/t00034.md b/docs/test_cases/t00034.md index 2f694724..e6dac289 100644 --- a/docs/test_cases/t00034.md +++ b/docs/test_cases/t00034.md @@ -353,7 +353,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00034_class.svg b/docs/test_cases/t00034_class.svg index e08d0b05..06b3d655 100644 --- a/docs/test_cases/t00034_class.svg +++ b/docs/test_cases/t00034_class.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + Void - + - + operator!=(const Void &) constexpr const : bool - + - + operator==(const Void &) constexpr const : bool - - + + lift_void @@ -41,8 +41,8 @@ - - + + lift_void @@ -51,8 +51,8 @@ - - + + drop_void @@ -61,8 +61,8 @@ - - + + drop_void @@ -71,34 +71,34 @@ - - + + A - - + + R - + - + la : lift_void_t<A> * - + - + lv : lift_void_t<void> * diff --git a/docs/test_cases/t00034_class_mermaid.svg b/docs/test_cases/t00034_class_mermaid.svg index 0ee71308..12988704 100644 --- a/docs/test_cases/t00034_class_mermaid.svg +++ b/docs/test_cases/t00034_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -51,39 +51,45 @@ - - - + + + - +
- + + +
- +
- + + +
- +
- + + +
- +
@@ -96,11 +102,11 @@ - + - - - + + +
@@ -112,20 +118,20 @@ Void
- +
- +operator!=(const Void &) : bool + +operator!=(const Void &) : [const,constexpr] bool
- +
- +operator==(const Void &) : bool + +operator==(const Void &) : [const,constexpr] bool
- + @@ -144,7 +150,7 @@
- + @@ -163,7 +169,7 @@ - + @@ -182,7 +188,7 @@ - + @@ -201,7 +207,7 @@ - + @@ -220,7 +226,7 @@ - + diff --git a/docs/test_cases/t00035.md b/docs/test_cases/t00035.md index 0c4040c8..0df62c3d 100644 --- a/docs/test_cases/t00035.md +++ b/docs/test_cases/t00035.md @@ -162,7 +162,7 @@ struct Right { }; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00035_class.svg b/docs/test_cases/t00035_class.svg index b03c6010..1a94f100 100644 --- a/docs/test_cases/t00035_class.svg +++ b/docs/test_cases/t00035_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + Top - - + + Left - - + + Center - - + + Bottom - - + + Right diff --git a/docs/test_cases/t00035_class_mermaid.svg b/docs/test_cases/t00035_class_mermaid.svg index 5e2adfee..0780c15d 100644 --- a/docs/test_cases/t00035_class_mermaid.svg +++ b/docs/test_cases/t00035_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -52,7 +52,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -128,7 +128,7 @@ - + diff --git a/docs/test_cases/t00036.md b/docs/test_cases/t00036.md index 8054bb95..208897b8 100644 --- a/docs/test_cases/t00036.md +++ b/docs/test_cases/t00036.md @@ -278,7 +278,7 @@ struct DImpl : public ns2::ns22::D { }; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00036_class.svg b/docs/test_cases/t00036_class.svg index 85c4714d..b2f4c125 100644 --- a/docs/test_cases/t00036_class.svg +++ b/docs/test_cases/t00036_class.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - + ns1 - + ns11 - + ns111 - + ns2 - + ns22 - - + + E @@ -34,8 +34,8 @@ yellow - - + + A @@ -44,15 +44,15 @@ - + - + a : T - - + + A @@ -61,23 +61,23 @@ - - + + B - + - + a_int : A<int> - - + + C diff --git a/docs/test_cases/t00036_class_mermaid.svg b/docs/test_cases/t00036_class_mermaid.svg index b72b21b2..4dd7b187 100644 --- a/docs/test_cases/t00036_class_mermaid.svg +++ b/docs/test_cases/t00036_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,11 +50,11 @@ - - + + - + - +
blue
- +
yellow
@@ -105,7 +107,7 @@
- + @@ -129,7 +131,7 @@ - + @@ -153,7 +155,7 @@ - + @@ -172,7 +174,7 @@ - + diff --git a/docs/test_cases/t00037.md b/docs/test_cases/t00037.md index 59f1b40a..4b580bd5 100644 --- a/docs/test_cases/t00037.md +++ b/docs/test_cases/t00037.md @@ -290,7 +290,7 @@ struct A { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00037_class.svg b/docs/test_cases/t00037_class.svg index 4e6a0ac3..6fe47325 100644 --- a/docs/test_cases/t00037_class.svg +++ b/docs/test_cases/t00037_class.svg @@ -1,6 +1,6 @@ - + @@ -9,106 +9,106 @@ - - + + ST - + - + dimensions : ST::(anonymous_662) - + - + units : ST::(anonymous_792) - - + + ST::(dimensions) - + - + t : double - + - + x : double - + - + y : double - + - + z : double - - + + ST::(units) - + - + c : double - + - + h : double - - + + A - + - + A() : void - + - + st : ST diff --git a/docs/test_cases/t00037_class_mermaid.svg b/docs/test_cases/t00037_class_mermaid.svg index 6745d65e..cb2f53bc 100644 --- a/docs/test_cases/t00037_class_mermaid.svg +++ b/docs/test_cases/t00037_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -90,7 +90,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -187,7 +187,7 @@ - + diff --git a/docs/test_cases/t00038.md b/docs/test_cases/t00038.md index b737a30a..c4f7a113 100644 --- a/docs/test_cases/t00038.md +++ b/docs/test_cases/t00038.md @@ -496,7 +496,7 @@ struct map - + @@ -9,8 +9,8 @@ - - + + thirdparty::ns1::color_t @@ -20,16 +20,16 @@ blue - - + + thirdparty::ns1::E - - + + property_t @@ -39,47 +39,47 @@ property_c - - + + A - - + + B - - + + C - - + + key_t - + - + key : std::string - - + + map @@ -88,8 +88,8 @@ - - + + map @@ -98,8 +98,8 @@ - - + + map @@ -108,8 +108,8 @@ - - + + map @@ -118,8 +118,8 @@ - - + + map diff --git a/docs/test_cases/t00038_class_mermaid.svg b/docs/test_cases/t00038_class_mermaid.svg index c16735f7..a430a1cc 100644 --- a/docs/test_cases/t00038_class_mermaid.svg +++ b/docs/test_cases/t00038_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -51,25 +51,38 @@ - + - - + + - - + + - - - + + + - +
- + + + +
+
+
+
+ + + +
+ + +
@@ -83,11 +96,24 @@
- +
- + + + +
+
+
+
+ + + +
+ + +
@@ -101,11 +127,24 @@
- +
- + + + +
+
+
+
+ + + +
+ + +
@@ -119,56 +158,35 @@
- +
- + + +
- +
- + + +
- +
- -
-
-
-
- - - -
- -
-
-
-
- - - -
- -
-
-
-
- - - -
- + + +
@@ -184,15 +202,15 @@
- + - +
- «Enumeration» + «enumeration»
@@ -218,7 +236,7 @@ - + @@ -237,15 +255,15 @@ - + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -253,17 +271,17 @@ property_t - +
property_a
- +
property_b
- +
property_c
@@ -271,7 +289,7 @@
- + @@ -290,7 +308,7 @@ - + @@ -309,7 +327,7 @@ - + @@ -328,7 +346,7 @@ - + @@ -352,7 +370,7 @@ - + @@ -371,7 +389,7 @@ - + @@ -390,7 +408,7 @@ - + @@ -409,7 +427,7 @@ - + @@ -428,7 +446,7 @@ - + diff --git a/docs/test_cases/t00039.md b/docs/test_cases/t00039.md index f3ae6844..e37cc93b 100644 --- a/docs/test_cases/t00039.md +++ b/docs/test_cases/t00039.md @@ -610,7 +610,7 @@ template struct FFF : public FF { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00039_class.svg b/docs/test_cases/t00039_class.svg index 490837fd..f95056d5 100644 --- a/docs/test_cases/t00039_class.svg +++ b/docs/test_cases/t00039_class.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - + + C - - + + D - - + + E - - + + CD - - + + DE - - + + CDE - - + + A - - + + AA - - + + AAA - + - + b : B * - - + + ns2::AAAA - - + + ns3::F @@ -106,15 +106,15 @@ - + - + t : T * - - + + ns3::FF @@ -123,15 +123,15 @@ - + - + m : M * - - + + ns3::FE @@ -140,15 +140,15 @@ - + - + m : M * - - + + ns3::FFF @@ -157,11 +157,11 @@ - + - + n : N * diff --git a/docs/test_cases/t00039_class_mermaid.svg b/docs/test_cases/t00039_class_mermaid.svg index 2d38e266..cc4df4b8 100644 --- a/docs/test_cases/t00039_class_mermaid.svg +++ b/docs/test_cases/t00039_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -184,7 +184,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -222,7 +222,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -279,7 +279,7 @@ - + @@ -298,7 +298,7 @@ - + @@ -317,7 +317,7 @@ - + @@ -336,7 +336,7 @@ - + @@ -360,7 +360,7 @@ - + @@ -379,7 +379,7 @@ - + @@ -403,7 +403,7 @@ - + @@ -427,7 +427,7 @@ - + @@ -451,7 +451,7 @@ - + diff --git a/docs/test_cases/t00040.md b/docs/test_cases/t00040.md index b2d9a0bf..416292a4 100644 --- a/docs/test_cases/t00040.md +++ b/docs/test_cases/t00040.md @@ -309,7 +309,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00040_class.svg b/docs/test_cases/t00040_class.svg index c4bdb854..96267ab6 100644 --- a/docs/test_cases/t00040_class.svg +++ b/docs/test_cases/t00040_class.svg @@ -1,6 +1,6 @@ - + @@ -9,70 +9,70 @@ - - + + A - + - + get_a() : int - + - + ii_ : int - - + + AA - - + + AAA - + - + get_aaa() : int - + - + b : B * - - + + R - + - + foo(A * a) : void diff --git a/docs/test_cases/t00040_class_mermaid.svg b/docs/test_cases/t00040_class_mermaid.svg index c16b95c9..1ca732d6 100644 --- a/docs/test_cases/t00040_class_mermaid.svg +++ b/docs/test_cases/t00040_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -74,7 +74,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -151,7 +151,7 @@ - + diff --git a/docs/test_cases/t00041.md b/docs/test_cases/t00041.md index 511928bd..35b88937 100644 --- a/docs/test_cases/t00041.md +++ b/docs/test_cases/t00041.md @@ -392,7 +392,7 @@ struct NM : public N { }; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00041_class.svg b/docs/test_cases/t00041_class.svg index d06dbaa4..c0bc19c3 100644 --- a/docs/test_cases/t00041_class.svg +++ b/docs/test_cases/t00041_class.svg @@ -1,6 +1,6 @@ - + @@ -9,107 +9,107 @@ - - + + R - - + + D - + - + rr : RR * - - + + E - - + + F - - + + RR - + - + foo(H * h) : void - + - + e : E * - + - + f : F * - + - + g : detail::G * - - + + RRR - - + + ns1::N - - + + ns1::NN - - + + ns1::NM diff --git a/docs/test_cases/t00041_class_mermaid.svg b/docs/test_cases/t00041_class_mermaid.svg index 63ec4462..65234735 100644 --- a/docs/test_cases/t00041_class_mermaid.svg +++ b/docs/test_cases/t00041_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -130,7 +130,7 @@ - + @@ -149,7 +149,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -192,7 +192,7 @@ - + @@ -211,7 +211,7 @@ - + @@ -250,7 +250,7 @@ - + @@ -269,7 +269,7 @@ - + @@ -288,7 +288,7 @@ - + @@ -307,7 +307,7 @@ - + diff --git a/docs/test_cases/t00042.md b/docs/test_cases/t00042.md index 41fa0615..dfa41457 100644 --- a/docs/test_cases/t00042.md +++ b/docs/test_cases/t00042.md @@ -307,7 +307,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00042_class.svg b/docs/test_cases/t00042_class.svg index dfe01169..27433162 100644 --- a/docs/test_cases/t00042_class.svg +++ b/docs/test_cases/t00042_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,15 +19,15 @@ - + - + a : T - - + + A @@ -36,15 +36,15 @@ - + - + a : void * - - + + B @@ -53,22 +53,22 @@ - + - + b : T - + - + bb : K - - + + A @@ -77,8 +77,8 @@ - - + + A @@ -87,8 +87,8 @@ - - + + B diff --git a/docs/test_cases/t00042_class_mermaid.svg b/docs/test_cases/t00042_class_mermaid.svg index ecf5cddb..ec8ff8b4 100644 --- a/docs/test_cases/t00042_class_mermaid.svg +++ b/docs/test_cases/t00042_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -56,45 +56,53 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- + @@ -118,7 +126,7 @@
- + @@ -142,7 +150,7 @@
- + @@ -171,7 +179,7 @@ - + @@ -190,7 +198,7 @@ - + @@ -209,7 +217,7 @@ - + diff --git a/docs/test_cases/t00043.md b/docs/test_cases/t00043.md index f4b1a46d..06312776 100644 --- a/docs/test_cases/t00043.md +++ b/docs/test_cases/t00043.md @@ -653,7 +653,7 @@ struct J { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00043_class.svg b/docs/test_cases/t00043_class.svg index 1304ac9b..0fb770da 100644 --- a/docs/test_cases/t00043_class.svg +++ b/docs/test_cases/t00043_class.svg @@ -1,6 +1,6 @@ - + @@ -9,167 +9,167 @@ - + dependants - + dependencies - - + + A - - + + B - + - + b(A * a) : void - - + + BB - + - + bb(A * a) : void - - + + C - + - + c(B * b) : void - - + + D - + - + d(C * c) : void - + - + dd(BB * bb) : void - - + + E - + - + e(D * d) : void - - + + G - - + + GG - - + + H - + - + h(G * g) : void - + - + hh(GG * gg) : void - - + + I - + - + i(H * h) : void - - + + J - + - + i(I * i) : void diff --git a/docs/test_cases/t00043_class_mermaid.svg b/docs/test_cases/t00043_class_mermaid.svg index d26a7b79..203547b1 100644 --- a/docs/test_cases/t00043_class_mermaid.svg +++ b/docs/test_cases/t00043_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -62,99 +62,119 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- + @@ -173,7 +193,7 @@
- + @@ -197,7 +217,7 @@
- + @@ -221,7 +241,7 @@ - + @@ -245,7 +265,7 @@ - + @@ -274,7 +294,7 @@ - + @@ -298,7 +318,7 @@ - + @@ -317,7 +337,7 @@ - + @@ -336,7 +356,7 @@ - + @@ -365,7 +385,7 @@ - + @@ -389,7 +409,7 @@ - + diff --git a/docs/test_cases/t00044.md b/docs/test_cases/t00044.md index 09c09c38..eb6a9b1b 100644 --- a/docs/test_cases/t00044.md +++ b/docs/test_cases/t00044.md @@ -432,7 +432,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00044_class.svg b/docs/test_cases/t00044_class.svg index 506e782b..c4a75f4b 100644 --- a/docs/test_cases/t00044_class.svg +++ b/docs/test_cases/t00044_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + signal_handler @@ -19,8 +19,8 @@ - - + + sink @@ -28,26 +28,26 @@ signal_handler<Ret(Args...),A> - + - + sink(signal_t & sh) : void get_signal<CastTo>() : CastTo * - + - + signal : signal_t * - - + + signal_handler @@ -56,8 +56,8 @@ - - + + sink @@ -66,23 +66,23 @@ - - + + R - + - + sink1 : sink<signal_handler<void (int),bool>> - - + + signal_handler @@ -91,8 +91,8 @@ - - + + sink diff --git a/docs/test_cases/t00044_class_mermaid.svg b/docs/test_cases/t00044_class_mermaid.svg index 4f928ac4..b047c268 100644 --- a/docs/test_cases/t00044_class_mermaid.svg +++ b/docs/test_cases/t00044_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -59,11 +59,13 @@ - +
- + + +
@@ -79,38 +81,46 @@
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
@@ -128,7 +138,7 @@
-
+ @@ -147,7 +157,7 @@ - + @@ -181,7 +191,7 @@ - + @@ -200,7 +210,7 @@ - + @@ -219,7 +229,7 @@ - + @@ -243,7 +253,7 @@ - + @@ -262,7 +272,7 @@ - + diff --git a/docs/test_cases/t00045.md b/docs/test_cases/t00045.md index d9817a1a..69271b20 100644 --- a/docs/test_cases/t00045.md +++ b/docs/test_cases/t00045.md @@ -463,7 +463,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00045_class.svg b/docs/test_cases/t00045_class.svg index 911a9a6b..81fe8d24 100644 --- a/docs/test_cases/t00045_class.svg +++ b/docs/test_cases/t00045_class.svg @@ -1,6 +1,6 @@ - + @@ -9,32 +9,32 @@ - - + + A - - + + AA - - + + AAA - - + + AAAA @@ -43,110 +43,110 @@ - + - + t : T - - + + ns1::A - - + + ns1::ns2::A - - + + ns1::ns2::B - - + + ns1::ns2::C - - + + ns1::ns2::D - - + + ns1::ns2::E - - + + ns1::ns2::AAA - - + + ns1::ns2::R - + - + foo(AA & aa) : void - + - + a : A * - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * diff --git a/docs/test_cases/t00045_class_mermaid.svg b/docs/test_cases/t00045_class_mermaid.svg index 33d2ca48..66bf6457 100644 --- a/docs/test_cases/t00045_class_mermaid.svg +++ b/docs/test_cases/t00045_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -98,11 +98,13 @@ - +
- + + +
@@ -152,11 +154,11 @@
- - + +
- +<> + +[friend]
@@ -164,7 +166,7 @@
- + @@ -183,7 +185,7 @@
- + @@ -202,7 +204,7 @@ - + @@ -221,7 +223,7 @@ - + @@ -245,7 +247,7 @@ - + @@ -264,7 +266,7 @@ - + @@ -283,7 +285,7 @@ - + @@ -302,7 +304,7 @@ - + @@ -321,7 +323,7 @@ - + @@ -340,7 +342,7 @@ - + @@ -359,7 +361,7 @@ - + @@ -378,7 +380,7 @@ - + diff --git a/docs/test_cases/t00046.md b/docs/test_cases/t00046.md index 41c3a812..fb7902a8 100644 --- a/docs/test_cases/t00046.md +++ b/docs/test_cases/t00046.md @@ -396,7 +396,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00046_class.svg b/docs/test_cases/t00046_class.svg index 176f7d42..9d767c7f 100644 --- a/docs/test_cases/t00046_class.svg +++ b/docs/test_cases/t00046_class.svg @@ -1,6 +1,6 @@ - + @@ -9,120 +9,120 @@ - + ns1 - + ns2 - - + + A - - + + A - - + + B - - + + C - - + + D - - + + E - - + + R - + - + foo(AA & aa) : void - + - + a : A * - + - + i : std::vector<std::uint8_t> - + - + ns1_a : ns1::A * - + - + ns1_ns2_a : ns1::ns2::A * - + - + root_a : ::A * - - + + A - - + + AA diff --git a/docs/test_cases/t00046_class_mermaid.svg b/docs/test_cases/t00046_class_mermaid.svg index 9b079680..7532e6f8 100644 --- a/docs/test_cases/t00046_class_mermaid.svg +++ b/docs/test_cases/t00046_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -97,11 +97,13 @@ - +
- + + +
@@ -152,7 +154,7 @@
- + @@ -171,7 +173,7 @@
- + @@ -190,7 +192,7 @@ - + @@ -209,7 +211,7 @@ - + @@ -228,7 +230,7 @@ - + @@ -247,7 +249,7 @@ - + @@ -266,7 +268,7 @@ - + @@ -285,7 +287,7 @@ - + @@ -304,7 +306,7 @@ - + diff --git a/docs/test_cases/t00047.md b/docs/test_cases/t00047.md index 3e44ff15..b0ec290e 100644 --- a/docs/test_cases/t00047.md +++ b/docs/test_cases/t00047.md @@ -194,7 +194,7 @@ using conditional = typename conditional_t::type; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00047_class.svg b/docs/test_cases/t00047_class.svg index 02837f88..833f0ad5 100644 --- a/docs/test_cases/t00047_class.svg +++ b/docs/test_cases/t00047_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + conditional_t @@ -19,8 +19,8 @@ - - + + conditional_t @@ -29,8 +29,8 @@ - - + + conditional_t @@ -39,8 +39,8 @@ - - + + conditional_t diff --git a/docs/test_cases/t00047_class_mermaid.svg b/docs/test_cases/t00047_class_mermaid.svg index f434bc56..208e4fea 100644 --- a/docs/test_cases/t00047_class_mermaid.svg +++ b/docs/test_cases/t00047_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -55,36 +55,42 @@ - +
- + + +
- +
- + + +
- +
- + + +
- + @@ -103,7 +109,7 @@
- + @@ -122,7 +128,7 @@
- + @@ -141,7 +147,7 @@ - + diff --git a/docs/test_cases/t00048.md b/docs/test_cases/t00048.md index 3e24087d..4cecca85 100644 --- a/docs/test_cases/t00048.md +++ b/docs/test_cases/t00048.md @@ -545,7 +545,7 @@ template struct BaseTemplate { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00048_class.svg b/docs/test_cases/t00048_class.svg index 91df6e20..566a2771 100644 --- a/docs/test_cases/t00048_class.svg +++ b/docs/test_cases/t00048_class.svg @@ -1,6 +1,6 @@ - + @@ -9,30 +9,30 @@ - - + + Base - + - + foo() = 0 : void - + - + base : int - - + + BaseTemplate @@ -40,45 +40,45 @@ T - + - + foo() = 0 : void - + - + base : T - - + + B - + - + foo() : void - + - + b : int - - + + BTemplate @@ -86,45 +86,45 @@ T - + - + foo() : void - + - + b : T - - + + A - + - + foo() : void - + - + a : int - - + + ATemplate @@ -132,19 +132,19 @@ T - + - + foo() : void - + - + a : T diff --git a/docs/test_cases/t00048_class_mermaid.svg b/docs/test_cases/t00048_class_mermaid.svg index 94192c15..927e203f 100644 --- a/docs/test_cases/t00048_class_mermaid.svg +++ b/docs/test_cases/t00048_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -94,7 +94,7 @@ - + @@ -123,7 +123,7 @@ - + @@ -152,7 +152,7 @@ - + @@ -181,7 +181,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -239,7 +239,7 @@ - + diff --git a/docs/test_cases/t00049.md b/docs/test_cases/t00049.md index 593f6a27..6c3b7f8b 100644 --- a/docs/test_cases/t00049.md +++ b/docs/test_cases/t00049.md @@ -327,7 +327,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00049_class.svg b/docs/test_cases/t00049_class.svg index 929353fa..ab3b8513 100644 --- a/docs/test_cases/t00049_class.svg +++ b/docs/test_cases/t00049_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -18,23 +18,23 @@ T - + - + get_a() : T & - + - + a : T - - + + A @@ -43,8 +43,8 @@ - - + + A @@ -53,8 +53,8 @@ - - + + A @@ -63,47 +63,47 @@ - - + + R - + - + get_int_map() : A<intmap> - + - + set_int_map(A<intmap> && int_map) : void - + - + a_int_map : A<intmap> - + - + a_string : A<thestring> - + - + a_vector_string : A<string_vector> diff --git a/docs/test_cases/t00049_class_mermaid.svg b/docs/test_cases/t00049_class_mermaid.svg index e1d131f9..5f7efdaf 100644 --- a/docs/test_cases/t00049_class_mermaid.svg +++ b/docs/test_cases/t00049_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -58,29 +58,35 @@ - +
- + + +
- +
- + + +
- +
- + + +
@@ -120,7 +126,7 @@
- + @@ -149,7 +155,7 @@
- + @@ -168,7 +174,7 @@
- + @@ -187,7 +193,7 @@ - + @@ -206,7 +212,7 @@ - + diff --git a/docs/test_cases/t00050.md b/docs/test_cases/t00050.md index 23de4c42..5521822e 100644 --- a/docs/test_cases/t00050.md +++ b/docs/test_cases/t00050.md @@ -65,7 +65,7 @@ diagrams: {% endfor %} {% endif %} - {# Render template paramete if any #} + {# Render template parameters if any #} {% if existsIn(e, "comment") and existsIn(e.comment, "tparam") %} {% set c=e.comment %} @@ -78,6 +78,32 @@ diagrams: {% endif %} {% endfor %} + mermaid: + after: + - | + note for {{ alias("NoSuchClass") }} "{{ comment("NoSuchClass").formatted }}" + - | + note for {{ alias("A") }} "{{ comment("clanguml::t00050::A").formatted }}" + - | + note for {{ element("clanguml::t00050::A").alias }} {% set e=element("clanguml::t00050::A") %} "{{ e.comment.formatted }}" + note for {{ alias("C") }} "{{ trim(comment("clanguml::t00050::C").text) }}" + {% set cmt=comment("clanguml::t00050::G").paragraph %} + note for {{ alias("G") }} "{{ trim(cmt.0) }}" + note for {{ alias("G") }} "{{ trim(cmt.1) }}" + note for {{ alias("G") }} "{{ trim(cmt.2) }}" + - | + {# Render brief comments and todos, if any were written for an element #} + {% for e in diagram.elements %} + {% if existsIn(e, "comment") and existsIn(e.comment, "brief") %} + note for {{ e.alias }} {% set c=e.comment %} "{{ c.brief.0 }}" + {% endif %} + {% if existsIn(e, "comment") and existsIn(e.comment, "todo") %} + {% set c=e.comment %} + {% for t in c.todo %} + note for {{ e.alias }} "**TODO** {{ t }}" + {% endfor %} + {% endif %} + {% endfor %} ``` ## Source code @@ -506,7 +532,7 @@ class NoComment { }; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00050_class.svg b/docs/test_cases/t00050_class.svg index deb1171c..8d95bb73 100644 --- a/docs/test_cases/t00050_class.svg +++ b/docs/test_cases/t00050_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + utils::D - - + + E @@ -52,8 +52,8 @@ E3 - - + + F @@ -62,43 +62,43 @@ - + - + t : T[N] - + - + v : V - - + + G - - + + NoComment - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit - + Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis vehicula class ultricies mollis dictumst, aenean non a in donec nulla. @@ -125,50 +125,50 @@ imperdiet praesent magnis ridiculus congue gravida curabitur dictum sagittis, enim et magna sit inceptos sodales parturient pharetra mollis, aenean vel nostra tellus commodo pretium sapien sociosqu. - + This is a short description of class G. - + This is an intermediate description of class G. - + This is a long description of class G. - + Lorem ipsum - + TODO 1. Write meaningful comment - + TODO 2. Write tests - + TODO 3. Implement - + Long comment example - + TODO Implement... - + Simple array wrapper. - + Template parameters diff --git a/docs/test_cases/t00050_class_mermaid.svg b/docs/test_cases/t00050_class_mermaid.svg index 979d2d64..406026a6 100644 --- a/docs/test_cases/t00050_class_mermaid.svg +++ b/docs/test_cases/t00050_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -49,10 +49,142 @@ - - + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
- + @@ -71,7 +203,7 @@
- + @@ -90,7 +222,7 @@
- + @@ -109,7 +241,7 @@ - + @@ -128,15 +260,15 @@ - + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -144,17 +276,17 @@ E - +
E1
- +
E2
- +
E3
@@ -162,7 +294,7 @@
- + @@ -191,7 +323,7 @@ - + @@ -210,7 +342,7 @@ - + @@ -229,6 +361,149 @@ + + + + + +
+ Lorem ipsum dolor sit +
+
+
+
+ + + + + +
+ Lorem ipsum dolor sit +
+
+
+
+ + + + + +
+ Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis
vehicula class ultricies mollis dictumst, aenean non a in donec nulla.
Phasellus ante pellentesque erat cum risus consequat imperdiet aliquam,
integer placerat et turpis mi eros nec lobortis taciti, vehicula nisl litora
tellus ligula porttitor metus.

Vivamus integer non suscipit taciti mus etiam at primis tempor sagittis sit,
euismod libero facilisi aptent elementum felis blandit cursus gravida sociis
erat ante, eleifend lectus nullam dapibus netus feugiat curae curabitur est
ad. Massa curae fringilla porttitor quam sollicitudin iaculis aptent leo
ligula euismod dictumst, orci penatibus mauris eros etiam praesent erat
volutpat posuere hac. Metus fringilla nec ullamcorper odio aliquam lacinia
conubia mauris tempor, etiam ultricies proin quisque lectus sociis id
tristique, integer phasellus taciti pretium adipiscing tortor sagittis
ligula.

Mollis pretium lorem primis senectus habitasse lectus scelerisque
donec, ultricies tortor suspendisse adipiscing fusce morbi volutpat
pellentesque, consectetur mi risus molestie curae malesuada cum. Dignissim
lacus convallis massa mauris enim ad mattis magnis senectus montes, mollis
taciti phasellus accumsan bibendum semper blandit suspendisse faucibus nibh
est, metus lobortis morbi cras magna vivamus per risus fermentum. Dapibus
imperdiet praesent magnis ridiculus congue gravida curabitur dictum
sagittis, enim et magna sit inceptos sodales parturient pharetra mollis,
aenean vel nostra tellus commodo pretium sapien sociosqu.
+
+
+
+
+ + + + + +
+ This is a short description of class G. +
+
+
+
+ + + + + +
+ This is an intermediate description of class G. +
+
+
+
+ + + + + +
+ This is a long description of class G. +
+
+
+
+ + + + + +
+ Lorem ipsum
+
+
+
+
+ + + + + +
+ **TODO** 1. Write meaningful comment

+
+
+
+
+ + + + + +
+ **TODO** 2. Write tests

+
+
+
+
+ + + + + +
+ **TODO** 3. Implement
+
+
+
+
+ + + + + +
+ Long comment example
+
+
+
+
+ + + + + +
+ **TODO** Implement...
+
+
+
+
+ + + + + +
+ Simple array wrapper.
+
+
+
+
diff --git a/docs/test_cases/t00051.md b/docs/test_cases/t00051.md index 1da67b36..84fa4d84 100644 --- a/docs/test_cases/t00051.md +++ b/docs/test_cases/t00051.md @@ -639,7 +639,7 @@ A::custom_thread2 A::start_thread2() } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00051_class.svg b/docs/test_cases/t00051_class.svg index 063a725f..1dc6236c 100644 --- a/docs/test_cases/t00051_class.svg +++ b/docs/test_cases/t00051_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + B @@ -18,125 +18,125 @@ F,FF=F - + - + B(F && f, FF && ff) : void - + - + f() : void - + - + ff() : void - + - + f_ : F - + - + ff_ : FF - - + + B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)> - + - + B((lambda at ../../tests/t00051/t00051.cc:43:18) && f, (lambda at ../../tests/t00051/t00051.cc:43:27) && ff) : void - + - + f() : void - + - + ff() : void - + - + f_ : (lambda at ../../tests/t00051/t00051.cc:43:18) - + - + ff_ : (lambda at ../../tests/t00051/t00051.cc:43:27) - - + + A - + - + get_function() : (lambda at ../../tests/t00051/t00051.cc:48:16) - + - + start_thread1() : custom_thread1 - + - + start_thread2() : custom_thread2 - + - + start_thread3() : B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at ../../tests/t00051/t00051.cc:43:27)> - - + + A::custom_thread1 @@ -145,18 +145,18 @@ custom_thread1<Function,Args...>(Function && f, Args &&... args) : void - - + + A::custom_thread2 - + - + thread((lambda at ../../tests/t00051/t00051.cc:59:27) &&) : void diff --git a/docs/test_cases/t00051_class_mermaid.svg b/docs/test_cases/t00051_class_mermaid.svg index 9c4e01fc..e2ab365c 100644 --- a/docs/test_cases/t00051_class_mermaid.svg +++ b/docs/test_cases/t00051_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,47 +50,51 @@ - - - - + + + + - + -
- -
-
-
-
- - - -
- -
-
-
-
- - -
- [nested] +
- - - + + +
- [nested] + + +
+
+
+
+ + + +
+ + + +
+
+
+
+ + + +
+ +
@@ -98,7 +102,7 @@
- + @@ -142,7 +146,7 @@ - + @@ -186,7 +190,7 @@ - + @@ -225,7 +229,7 @@ - + @@ -249,7 +253,7 @@ - + diff --git a/docs/test_cases/t00052.md b/docs/test_cases/t00052.md index f70437be..8f775e9b 100644 --- a/docs/test_cases/t00052.md +++ b/docs/test_cases/t00052.md @@ -398,7 +398,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00052_class.svg b/docs/test_cases/t00052_class.svg index 8ae3b728..e8a86c65 100644 --- a/docs/test_cases/t00052_class.svg +++ b/docs/test_cases/t00052_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -21,8 +21,8 @@ aa<F,Q>(F && f, Q q) : void - - + + B @@ -30,18 +30,18 @@ T - + - + b(T t) : T bb<F>(F && f, T t) : T - - + + C @@ -52,8 +52,8 @@ c<P>(P p) : T - - + + B @@ -62,8 +62,8 @@ - - + + C @@ -72,33 +72,33 @@ - - + + R - + - + a : A - + - + b : B<int> - + - + c : C<int> diff --git a/docs/test_cases/t00052_class_mermaid.svg b/docs/test_cases/t00052_class_mermaid.svg index 43421355..2567f37f 100644 --- a/docs/test_cases/t00052_class_mermaid.svg +++ b/docs/test_cases/t00052_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -57,20 +57,24 @@ - +
- + + +
- +
- + + +
@@ -110,7 +114,7 @@
- + @@ -139,7 +143,7 @@
- + @@ -168,7 +172,7 @@
- + @@ -192,7 +196,7 @@ - + @@ -211,7 +215,7 @@ - + @@ -230,7 +234,7 @@ - + diff --git a/docs/test_cases/t00053.md b/docs/test_cases/t00053.md index 1bd1de0d..33e2d666 100644 --- a/docs/test_cases/t00053.md +++ b/docs/test_cases/t00053.md @@ -420,7 +420,7 @@ enum class j { jjj }; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00053_class.svg b/docs/test_cases/t00053_class.svg index 46a522a6..9db7e650 100644 --- a/docs/test_cases/t00053_class.svg +++ b/docs/test_cases/t00053_class.svg @@ -1,6 +1,6 @@ - + @@ -9,72 +9,72 @@ - - + + A - - + + C - - + + E - - + + F - - + + a - - + + c - - + + e - - + + f - - + + h @@ -82,8 +82,8 @@ hhh - - + + j @@ -91,56 +91,56 @@ jjj - - + + b - - + + d - - + + g - - + + B - - + + D - - + + G - - + + i diff --git a/docs/test_cases/t00053_class_mermaid.svg b/docs/test_cases/t00053_class_mermaid.svg index 36915043..fd91ee76 100644 --- a/docs/test_cases/t00053_class_mermaid.svg +++ b/docs/test_cases/t00053_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -52,7 +52,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -166,15 +166,15 @@ - + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -182,7 +182,7 @@ i - +
iii
@@ -190,7 +190,7 @@
- + @@ -209,7 +209,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -247,7 +247,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -285,7 +285,7 @@ - + @@ -304,7 +304,7 @@ - + @@ -323,7 +323,7 @@ - + @@ -342,15 +342,15 @@ - + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -358,7 +358,7 @@ h - +
hhh
@@ -366,15 +366,15 @@
- + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -382,7 +382,7 @@ j - +
jjj
diff --git a/docs/test_cases/t00054.md b/docs/test_cases/t00054.md index 313708e7..31de9163 100644 --- a/docs/test_cases/t00054.md +++ b/docs/test_cases/t00054.md @@ -462,7 +462,7 @@ enum class j { jjj }; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00054_class.svg b/docs/test_cases/t00054_class.svg index 73f9a81b..48d3893c 100644 --- a/docs/test_cases/t00054_class.svg +++ b/docs/test_cases/t00054_class.svg @@ -1,6 +1,6 @@ - + @@ -9,28 +9,28 @@ - + detail - + detail2 - + detail3 - + detail4 - - + + d - - + + a @@ -40,8 +40,8 @@ - - + + c @@ -51,8 +51,8 @@ - - + + e @@ -62,40 +62,40 @@ - - + + C - - + + F - - + + D - - + + E - - + + A @@ -104,8 +104,8 @@ - - + + B @@ -114,8 +114,8 @@ - - + + f @@ -124,8 +124,8 @@ - - + + G @@ -133,8 +133,8 @@ - - + + h @@ -143,8 +143,8 @@ hhh - - + + i @@ -153,8 +153,8 @@ iii - - + + j @@ -163,16 +163,16 @@ jjj - - + + b - - + + g diff --git a/docs/test_cases/t00054_class_mermaid.svg b/docs/test_cases/t00054_class_mermaid.svg index 10857902..d7448a01 100644 --- a/docs/test_cases/t00054_class_mermaid.svg +++ b/docs/test_cases/t00054_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -52,7 +52,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -90,7 +90,7 @@
- + @@ -109,7 +109,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -166,7 +166,7 @@ - + @@ -185,7 +185,7 @@ - + @@ -204,7 +204,7 @@ - + @@ -223,7 +223,7 @@ - + @@ -242,7 +242,7 @@ - + @@ -261,7 +261,7 @@ - + @@ -280,15 +280,15 @@ - + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -296,7 +296,7 @@ detail4::h - +
hhh
@@ -304,15 +304,15 @@
- + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -320,7 +320,7 @@ detail4::i - +
iii
@@ -328,15 +328,15 @@
- + - - - + + + - +
- «Enumeration» + «enumeration»
@@ -344,7 +344,7 @@ detail4::j - +
jjj
@@ -352,7 +352,7 @@
- + @@ -371,7 +371,7 @@ - + diff --git a/docs/test_cases/t00055.md b/docs/test_cases/t00055.md index 81e27570..2b9f60a5 100644 --- a/docs/test_cases/t00055.md +++ b/docs/test_cases/t00055.md @@ -268,7 +268,7 @@ struct J { }; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00055_class.svg b/docs/test_cases/t00055_class.svg index 700fb3cc..26e90231 100644 --- a/docs/test_cases/t00055_class.svg +++ b/docs/test_cases/t00055_class.svg @@ -1,6 +1,6 @@ - + @@ -9,80 +9,80 @@ - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F - - + + G - - + + H - - + + I - - + + J diff --git a/docs/test_cases/t00055_class_mermaid.svg b/docs/test_cases/t00055_class_mermaid.svg index 7ea49863..505c337e 100644 --- a/docs/test_cases/t00055_class_mermaid.svg +++ b/docs/test_cases/t00055_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -52,7 +52,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -166,7 +166,7 @@ - + @@ -185,7 +185,7 @@ - + @@ -204,7 +204,7 @@ - + @@ -223,7 +223,7 @@ - + diff --git a/docs/test_cases/t00056.md b/docs/test_cases/t00056.md index 7e34c271..a22dc9b6 100644 --- a/docs/test_cases/t00056.md +++ b/docs/test_cases/t00056.md @@ -608,7 +608,7 @@ struct F { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00056_class.svg b/docs/test_cases/t00056_class.svg index c9a23da9..e44e2ce1 100644 --- a/docs/test_cases/t00056_class.svg +++ b/docs/test_cases/t00056_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + «concept» @@ -20,8 +20,8 @@ - - + + «concept» @@ -33,8 +33,8 @@ sizeof (l) > sizeof (r) - - + + «concept» @@ -44,8 +44,8 @@ - - + + «concept» @@ -58,8 +58,8 @@ container.begin() container.end() - - + + «concept» @@ -71,8 +71,8 @@ typename T::value_type - - + + «concept» @@ -86,8 +86,8 @@ {std::to_string(s)} noexcept {std::to_string(s)} -> std::same_as<std::string> - - + + «concept» @@ -97,8 +97,8 @@ - - + + «concept» @@ -108,8 +108,8 @@ - - + + A @@ -118,15 +118,15 @@ - + - + a : T - - + + B @@ -135,15 +135,15 @@ - + - + b : T - - + + C @@ -152,15 +152,15 @@ - + - + c : T - - + + D @@ -169,8 +169,8 @@ - - + + E @@ -179,29 +179,29 @@ - + - + e1 : T1 - + - + e2 : T2 - + - + e3 : T3 - - + + F @@ -210,25 +210,25 @@ - + - + f1 : T1 - + - + f2 : T2 - + - + f3 : T3 diff --git a/docs/test_cases/t00056_class_mermaid.svg b/docs/test_cases/t00056_class_mermaid.svg index e442788c..266f71ce 100644 --- a/docs/test_cases/t00056_class_mermaid.svg +++ b/docs/test_cases/t00056_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -222,7 +222,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -270,7 +270,7 @@ - + @@ -289,7 +289,7 @@ - + @@ -323,7 +323,7 @@ - + @@ -352,7 +352,7 @@ - + @@ -391,7 +391,7 @@ - + @@ -410,7 +410,7 @@ - + @@ -429,7 +429,7 @@ - + @@ -453,7 +453,7 @@ - + @@ -477,7 +477,7 @@ - + @@ -501,7 +501,7 @@ - + @@ -520,7 +520,7 @@ - + @@ -554,7 +554,7 @@ - + diff --git a/docs/test_cases/t00057.md b/docs/test_cases/t00057.md index 1d3a56ac..e78d1cd4 100644 --- a/docs/test_cases/t00057.md +++ b/docs/test_cases/t00057.md @@ -552,7 +552,7 @@ struct t00057_R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00057_class.svg b/docs/test_cases/t00057_class.svg index 73e936bd..efe5d381 100644 --- a/docs/test_cases/t00057_class.svg +++ b/docs/test_cases/t00057_class.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - + + t00057_A - + - + a1 : int - - + + t00057_B - + - + b1 : int - - + + t00057_C - + - + c1 : int - - + + «union» @@ -63,73 +63,73 @@ - + - + d1 : int - + - + d2 : float - - + + t00057_E - + - + coordinates : t00057_E::(anonymous_739) - + - + e : int - + - + height : t00057_E::(anonymous_807) - - + + t00057_E::(coordinates) - + - + x : int - + - + y : int - - + + «union» @@ -137,105 +137,105 @@ - + - + t : double - + - + z : int - - + + t00057_G - + - + g1 : int - - + + t00057_R - + - + a : struct t00057_A - + - + b : t00057_B - + - + c : struct t00057_C * - + - + d : union t00057_D - + - + e : struct t00057_E * - + - + f : struct t00057_F * - + - + g : struct t00057_G * - - + + t00057_F - + - + f1 : int diff --git a/docs/test_cases/t00057_class_mermaid.svg b/docs/test_cases/t00057_class_mermaid.svg index 64d0b5a8..6a87930f 100644 --- a/docs/test_cases/t00057_class_mermaid.svg +++ b/docs/test_cases/t00057_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -162,7 +162,7 @@ - + @@ -186,7 +186,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -234,7 +234,7 @@ - + @@ -263,7 +263,7 @@ - + @@ -297,7 +297,7 @@ - + @@ -326,7 +326,7 @@ - + @@ -355,7 +355,7 @@ - + @@ -379,7 +379,7 @@ - + @@ -433,7 +433,7 @@ - + diff --git a/docs/test_cases/t00058.md b/docs/test_cases/t00058.md index 70872c16..96908e3f 100644 --- a/docs/test_cases/t00058.md +++ b/docs/test_cases/t00058.md @@ -435,7 +435,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00058_class.svg b/docs/test_cases/t00058_class.svg index bf2653c7..211b66b3 100644 --- a/docs/test_cases/t00058_class.svg +++ b/docs/test_cases/t00058_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + first_type @@ -19,8 +19,8 @@ - - + + «concept» @@ -30,8 +30,8 @@ - - + + A @@ -40,15 +40,15 @@ - + - + a : std::vector<T> - - + + B @@ -57,22 +57,22 @@ - + - + b : std::vector<T> - + - + bb : P - - + + A @@ -81,8 +81,8 @@ - - + + A @@ -91,8 +91,8 @@ - - + + B @@ -101,26 +101,26 @@ - - + + R - + - + aa : A<int,int,double,std::string> - + - + bb : B<int,std::string,int,double,A<int,int>> diff --git a/docs/test_cases/t00058_class_mermaid.svg b/docs/test_cases/t00058_class_mermaid.svg index ac57cb03..346b04e6 100644 --- a/docs/test_cases/t00058_class_mermaid.svg +++ b/docs/test_cases/t00058_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -82,38 +82,46 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
@@ -142,7 +150,7 @@
- + @@ -161,7 +169,7 @@
- + @@ -180,7 +188,7 @@ - + @@ -204,7 +212,7 @@ - + @@ -233,7 +241,7 @@ - + @@ -252,7 +260,7 @@ - + @@ -271,7 +279,7 @@ - + @@ -290,7 +298,7 @@ - + diff --git a/docs/test_cases/t00059.md b/docs/test_cases/t00059.md index ac9b31fb..cd88e72e 100644 --- a/docs/test_cases/t00059.md +++ b/docs/test_cases/t00059.md @@ -647,7 +647,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00059_class.svg b/docs/test_cases/t00059_class.svg index 78db0541..e3c9f2d5 100644 --- a/docs/test_cases/t00059_class.svg +++ b/docs/test_cases/t00059_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + «concept» @@ -23,8 +23,8 @@ T{} t.get_name() - - + + «concept» @@ -36,8 +36,8 @@ t.get_sweetness() - - + + «concept» @@ -49,96 +49,96 @@ t.get_bitterness() - - + + gala_apple - + - + get_name() const : std::string - + - + get_sweetness() const : float - - + + empire_apple - + - + get_name() const : std::string - + - + get_sweetness() const : float - - + + lima_orange - + - + get_bitterness() const : float - + - + get_name() const : std::string - - + + valencia_orange - + - + get_bitterness() const : float - + - + get_name() const : std::string - - + + fruit_factory @@ -146,23 +146,23 @@ apple_c TA,orange_c TO - + - + create_apple() const : TA - + - + create_orange() const : TO - - + + fruit_factory @@ -171,8 +171,8 @@ - - + + fruit_factory @@ -181,26 +181,26 @@ - - + + R - + - + factory_1 : fruit_factory_1 - + - + factory_2 : fruit_factory_2 diff --git a/docs/test_cases/t00059_class_mermaid.svg b/docs/test_cases/t00059_class_mermaid.svg index 598de6f5..1815e9cf 100644 --- a/docs/test_cases/t00059_class_mermaid.svg +++ b/docs/test_cases/t00059_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,21 +50,21 @@ - - - - - - - - - - - - + + + + + + + + + + + + - +
@@ -75,7 +75,7 @@ - +
@@ -86,7 +86,7 @@ - +
@@ -97,7 +97,7 @@ - +
@@ -108,61 +108,73 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
@@ -173,7 +185,7 @@ - +
@@ -186,7 +198,7 @@ - + @@ -220,7 +232,7 @@ - + @@ -249,7 +261,7 @@ - + @@ -278,11 +290,11 @@ - + - - - + + +
@@ -294,24 +306,24 @@ gala_apple
- +
- +get_name() : std::string + +get_name() : [const] std::string
- +
- +get_sweetness() : float + +get_sweetness() : [const] float
- + - - - + + +
@@ -323,24 +335,24 @@ empire_apple
- +
- +get_name() : std::string + +get_name() : [const] std::string
- +
- +get_sweetness() : float + +get_sweetness() : [const] float
- + - - - + + +
@@ -352,24 +364,24 @@ lima_orange
- +
- +get_bitterness() : float + +get_bitterness() : [const] float
- +
- +get_name() : std::string + +get_name() : [const] std::string
- + - - - + + +
@@ -381,20 +393,20 @@ valencia_orange
- +
- +get_bitterness() : float + +get_bitterness() : [const] float
- +
- +get_name() : std::string + +get_name() : [const] std::string
- + @@ -410,20 +422,20 @@ fruit_factory<apple_c TA,orange_c TO>
- +
- +create_apple() : TA + +create_apple() : [const] TA
- +
- +create_orange() : TO + +create_orange() : [const] TO
- + @@ -442,7 +454,7 @@
- + @@ -461,7 +473,7 @@ - + diff --git a/docs/test_cases/t00060.md b/docs/test_cases/t00060.md index e1fb78b0..e61d106c 100644 --- a/docs/test_cases/t00060.md +++ b/docs/test_cases/t00060.md @@ -276,7 +276,7 @@ template struct H : public G { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00060_class.svg b/docs/test_cases/t00060_class.svg index 1e463841..26bf27a9 100644 --- a/docs/test_cases/t00060_class.svg +++ b/docs/test_cases/t00060_class.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - - + + B - - + + C - - + + D - - + + G @@ -51,15 +51,15 @@ - + - + g : T - - + + H @@ -68,18 +68,18 @@ - + - + h : G<T> - + - + hh : P diff --git a/docs/test_cases/t00060_class_mermaid.svg b/docs/test_cases/t00060_class_mermaid.svg index 695cc8e3..becd2acf 100644 --- a/docs/test_cases/t00060_class_mermaid.svg +++ b/docs/test_cases/t00060_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -116,7 +116,7 @@ - + @@ -135,7 +135,7 @@ - + @@ -154,7 +154,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -192,7 +192,7 @@ - + @@ -216,7 +216,7 @@ - + diff --git a/docs/test_cases/t00061.md b/docs/test_cases/t00061.md index 1b36841c..724a81fc 100644 --- a/docs/test_cases/t00061.md +++ b/docs/test_cases/t00061.md @@ -65,7 +65,7 @@ struct C { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00061_class.svg b/docs/test_cases/t00061_class.svg index d774201d..8046e1bc 100644 --- a/docs/test_cases/t00061_class.svg +++ b/docs/test_cases/t00061_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A diff --git a/docs/test_cases/t00061_class_mermaid.svg b/docs/test_cases/t00061_class_mermaid.svg index 391fd60b..49afa2f4 100644 --- a/docs/test_cases/t00061_class_mermaid.svg +++ b/docs/test_cases/t00061_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t00062.md b/docs/test_cases/t00062.md index 1ed843b8..41d848ac 100644 --- a/docs/test_cases/t00062.md +++ b/docs/test_cases/t00062.md @@ -1372,7 +1372,7 @@ struct A> { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00062_class.svg b/docs/test_cases/t00062_class.svg index ab0031a9..c2263d8e 100644 --- a/docs/test_cases/t00062_class.svg +++ b/docs/test_cases/t00062_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A @@ -19,15 +19,15 @@ - + - + u : U & - - + + A @@ -36,15 +36,15 @@ - + - + u : U & - - + + A @@ -53,8 +53,8 @@ - - + + A @@ -63,15 +63,15 @@ - + - + u : U ** - - + + A @@ -80,15 +80,15 @@ - + - + u : U *** - - + + A @@ -97,15 +97,15 @@ - + - + u : U *** - - + + A @@ -114,15 +114,15 @@ - + - + u : U && - - + + A @@ -131,15 +131,15 @@ - + - + u : const U & - - + + A @@ -148,22 +148,22 @@ - + - + c : C & - + - + m : M C::* - - + + A @@ -172,22 +172,22 @@ - + - + c : C && - + - + m : M C::* - - + + A @@ -196,22 +196,22 @@ - + - + c : C & - + - + m : M C::* - - + + A @@ -220,15 +220,15 @@ - + - + c : C & - - + + A @@ -237,22 +237,22 @@ - + - + c : C && - + - + m : M C::* - - + + A @@ -261,22 +261,22 @@ - + - + c : C && - + - + mf : float C::* - - + + A @@ -285,22 +285,22 @@ - + - + c : C & - + - + m : M C::* - - + + A @@ -309,15 +309,15 @@ - + - + n : char[N] - - + + A @@ -326,15 +326,15 @@ - + - + n : std::vector<char> - - + + A @@ -343,15 +343,15 @@ - + - + klm : char[K][L][M] - - + + A @@ -360,15 +360,15 @@ - + - + u : bool - - + + A @@ -377,15 +377,15 @@ - + - + c : C<T> - - + + A @@ -394,22 +394,22 @@ - + - + args : std::tuple<Args...> - + - + c : C<T> - - + + A diff --git a/docs/test_cases/t00062_class_mermaid.svg b/docs/test_cases/t00062_class_mermaid.svg index 77bd43c5..3cdf9b07 100644 --- a/docs/test_cases/t00062_class_mermaid.svg +++ b/docs/test_cases/t00062_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -73,198 +73,240 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- + @@ -288,7 +330,7 @@
- + @@ -312,7 +354,7 @@
- + @@ -331,7 +373,7 @@
- + @@ -355,7 +397,7 @@
- + @@ -379,7 +421,7 @@ - + @@ -403,7 +445,7 @@ - + @@ -427,7 +469,7 @@ - + @@ -451,7 +493,7 @@ - + @@ -480,7 +522,7 @@ - + @@ -509,7 +551,7 @@ - + @@ -538,7 +580,7 @@ - + @@ -562,7 +604,7 @@ - + @@ -591,7 +633,7 @@ - + @@ -620,7 +662,7 @@ - + @@ -649,7 +691,7 @@ - + @@ -673,7 +715,7 @@ - + @@ -697,7 +739,7 @@ - + @@ -721,7 +763,7 @@ - + @@ -745,7 +787,7 @@ - + @@ -769,7 +811,7 @@ - + @@ -798,7 +840,7 @@ - + diff --git a/docs/test_cases/t00063.md b/docs/test_cases/t00063.md index 53fbd872..03b95889 100644 --- a/docs/test_cases/t00063.md +++ b/docs/test_cases/t00063.md @@ -63,7 +63,7 @@ enum class C { c1, c2, c3 }; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00063_class.svg b/docs/test_cases/t00063_class.svg index 245aa97b..7a9af6e7 100644 --- a/docs/test_cases/t00063_class.svg +++ b/docs/test_cases/t00063_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + A diff --git a/docs/test_cases/t00063_class_mermaid.svg b/docs/test_cases/t00063_class_mermaid.svg index 2d231a62..24fc7691 100644 --- a/docs/test_cases/t00063_class_mermaid.svg +++ b/docs/test_cases/t00063_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t00064.md b/docs/test_cases/t00064.md index a1dcf8f9..17a44423 100644 --- a/docs/test_cases/t00064.md +++ b/docs/test_cases/t00064.md @@ -1036,7 +1036,7 @@ public: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00064_class.svg b/docs/test_cases/t00064_class.svg index 330d236b..93506a95 100644 --- a/docs/test_cases/t00064_class.svg +++ b/docs/test_cases/t00064_class.svg @@ -1,6 +1,6 @@ - + @@ -9,8 +9,8 @@ - - + + type_list @@ -19,8 +19,8 @@ - - + + type_list @@ -29,8 +29,8 @@ - - + + type_list @@ -39,8 +39,8 @@ - - + + type_list @@ -49,8 +49,8 @@ - - + + head @@ -59,8 +59,8 @@ - - + + type_list @@ -69,8 +69,8 @@ - - + + type_list @@ -79,8 +79,8 @@ - - + + type_list @@ -89,8 +89,8 @@ - - + + type_group_pair @@ -99,15 +99,15 @@ - + - + size : const size_t - - + + optional_ref @@ -116,8 +116,8 @@ - - + + optional_ref @@ -126,8 +126,8 @@ - - + + type_group_pair_it @@ -135,54 +135,54 @@ It,type_list<First...>,type_list<Second...> - + - + find(const value_type & v) constexpr : unsigned int - + - + get(unsigned int i) : ref_t - + - + getp(unsigned int i) : const value_type * - - + + A - - + + B - - + + C - - + + type_list @@ -191,8 +191,8 @@ - - + + type_list @@ -201,8 +201,8 @@ - - + + type_list @@ -211,8 +211,8 @@ - - + + type_group_pair @@ -221,30 +221,30 @@ - - + + R - + - + abc : type_group_pair<type_list<float,double>,type_list<A,B,C>> - + - + aboolint : type_list<A,bool,int> - - + + type_group_pair @@ -253,8 +253,8 @@ - - + + type_group_pair_it @@ -263,8 +263,8 @@ - - + + head diff --git a/docs/test_cases/t00064_class_mermaid.svg b/docs/test_cases/t00064_class_mermaid.svg index 298d8a14..65fe6b68 100644 --- a/docs/test_cases/t00064_class_mermaid.svg +++ b/docs/test_cases/t00064_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -80,236 +80,288 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
@@ -338,7 +390,7 @@
- + @@ -357,7 +409,7 @@
- + @@ -376,7 +428,7 @@
- + @@ -395,7 +447,7 @@
- + @@ -414,7 +466,7 @@
- + @@ -433,7 +485,7 @@ - + @@ -452,7 +504,7 @@ - + @@ -471,7 +523,7 @@ - + @@ -490,7 +542,7 @@ - + @@ -514,7 +566,7 @@ - + @@ -533,7 +585,7 @@ - + @@ -552,7 +604,7 @@ - + @@ -568,9 +620,9 @@ type_group_pair_it<It,type_list<First...>,type_list<Second...>>
- +
- +find(const value_type & v) : unsigned int + +find(const value_type & v) : [constexpr] unsigned int
@@ -586,7 +638,7 @@
- + @@ -605,7 +657,7 @@
- + @@ -624,7 +676,7 @@
- + @@ -643,7 +695,7 @@
- + @@ -662,7 +714,7 @@
- + @@ -681,7 +733,7 @@
- + @@ -700,7 +752,7 @@
- + @@ -719,7 +771,7 @@
- + @@ -748,7 +800,7 @@ - + @@ -767,7 +819,7 @@ - + @@ -786,7 +838,7 @@ - + diff --git a/docs/test_cases/t00065.md b/docs/test_cases/t00065.md index 436d083e..ab3dc08b 100644 --- a/docs/test_cases/t00065.md +++ b/docs/test_cases/t00065.md @@ -529,7 +529,7 @@ struct R { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00065_class.svg b/docs/test_cases/t00065_class.svg index f67bdc18..52bbbb45 100644 --- a/docs/test_cases/t00065_class.svg +++ b/docs/test_cases/t00065_class.svg @@ -1,6 +1,6 @@ - + @@ -9,20 +9,20 @@ - + module1 - + submodule1a - + module2 - + concepts - - + + ABC @@ -32,8 +32,8 @@ c - - + + XYZ @@ -43,68 +43,68 @@ z - - + + A - + - + abc : ABC - + - + pimpl : detail::AImpl * - + - + xyz : XYZ - - + + AImpl - - + + B - + - + B() = default : void - + - + b() : void - - + + C @@ -113,15 +113,15 @@ - + - + t : T * - - + + C @@ -130,8 +130,8 @@ - - + + D @@ -140,22 +140,22 @@ - + - + c : C<int> - + - + t : T - - + + C @@ -164,8 +164,8 @@ - - + + D @@ -174,8 +174,8 @@ - - + + «concept» @@ -186,33 +186,33 @@ T{} t.b() - - + + R - + - + a : A * - + - + c : C<B> - + - + d : D<B> diff --git a/docs/test_cases/t00065_class_mermaid.svg b/docs/test_cases/t00065_class_mermaid.svg index ab12010b..a2039cd3 100644 --- a/docs/test_cases/t00065_class_mermaid.svg +++ b/docs/test_cases/t00065_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -50,22 +50,22 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - +
@@ -76,7 +76,7 @@ - +
@@ -87,7 +87,7 @@ - +
@@ -98,16 +98,18 @@ - +
- + + +
- +
@@ -118,7 +120,7 @@ - +
@@ -129,43 +131,51 @@ - +
- + + +
- +
- + + +
- +
- + + +
- +
- + + +
- +
@@ -176,7 +186,7 @@ - + - +
x
- +
y
- +
z
@@ -287,7 +297,7 @@
- + @@ -321,7 +331,7 @@
- + @@ -355,11 +365,11 @@ - + - - - + + +
@@ -371,12 +381,12 @@ B
- +
- +B() : void + +B() : [default] void
- +
+b() : void
@@ -384,7 +394,7 @@
- + @@ -408,7 +418,7 @@ - + @@ -427,7 +437,7 @@ - + @@ -456,7 +466,7 @@ - + @@ -475,7 +485,7 @@ - + @@ -494,7 +504,7 @@ - + diff --git a/docs/test_cases/t00066.md b/docs/test_cases/t00066.md index 7fdca228..08b3e952 100644 --- a/docs/test_cases/t00066.md +++ b/docs/test_cases/t00066.md @@ -804,7 +804,7 @@ int A::static_int = 1; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00066_class.svg b/docs/test_cases/t00066_class.svg index 2cb5241a..d0986656 100644 --- a/docs/test_cases/t00066_class.svg +++ b/docs/test_cases/t00066_class.svg @@ -1,6 +1,6 @@ - + @@ -9,222 +9,222 @@ - - + + A - + - + public_member : int - + - + protected_member : int - + - + private_member : int - + - + a_ : int - + - + b_ : int - + - + c_ : int - + - + static_int : int - + - + static_const_int : const int - + - + auto_member : const unsigned long - + - + A() = default : void - + - + A(int i) : void - + - + A(A &&) = default : void - + - + A(const A &) = deleted : void - + - + ~A() = default : void - + - + basic_method() : void - + - + static_method() : int - + - + const_method() const : void - + - + auto_method() : int - + - + operator++() : A & - + - + operator=(A && other) noexcept : A & - + - + operator=(A & other) noexcept : A & - + - + size() const : std::size_t - + - + double_int(const int i) : int - + - + sum(const double a, const double b) : int - + - + default_int(int i = 12) : int - + - + default_string(int i, std::string s = "abc") : std::string - + - + create_from_int(int i) : A - + - + protected_method() : void - + - + private_method() : void - + - + compare : std::function<bool (const int)> diff --git a/docs/test_cases/t00066_class_mermaid.svg b/docs/test_cases/t00066_class_mermaid.svg index 562efbe5..e9d56351 100644 --- a/docs/test_cases/t00066_class_mermaid.svg +++ b/docs/test_cases/t00066_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -52,7 +52,7 @@ - + @@ -118,9 +118,9 @@ +auto_member : const unsigned long
- +
- +A() : void + +A() : [default] void
@@ -128,9 +128,9 @@ +A(int i) : void
- +
- +A(A &&) : void + +A(A &&) : [default] void
@@ -138,9 +138,9 @@ +A(const A &) : void
- +
- +~A() : void + +~A() : [default] void
@@ -153,9 +153,9 @@ +static_method() : int
- +
- +const_method() : void + +const_method() : [const] void
@@ -178,9 +178,9 @@ +operator=(A & other) : A &
- +
- +size() : std::size_t + +size() : [const] std::size_t
diff --git a/docs/test_cases/t00067.md b/docs/test_cases/t00067.md index d512681a..05dafd12 100644 --- a/docs/test_cases/t00067.md +++ b/docs/test_cases/t00067.md @@ -527,7 +527,7 @@ int A::static_int = 1; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t00067_class.svg b/docs/test_cases/t00067_class.svg index 84b32a72..b21c7d5a 100644 --- a/docs/test_cases/t00067_class.svg +++ b/docs/test_cases/t00067_class.svg @@ -1,6 +1,6 @@ - + @@ -9,152 +9,152 @@ - - + + A - + - + auto_method() : int - + - + basic_method() : void - + - + const_method() const : void - + - + default_int(int i = 12) : int - + - + default_string(int i, std::string s = "abc") : std::string - + - + double_int(const int i) : int - + - + private_method() : void - + - + protected_method() : void - + - + size() const : std::size_t - + - + sum(const double a, const double b) : int - + - + a_ : int - + - + auto_member : const unsigned long - + - + b_ : int - + - + c_ : int - + - + compare : std::function<bool (const int)> - + - + private_member : int - + - + protected_member : int - + - + public_member : int - + - + static_const_int : const int - + - + static_int : int diff --git a/docs/test_cases/t00067_class_mermaid.svg b/docs/test_cases/t00067_class_mermaid.svg index 04a80ad4..1a3b9c63 100644 --- a/docs/test_cases/t00067_class_mermaid.svg +++ b/docs/test_cases/t00067_class_mermaid.svg @@ -1,4 +1,4 @@ - + @@ -52,7 +52,7 @@ - + @@ -128,9 +128,9 @@ +basic_method() : void
- +
- +const_method() : void + +const_method() : [const] void
@@ -158,9 +158,9 @@ #protected_method() : void - +
- +size() : std::size_t + +size() : [const] std::size_t
diff --git a/docs/test_cases/t20001.md b/docs/test_cases/t20001.md index 211dd779..c9f1d71a 100644 --- a/docs/test_cases/t20001.md +++ b/docs/test_cases/t20001.md @@ -23,6 +23,11 @@ diagrams: - "' t20001 test diagram of type {{ diagram.type }}" after: - '{% set e=element("clanguml::t20001::tmain()") %} note over {{ e.alias) }}: Main test function' + mermaid: + before: + - "%% t20001 test diagram of type {{ diagram.type }}" + after: + - '{% set e=element("clanguml::t20001::tmain()") %} Note over {{ e.alias) }}: Main test function' ``` ## Source code @@ -110,7 +115,7 @@ int tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20001_sequence.svg b/docs/test_cases/t20001_sequence.svg index 69772616..5b3cabeb 100644 --- a/docs/test_cases/t20001_sequence.svg +++ b/docs/test_cases/t20001_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,73 +9,73 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - - - + + + + + + + + + + A() - + B(A &) - + add(int,int) - + wrap_add3(int,int,int) - + add3(int,int,int) - + @@ -86,7 +86,7 @@ - + @@ -95,14 +95,14 @@ - + log_result(int) - + Main test function diff --git a/docs/test_cases/t20001_sequence_mermaid.svg b/docs/test_cases/t20001_sequence_mermaid.svg index 8f0edbdc..686a956b 100644 --- a/docs/test_cases/t20001_sequence_mermaid.svg +++ b/docs/test_cases/t20001_sequence_mermaid.svg @@ -1,24 +1,24 @@ - + - - + + B - - + + A - - + + tmain() - + @@ -27,7 +27,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -109,6 +109,12 @@ + + + + Main test function + + A() B(A &) diff --git a/docs/test_cases/t20002.md b/docs/test_cases/t20002.md index 4f9c61c0..f78af2b5 100644 --- a/docs/test_cases/t20002.md +++ b/docs/test_cases/t20002.md @@ -47,7 +47,7 @@ void m1() { m2(); } { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20002_sequence.svg b/docs/test_cases/t20002_sequence.svg index 6080168e..f347da46 100644 --- a/docs/test_cases/t20002_sequence.svg +++ b/docs/test_cases/t20002_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1() - + m1() - - + + m2() - + m2() - - + + m3() - + m3() - - + + m4() - + m4() - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20002_sequence_mermaid.svg b/docs/test_cases/t20002_sequence_mermaid.svg index b759ec7c..856d0a45 100644 --- a/docs/test_cases/t20002_sequence_mermaid.svg +++ b/docs/test_cases/t20002_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20003.md b/docs/test_cases/t20003.md index 8af703a6..63b12e20 100644 --- a/docs/test_cases/t20003.md +++ b/docs/test_cases/t20003.md @@ -43,7 +43,7 @@ template void m1(T p) { m2(p); } { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20003_sequence.svg b/docs/test_cases/t20003_sequence.svg index 7c0be285..8a9dfb0b 100644 --- a/docs/test_cases/t20003_sequence.svg +++ b/docs/test_cases/t20003_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,51 +9,51 @@ - - - - + + + + - - + + m1<T>(T) - + m1<T>(T) - - + + m2<T>(T) - + m2<T>(T) - - + + m3<T>(T) - + m3<T>(T) - - + + m4<T>(T) - + m4<T>(T) - - - - - + + + + + - + - + diff --git a/docs/test_cases/t20003_sequence_mermaid.svg b/docs/test_cases/t20003_sequence_mermaid.svg index a018550c..6541cbff 100644 --- a/docs/test_cases/t20003_sequence_mermaid.svg +++ b/docs/test_cases/t20003_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20004.md b/docs/test_cases/t20004.md index 8da5ead5..a6556ab6 100644 --- a/docs/test_cases/t20004.md +++ b/docs/test_cases/t20004.md @@ -79,7 +79,7 @@ int main() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20004_sequence.svg b/docs/test_cases/t20004_sequence.svg index 5ad0e1e9..0be1623b 100644 --- a/docs/test_cases/t20004_sequence.svg +++ b/docs/test_cases/t20004_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,16 +9,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -29,87 +29,87 @@ - - + + main() - + main() - - + + m1<float>(float) - + m1<float>(float) - - + + m1<unsigned long>(unsigned long) - + m1<unsigned long>(unsigned long) - - + + m4<unsigned long>(unsigned long) - + m4<unsigned long>(unsigned long) - - + + m1<std::string>(std::string) - + m1<std::string>(std::string) - - + + m2<std::string>(std::string) - + m2<std::string>(std::string) - - + + m1<int>(int) - + m1<int>(int) - - + + m2<int>(int) - + m2<int>(int) - - + + m3<int>(int) - + m3<int>(int) - - + + m4<int>(int) - + m4<int>(int) - - - - - - - - - - - + + + + + + + + + + + - + - + @@ -117,11 +117,11 @@ - + - + @@ -129,19 +129,19 @@ - + - + - + - + diff --git a/docs/test_cases/t20004_sequence_mermaid.svg b/docs/test_cases/t20004_sequence_mermaid.svg index 6d8e9e91..20b66b63 100644 --- a/docs/test_cases/t20004_sequence_mermaid.svg +++ b/docs/test_cases/t20004_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20005.md b/docs/test_cases/t20005.md index a38c8461..915bdf02 100644 --- a/docs/test_cases/t20005.md +++ b/docs/test_cases/t20005.md @@ -50,7 +50,7 @@ template struct C { { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20005_sequence.svg b/docs/test_cases/t20005_sequence.svg index 9b5f1ba1..613d48b9 100644 --- a/docs/test_cases/t20005_sequence.svg +++ b/docs/test_cases/t20005_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - + + + - - + + C<T> - + C<T> - - + + B<T> - + B<T> - - + + A<T> - + A<T> - - - + + + c(T) - + b(T) - + a(T) diff --git a/docs/test_cases/t20005_sequence_mermaid.svg b/docs/test_cases/t20005_sequence_mermaid.svg index 8bb98453..63cb6780 100644 --- a/docs/test_cases/t20005_sequence_mermaid.svg +++ b/docs/test_cases/t20005_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20006.md b/docs/test_cases/t20006.md index cd7307bb..7b407bea 100644 --- a/docs/test_cases/t20006.md +++ b/docs/test_cases/t20006.md @@ -108,7 +108,7 @@ void tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20006_sequence.svg b/docs/test_cases/t20006_sequence.svg index a43a354f..8bcb06fa 100644 --- a/docs/test_cases/t20006_sequence.svg +++ b/docs/test_cases/t20006_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,24 +9,24 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -36,84 +36,84 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + BB<int,std::string> - + BB<int,std::string> - - + + BB<int,float> - + BB<int,float> - - + + BB<int,int> - + BB<int,int> - - + + AA<int> - + AA<int> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + b(int) - + a1(int) @@ -122,12 +122,12 @@ - + b(std::string) - + a2(std::string) @@ -136,69 +136,69 @@ - + BB(AA<int> *) - + BB(AA<int> &) - + bb1(int,int) - + aa1(int) - + bb2(int,int) - + aa2(int) - + bb1(int,std::string) - + aa2(int) - + bb2(int,std::string) - + aa1(int) - + bb1(int,float) - + bb2(int,float) - + aa2(int) diff --git a/docs/test_cases/t20006_sequence_mermaid.svg b/docs/test_cases/t20006_sequence_mermaid.svg index e09f86e5..33f9eca7 100644 --- a/docs/test_cases/t20006_sequence_mermaid.svg +++ b/docs/test_cases/t20006_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20007.md b/docs/test_cases/t20007.md index 57060d56..5bff624d 100644 --- a/docs/test_cases/t20007.md +++ b/docs/test_cases/t20007.md @@ -54,7 +54,7 @@ void tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20007_sequence.svg b/docs/test_cases/t20007_sequence.svg index d38bf8db..550854f6 100644 --- a/docs/test_cases/t20007_sequence.svg +++ b/docs/test_cases/t20007_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,57 +9,57 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + Adder<int,int> - + Adder<int,int> - - + + Adder<int,float,double> - + Adder<int,float,double> - - + + Adder<std::string,std::string,std::string> - + Adder<std::string,std::string,std::string> - - - - - + + + + + add(int &&,int &&) - + add(int &&,float &&,double &&) - + add(std::string &&,std::string &&,std::string &&) diff --git a/docs/test_cases/t20007_sequence_mermaid.svg b/docs/test_cases/t20007_sequence_mermaid.svg index d41ca006..44578764 100644 --- a/docs/test_cases/t20007_sequence_mermaid.svg +++ b/docs/test_cases/t20007_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20008.md b/docs/test_cases/t20008.md index e2746d2c..4f5c736c 100644 --- a/docs/test_cases/t20008.md +++ b/docs/test_cases/t20008.md @@ -72,7 +72,7 @@ void tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20008_sequence.svg b/docs/test_cases/t20008_sequence.svg index 19251b4e..e6c63f2f 100644 --- a/docs/test_cases/t20008_sequence.svg +++ b/docs/test_cases/t20008_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<const char *> - + B<const char *> - - + + A<const char *> - + A<const char *> - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - - - - - - - + + + + + + + + b(int) - + a1(int) - + b(const char *) - + a2(const char *) - + b(std::string) - + a3(std::string) diff --git a/docs/test_cases/t20008_sequence_mermaid.svg b/docs/test_cases/t20008_sequence_mermaid.svg index 17aaaa5d..12de9b96 100644 --- a/docs/test_cases/t20008_sequence_mermaid.svg +++ b/docs/test_cases/t20008_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20009.md b/docs/test_cases/t20009.md index 03d133dc..57c69149 100644 --- a/docs/test_cases/t20009.md +++ b/docs/test_cases/t20009.md @@ -58,7 +58,7 @@ void tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20009_sequence.svg b/docs/test_cases/t20009_sequence.svg index d76e4fd7..50ff4243 100644 --- a/docs/test_cases/t20009_sequence.svg +++ b/docs/test_cases/t20009_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,13 +9,13 @@ - - - - - - - + + + + + + + @@ -23,81 +23,81 @@ - - + + tmain() - + tmain() - - + + B<std::string> - + B<std::string> - - + + A<std::string> - + A<std::string> - - + + B<int> - + B<int> - - + + A<int> - + A<int> - - + + B<float> - + B<float> - - + + A<float> - + A<float> - - - - - - - - + + + + + + + + b(std::string) - + a(std::string) - + b(int) - + a(int) - + b(float) - + a(float) diff --git a/docs/test_cases/t20009_sequence_mermaid.svg b/docs/test_cases/t20009_sequence_mermaid.svg index 5ce7e173..a5ffc27e 100644 --- a/docs/test_cases/t20009_sequence_mermaid.svg +++ b/docs/test_cases/t20009_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20010.md b/docs/test_cases/t20010.md index bdb62839..cc9b949e 100644 --- a/docs/test_cases/t20010.md +++ b/docs/test_cases/t20010.md @@ -68,7 +68,7 @@ void tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20010_sequence.svg b/docs/test_cases/t20010_sequence.svg index 0b553367..c9c547ff 100644 --- a/docs/test_cases/t20010_sequence.svg +++ b/docs/test_cases/t20010_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,81 +9,81 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + B<int> - + B<int> - - + + A - + A - - - - - - - - - - + + + + + + + + + + b1() - + a1() - + b2() - + a2() - + b3() - + a3() - + b4() - + a4() diff --git a/docs/test_cases/t20010_sequence_mermaid.svg b/docs/test_cases/t20010_sequence_mermaid.svg index b3a99f04..f8beb39e 100644 --- a/docs/test_cases/t20010_sequence_mermaid.svg +++ b/docs/test_cases/t20010_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20011.md b/docs/test_cases/t20011.md index 0681cea1..dbe6d8d7 100644 --- a/docs/test_cases/t20011.md +++ b/docs/test_cases/t20011.md @@ -60,7 +60,7 @@ void tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20011_sequence.svg b/docs/test_cases/t20011_sequence.svg index 5508fc56..e6a8f503 100644 --- a/docs/test_cases/t20011_sequence.svg +++ b/docs/test_cases/t20011_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,42 +9,42 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - - - - + + + + + + + + + + a(int) @@ -52,26 +52,26 @@ alt - + a(int) - + b(int) - + c(int) - + @@ -81,14 +81,14 @@ alt - + b(int) - + @@ -98,7 +98,7 @@ alt - + diff --git a/docs/test_cases/t20011_sequence_mermaid.svg b/docs/test_cases/t20011_sequence_mermaid.svg index b9e6399d..c412119f 100644 --- a/docs/test_cases/t20011_sequence_mermaid.svg +++ b/docs/test_cases/t20011_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20012.md b/docs/test_cases/t20012.md index e1728140..7bb259fe 100644 --- a/docs/test_cases/t20012.md +++ b/docs/test_cases/t20012.md @@ -135,7 +135,7 @@ void tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20012_sequence.svg b/docs/test_cases/t20012_sequence.svg index a05ce0fe..37e7905d 100644 --- a/docs/test_cases/t20012_sequence.svg +++ b/docs/test_cases/t20012_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,31 +9,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -42,116 +42,116 @@ - - + + tmain() - + tmain() - - + + tmain()::(lambda ../../tests/t20012/t20012.cc:67:20) - + tmain()::(lambda ../../tests/t20012/t20012.cc:67:20) - - + + A - + A - - + + B - + B - - + + tmain()::(lambda ../../tests/t20012/t20012.cc:80:20) - + tmain()::(lambda ../../tests/t20012/t20012.cc:80:20) - - + + C - + C - - + + R<R::(lambda ../../tests/t20012/t20012.cc:86:9)> - + R<R::(lambda ../../tests/t20012/t20012.cc:86:9)> - - + + tmain()::(lambda ../../tests/t20012/t20012.cc:86:9) - + tmain()::(lambda ../../tests/t20012/t20012.cc:86:9) - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -160,67 +160,67 @@ - + operator()() - + c() - + cc() - + ccc() - + operator()() - + a() - + aa() - + aaa() - + b() - + bb() - + @@ -231,34 +231,34 @@ - + R((lambda at /home/bartek/devel/clang-uml/tests/t20012/t20012.cc:86:9) &&) - + r() - + operator()() - + c() - + cc() - + diff --git a/docs/test_cases/t20012_sequence_mermaid.svg b/docs/test_cases/t20012_sequence_mermaid.svg index 153b3b84..f2682488 100644 --- a/docs/test_cases/t20012_sequence_mermaid.svg +++ b/docs/test_cases/t20012_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20013.md b/docs/test_cases/t20013.md index ac6f5c3e..700e2a38 100644 --- a/docs/test_cases/t20013.md +++ b/docs/test_cases/t20013.md @@ -56,7 +56,7 @@ void tmain(int argc, char **argv) { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20013_sequence.svg b/docs/test_cases/t20013_sequence.svg index e2d0bf59..58318b92 100644 --- a/docs/test_cases/t20013_sequence.svg +++ b/docs/test_cases/t20013_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - - - - + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + B - + B - - + + A - + A - - - - - - - - + + + + + + + + b(int) - + a1(int) @@ -58,12 +58,12 @@ - + b(double) - + a2(double) @@ -72,12 +72,12 @@ - + b(const char *) - + a3(const char *) diff --git a/docs/test_cases/t20013_sequence_mermaid.svg b/docs/test_cases/t20013_sequence_mermaid.svg index 06076e9a..9113c14e 100644 --- a/docs/test_cases/t20013_sequence_mermaid.svg +++ b/docs/test_cases/t20013_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20014.md b/docs/test_cases/t20014.md index 1e6dd4bd..79474a58 100644 --- a/docs/test_cases/t20014.md +++ b/docs/test_cases/t20014.md @@ -91,7 +91,7 @@ namespace t20014 { { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20014_sequence.svg b/docs/test_cases/t20014_sequence.svg index 915a1ef4..50e68453 100644 --- a/docs/test_cases/t20014_sequence.svg +++ b/docs/test_cases/t20014_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,56 +9,56 @@ - - - - - - - - + + + + + + + + - - + + tmain() - + tmain() - - + + B - + B - - + + A - + A - - + + C<B,int> - + C<B,int> - - - - - - - - - + + + + + + + + + b1(int,int) - + a1(int,int) @@ -67,12 +67,12 @@ - + b2(int,int) - + a2(int,int) @@ -81,17 +81,17 @@ - + c1(int,int) - + b1(int,int) - + a1(int,int) diff --git a/docs/test_cases/t20014_sequence_mermaid.svg b/docs/test_cases/t20014_sequence_mermaid.svg index 96fa12c5..701f40f7 100644 --- a/docs/test_cases/t20014_sequence_mermaid.svg +++ b/docs/test_cases/t20014_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20015.md b/docs/test_cases/t20015.md index ad9c62fb..c85feeb2 100644 --- a/docs/test_cases/t20015.md +++ b/docs/test_cases/t20015.md @@ -72,7 +72,7 @@ void tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20015_sequence.svg b/docs/test_cases/t20015_sequence.svg index 207eded8..6436b73e 100644 --- a/docs/test_cases/t20015_sequence.svg +++ b/docs/test_cases/t20015_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + B - + B - - - + + + setup_a(std::shared_ptr<detail::A> &) diff --git a/docs/test_cases/t20015_sequence_mermaid.svg b/docs/test_cases/t20015_sequence_mermaid.svg index 6091c2ba..15fab6f5 100644 --- a/docs/test_cases/t20015_sequence_mermaid.svg +++ b/docs/test_cases/t20015_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20016.md b/docs/test_cases/t20016.md index ed19dbf0..b984d473 100644 --- a/docs/test_cases/t20016.md +++ b/docs/test_cases/t20016.md @@ -54,7 +54,7 @@ void tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20016_sequence.svg b/docs/test_cases/t20016_sequence.svg index 7b3e03b3..18587d60 100644 --- a/docs/test_cases/t20016_sequence.svg +++ b/docs/test_cases/t20016_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - - - - + + + + + - - + + tmain() - + tmain() - - + + B<long> - + B<long> - - + + A - + A - - - - - - + + + + + + b1(long) - + a1(int) - + b2(long) - + a2(const long &) diff --git a/docs/test_cases/t20016_sequence_mermaid.svg b/docs/test_cases/t20016_sequence_mermaid.svg index d3ae9e04..a4e11094 100644 --- a/docs/test_cases/t20016_sequence_mermaid.svg +++ b/docs/test_cases/t20016_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20017.md b/docs/test_cases/t20017.md index 0ecd9cc0..1ca9721b 100644 --- a/docs/test_cases/t20017.md +++ b/docs/test_cases/t20017.md @@ -51,7 +51,7 @@ int tmain() { return b2(a1(a2(a3(1, 2), b1(3, 4)), 5), 6); } { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20017_sequence.svg b/docs/test_cases/t20017_sequence.svg index c0570a73..96e9748b 100644 --- a/docs/test_cases/t20017_sequence.svg +++ b/docs/test_cases/t20017_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,65 +9,65 @@ - - - - - - + + + + + + - + t20017.cc - + t20017.cc - + include/t20017_a.h - + include/t20017_a.h - + include/t20017_b.h - + include/t20017_b.h - - - - - - + + + + + + tmain() - + a3(int,int) - + b1(int,int) - + a2(int,int) - + a1(int,int) - + b2<int>(int,int) diff --git a/docs/test_cases/t20017_sequence_mermaid.svg b/docs/test_cases/t20017_sequence_mermaid.svg index 5e91be23..27d40e19 100644 --- a/docs/test_cases/t20017_sequence_mermaid.svg +++ b/docs/test_cases/t20017_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20018.md b/docs/test_cases/t20018.md index 2aae965a..87918e83 100644 --- a/docs/test_cases/t20018.md +++ b/docs/test_cases/t20018.md @@ -56,7 +56,7 @@ void tmain() { Answer>::print(); } { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20018_sequence.svg b/docs/test_cases/t20018_sequence.svg index a034ab19..6fb88792 100644 --- a/docs/test_cases/t20018_sequence.svg +++ b/docs/test_cases/t20018_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,14 +9,14 @@ - - - - - - - - + + + + + + + + @@ -25,93 +25,93 @@ - - + + tmain() - + tmain() - - + + Answer<Factorial<5>,120> - + Answer<Factorial<5>,120> - - + + Factorial<5> - + Factorial<5> - - + + Factorial<4> - + Factorial<4> - - + + Factorial<3> - + Factorial<3> - - + + Factorial<2> - + Factorial<2> - - + + Factorial<1> - + Factorial<1> - - + + Factorial<0> - + Factorial<0> - - - - - - - - - + + + + + + + + + print() - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) - + print(int) diff --git a/docs/test_cases/t20018_sequence_mermaid.svg b/docs/test_cases/t20018_sequence_mermaid.svg index ce997fae..93ba205f 100644 --- a/docs/test_cases/t20018_sequence_mermaid.svg +++ b/docs/test_cases/t20018_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20019.md b/docs/test_cases/t20019.md index 3333bd68..000ea856 100644 --- a/docs/test_cases/t20019.md +++ b/docs/test_cases/t20019.md @@ -63,7 +63,7 @@ void tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20019_sequence.svg b/docs/test_cases/t20019_sequence.svg index be973318..d32f4836 100644 --- a/docs/test_cases/t20019_sequence.svg +++ b/docs/test_cases/t20019_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,95 +9,95 @@ - - - - - - - - - + + + + + + + + + - - + + tmain() - + tmain() - - + + Base<D1> - + Base<D1> - - + + D1 - + D1 - - + + Base<D2> - + Base<D2> - - + + D2 - + D2 - - - - - - - - - - + + + + + + + + + + name() - + impl() - + name() - + impl() - + name() - + impl() - + name() - + impl() diff --git a/docs/test_cases/t20019_sequence_mermaid.svg b/docs/test_cases/t20019_sequence_mermaid.svg index a03fda27..51597fd2 100644 --- a/docs/test_cases/t20019_sequence_mermaid.svg +++ b/docs/test_cases/t20019_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20020.md b/docs/test_cases/t20020.md index d646cfb8..b4b03b95 100644 --- a/docs/test_cases/t20020.md +++ b/docs/test_cases/t20020.md @@ -119,7 +119,7 @@ int tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20020_sequence.svg b/docs/test_cases/t20020_sequence.svg index d0765161..84e43688 100644 --- a/docs/test_cases/t20020_sequence.svg +++ b/docs/test_cases/t20020_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,82 +9,82 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - + + + - - + + tmain() - + tmain() - - + + A - + A - - + + C - + C - - + + B - + B - - + + D<int> - + D<int> - - - - - - - - - - - - - - + + + + + + + + + + + + + + alt - + a1() @@ -92,7 +92,7 @@ - + a5() @@ -103,7 +103,7 @@ alt - + [ @@ -112,7 +112,7 @@ - + [ @@ -121,7 +121,7 @@ - + b1() @@ -129,7 +129,7 @@ - + [ @@ -138,7 +138,7 @@ - + b2() @@ -146,14 +146,14 @@ - + a4() - + log() @@ -161,7 +161,7 @@ alt - + c1() const @@ -169,7 +169,7 @@ alt - + @@ -182,7 +182,7 @@ - + @@ -192,7 +192,7 @@ alt - + d1(int,int) diff --git a/docs/test_cases/t20020_sequence_mermaid.svg b/docs/test_cases/t20020_sequence_mermaid.svg index bd77292b..df3f9b5a 100644 --- a/docs/test_cases/t20020_sequence_mermaid.svg +++ b/docs/test_cases/t20020_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20021.md b/docs/test_cases/t20021.md index afe52587..e327bb2b 100644 --- a/docs/test_cases/t20021.md +++ b/docs/test_cases/t20021.md @@ -86,7 +86,7 @@ int tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20021_sequence.svg b/docs/test_cases/t20021_sequence.svg index 62088109..592d6a6c 100644 --- a/docs/test_cases/t20021_sequence.svg +++ b/docs/test_cases/t20021_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,74 +9,74 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + tmain() - + tmain() - - + + C - + C - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + loop - + [ c4() ] - + @@ -89,7 +89,7 @@ - + a3() @@ -102,7 +102,7 @@ loop - + [ @@ -111,7 +111,7 @@ - + [ @@ -120,7 +120,7 @@ - + [ @@ -129,14 +129,14 @@ - + a1() - + [ @@ -148,7 +148,7 @@ loop - + b2() const @@ -158,7 +158,7 @@ loop - + [ @@ -167,7 +167,7 @@ - + b2() const diff --git a/docs/test_cases/t20021_sequence_mermaid.svg b/docs/test_cases/t20021_sequence_mermaid.svg index b1eab8f0..5b801fd5 100644 --- a/docs/test_cases/t20021_sequence_mermaid.svg +++ b/docs/test_cases/t20021_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20022.md b/docs/test_cases/t20022.md index ad679896..83239d69 100644 --- a/docs/test_cases/t20022.md +++ b/docs/test_cases/t20022.md @@ -66,7 +66,7 @@ int tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20022_sequence.svg b/docs/test_cases/t20022_sequence.svg index 770c0b7d..805cd976 100644 --- a/docs/test_cases/t20022_sequence.svg +++ b/docs/test_cases/t20022_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - + + + + + A(std::unique_ptr ) - + a() - + b() diff --git a/docs/test_cases/t20022_sequence_mermaid.svg b/docs/test_cases/t20022_sequence_mermaid.svg index 9baa294f..d9408adc 100644 --- a/docs/test_cases/t20022_sequence_mermaid.svg +++ b/docs/test_cases/t20022_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20023.md b/docs/test_cases/t20023.md index a336c8e5..174c711f 100644 --- a/docs/test_cases/t20023.md +++ b/docs/test_cases/t20023.md @@ -69,7 +69,7 @@ int tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20023_sequence.svg b/docs/test_cases/t20023_sequence.svg index dce29435..9ff383ac 100644 --- a/docs/test_cases/t20023_sequence.svg +++ b/docs/test_cases/t20023_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,37 +9,37 @@ - - - - - - - + + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - + + + + + + + a() @@ -47,7 +47,7 @@ try - + @@ -60,7 +60,7 @@ [std::runtime_error &] - + @@ -73,7 +73,7 @@ [std::logic_error &] - + @@ -86,7 +86,7 @@ [...] - + diff --git a/docs/test_cases/t20023_sequence_mermaid.svg b/docs/test_cases/t20023_sequence_mermaid.svg index 663706f6..724fa9de 100644 --- a/docs/test_cases/t20023_sequence_mermaid.svg +++ b/docs/test_cases/t20023_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20024.md b/docs/test_cases/t20024.md index 7f0b4e50..02b7bf24 100644 --- a/docs/test_cases/t20024.md +++ b/docs/test_cases/t20024.md @@ -94,7 +94,7 @@ int tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20024_sequence.svg b/docs/test_cases/t20024_sequence.svg index 4444bb9b..622df532 100644 --- a/docs/test_cases/t20024_sequence.svg +++ b/docs/test_cases/t20024_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,23 +9,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + @@ -33,36 +33,36 @@ - - + + tmain() - + tmain() - - + + A - + A - - + + B - + B - - - - - - - - - - - - + + + + + + + + + + + + select(enum_a) @@ -72,7 +72,7 @@ switch [zero] - + @@ -85,7 +85,7 @@ [one] - + @@ -98,7 +98,7 @@ [two] - + @@ -111,7 +111,7 @@ [default] - + @@ -124,7 +124,7 @@ - + select(colors) @@ -134,7 +134,7 @@ switch [enum colors::red] - + @@ -143,7 +143,7 @@ [enum colors::orange] - + @@ -152,7 +152,7 @@ [enum colors::green] - + @@ -161,7 +161,7 @@ [default] - + diff --git a/docs/test_cases/t20024_sequence_mermaid.svg b/docs/test_cases/t20024_sequence_mermaid.svg index 4700dffe..f7db7c3e 100644 --- a/docs/test_cases/t20024_sequence_mermaid.svg +++ b/docs/test_cases/t20024_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20025.md b/docs/test_cases/t20025.md index af41e7c6..c76896cf 100644 --- a/docs/test_cases/t20025.md +++ b/docs/test_cases/t20025.md @@ -74,7 +74,7 @@ int tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20025_sequence.svg b/docs/test_cases/t20025_sequence.svg index fe392bee..1d5f8f20 100644 --- a/docs/test_cases/t20025_sequence.svg +++ b/docs/test_cases/t20025_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,41 +9,41 @@ - - - - + + + + - - + + tmain() - + tmain() - - + + A - + A - - + + add(int,int) - + add(int,int) - - - - - + + + + + a() - + @@ -52,7 +52,7 @@ - + diff --git a/docs/test_cases/t20025_sequence_mermaid.svg b/docs/test_cases/t20025_sequence_mermaid.svg index 0516f053..555db82f 100644 --- a/docs/test_cases/t20025_sequence_mermaid.svg +++ b/docs/test_cases/t20025_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20026.md b/docs/test_cases/t20026.md index addb62f8..f8ae620f 100644 --- a/docs/test_cases/t20026.md +++ b/docs/test_cases/t20026.md @@ -54,7 +54,7 @@ int tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20026_sequence.svg b/docs/test_cases/t20026_sequence.svg index cc58a4e8..09485d7b 100644 --- a/docs/test_cases/t20026_sequence.svg +++ b/docs/test_cases/t20026_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20026_sequence_mermaid.svg b/docs/test_cases/t20026_sequence_mermaid.svg index 49209c1b..121a3afb 100644 --- a/docs/test_cases/t20026_sequence_mermaid.svg +++ b/docs/test_cases/t20026_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20027.md b/docs/test_cases/t20027.md index 8ed41e17..a1eb9e17 100644 --- a/docs/test_cases/t20027.md +++ b/docs/test_cases/t20027.md @@ -53,7 +53,7 @@ void tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20027_sequence.svg b/docs/test_cases/t20027_sequence.svg index 7e27e86c..3437ff74 100644 --- a/docs/test_cases/t20027_sequence.svg +++ b/docs/test_cases/t20027_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,25 +9,25 @@ - - + + - - + + tmain() - + tmain() - - + + A - + A - - - + + + a() diff --git a/docs/test_cases/t20027_sequence_mermaid.svg b/docs/test_cases/t20027_sequence_mermaid.svg index 49209c1b..121a3afb 100644 --- a/docs/test_cases/t20027_sequence_mermaid.svg +++ b/docs/test_cases/t20027_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20028.md b/docs/test_cases/t20028.md index da9c342c..f67267b9 100644 --- a/docs/test_cases/t20028.md +++ b/docs/test_cases/t20028.md @@ -63,7 +63,7 @@ int tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20028_sequence.svg b/docs/test_cases/t20028_sequence.svg index 01f07481..0ae142ba 100644 --- a/docs/test_cases/t20028_sequence.svg +++ b/docs/test_cases/t20028_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,36 +9,36 @@ - - - - - - + + + + + + - - + + tmain() - + tmain() - - + + A - + A - - - - - + + + + + alt - + [ @@ -47,14 +47,14 @@ - + b() - + c() @@ -62,7 +62,7 @@ - + d() diff --git a/docs/test_cases/t20028_sequence_mermaid.svg b/docs/test_cases/t20028_sequence_mermaid.svg index bccc74c7..0ebc51b3 100644 --- a/docs/test_cases/t20028_sequence_mermaid.svg +++ b/docs/test_cases/t20028_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20029.md b/docs/test_cases/t20029.md index a752cfec..9192f426 100644 --- a/docs/test_cases/t20029.md +++ b/docs/test_cases/t20029.md @@ -107,7 +107,7 @@ int tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20029_sequence.svg b/docs/test_cases/t20029_sequence.svg index 7d01b14d..15f99760 100644 --- a/docs/test_cases/t20029_sequence.svg +++ b/docs/test_cases/t20029_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,60 +9,60 @@ - - - - - - - - - - - + + + + + + + + + + + - - + + tmain() - + tmain() - - + + Encoder<Retrier<ConnectionPool>> - + Encoder<Retrier<ConnectionPool>> - - + + Retrier<ConnectionPool> - + Retrier<ConnectionPool> - - + + ConnectionPool - + ConnectionPool - - + + encode_b64(std::string &&) - + encode_b64(std::string &&) - - - - - - - - + + + + + + + + connect() @@ -73,21 +73,21 @@ alt - + [ send(std::string &&) ] - + encode(std::string &&) - + @@ -97,7 +97,7 @@ - + send(std::string &&) @@ -108,7 +108,7 @@ alt - + [ diff --git a/docs/test_cases/t20029_sequence_mermaid.svg b/docs/test_cases/t20029_sequence_mermaid.svg index 1770faf7..3eefa41d 100644 --- a/docs/test_cases/t20029_sequence_mermaid.svg +++ b/docs/test_cases/t20029_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20030.md b/docs/test_cases/t20030.md index 7a6c45ee..74e11bfe 100644 --- a/docs/test_cases/t20030.md +++ b/docs/test_cases/t20030.md @@ -81,7 +81,7 @@ int tmain(bool f, int a) { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20030_sequence.svg b/docs/test_cases/t20030_sequence.svg index 965125e2..ef20329d 100644 --- a/docs/test_cases/t20030_sequence.svg +++ b/docs/test_cases/t20030_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,81 +9,81 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + tmain(int) - + tmain(int) - - + + magic() - + magic() - - + + A - + A - - + + tmain(bool,int) - + tmain(bool,int) - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + A(int) - + operator+=(int) - + @@ -92,36 +92,36 @@ - + A() - + create() - + A() - + create() - + operator+=(int) - + @@ -130,12 +130,12 @@ - + operator=(const A &) - + @@ -144,7 +144,7 @@ - + value() const diff --git a/docs/test_cases/t20030_sequence_mermaid.svg b/docs/test_cases/t20030_sequence_mermaid.svg index 42b85e10..13ec0fcc 100644 --- a/docs/test_cases/t20030_sequence_mermaid.svg +++ b/docs/test_cases/t20030_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20031.md b/docs/test_cases/t20031.md index 1f44c5c6..b966014d 100644 --- a/docs/test_cases/t20031.md +++ b/docs/test_cases/t20031.md @@ -97,7 +97,7 @@ int tmain(bool f, int a) { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20031_sequence.svg b/docs/test_cases/t20031_sequence.svg index 94405af3..0b5e1ca3 100644 --- a/docs/test_cases/t20031_sequence.svg +++ b/docs/test_cases/t20031_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,64 +9,64 @@ - - - - - + + + + + - - + + tmain(int) - + tmain(int) - - + + magic() - + magic() - - + + tmain(bool,int) - + tmain(bool,int) - - + + execute(std::function<int ()>) - + execute(std::function<int ()>) - - + + A - + A - - - - - - + + + + + + - + - + value() const diff --git a/docs/test_cases/t20031_sequence_mermaid.svg b/docs/test_cases/t20031_sequence_mermaid.svg index 481ab8ce..c6200e3a 100644 --- a/docs/test_cases/t20031_sequence_mermaid.svg +++ b/docs/test_cases/t20031_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20032.md b/docs/test_cases/t20032.md index f68ef59a..6618d7f5 100644 --- a/docs/test_cases/t20032.md +++ b/docs/test_cases/t20032.md @@ -57,7 +57,7 @@ void tmain(int argc, char **argv) { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20032_sequence.svg b/docs/test_cases/t20032_sequence.svg index 4b33839c..69e11ce3 100644 --- a/docs/test_cases/t20032_sequence.svg +++ b/docs/test_cases/t20032_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,47 +9,47 @@ - - - - - - - + + + + + + + - - + + tmain(int,char **) - + tmain(int,char **) - - + + B - + B - - + + A - + A - - - - - - - - + + + + + + + + b(int) - + a1(int) @@ -60,12 +60,12 @@ int - + b(double) - + a2(double) @@ -76,12 +76,12 @@ double - + b(const char *) - + a3(const char *) diff --git a/docs/test_cases/t20032_sequence_mermaid.svg b/docs/test_cases/t20032_sequence_mermaid.svg index 31dd5e89..86fd4f5a 100644 --- a/docs/test_cases/t20032_sequence_mermaid.svg +++ b/docs/test_cases/t20032_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20033.md b/docs/test_cases/t20033.md index b1c0bf36..2604f6df 100644 --- a/docs/test_cases/t20033.md +++ b/docs/test_cases/t20033.md @@ -95,7 +95,7 @@ int tmain() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20033_sequence.svg b/docs/test_cases/t20033_sequence.svg index 9bd688b8..79d2a95c 100644 --- a/docs/test_cases/t20033_sequence.svg +++ b/docs/test_cases/t20033_sequence.svg @@ -1,6 +1,6 @@ - + @@ -9,73 +9,73 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - + + + + + - + - - + + tmain() - + tmain() - - + + A - + A - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + alt [false] [reinterpret_cast<uint64_t>(&a) % 100 == 0ULL] - + a1() @@ -84,7 +84,7 @@ [reinterpret_cast<uint64_t>(&a) % 64 == 0ULL] - + a2() @@ -93,7 +93,7 @@ [a.a2() == 2 && a.a3() == 3] - + [ @@ -102,7 +102,7 @@ - + [ @@ -111,7 +111,7 @@ - + a3() @@ -119,7 +119,7 @@ - + a4() @@ -130,7 +130,7 @@ alt [int i = a.a2(); i != 2] - + [ @@ -139,7 +139,7 @@ - + a3() @@ -150,7 +150,7 @@ loop [int i = 0; i < a.a2(); i++] - + [ @@ -159,14 +159,14 @@ - + a3() - + a3() @@ -177,7 +177,7 @@ loop [retry_count--] - + a2() @@ -188,14 +188,14 @@ loop [retry_count++ < a.a3()] - + a4() - + [ @@ -208,7 +208,7 @@ alt [a.a4() % 6] - + [ @@ -222,7 +222,7 @@ loop [ints] - + a4() diff --git a/docs/test_cases/t20033_sequence_mermaid.svg b/docs/test_cases/t20033_sequence_mermaid.svg index 0eb7a5c5..95d14083 100644 --- a/docs/test_cases/t20033_sequence_mermaid.svg +++ b/docs/test_cases/t20033_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20034.md b/docs/test_cases/t20034.md index 5ab64a79..b202689b 100644 --- a/docs/test_cases/t20034.md +++ b/docs/test_cases/t20034.md @@ -101,7 +101,7 @@ void B::b4() { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20034_sequence.svg b/docs/test_cases/t20034_sequence.svg index 933e690d..10e1258a 100644 --- a/docs/test_cases/t20034_sequence.svg +++ b/docs/test_cases/t20034_sequence.svg @@ -1,6 +1,6 @@ - + @@ -14,154 +14,154 @@ - - + + D - + D - - + + C - + C - - + + B - + B - - + + A - + A - - + + D::d2()::(lambda ../../tests/t20034/t20034.cc:56:18) - + D::d2()::(lambda ../../tests/t20034/t20034.cc:56:18) d2() - + c2() - + b2() - + a2() - + d2() - + a2() - + d2() - + operator()() - + a2() - + d2() - + c4() - + b4() - + b2() - + a2() - + d2() - + c1() - + b1() - + a2() - + d2() - + c3() - + c2() - + b2() - + a2() diff --git a/docs/test_cases/t20034_sequence_mermaid.svg b/docs/test_cases/t20034_sequence_mermaid.svg index 6dca9ae3..d10b6c93 100644 --- a/docs/test_cases/t20034_sequence_mermaid.svg +++ b/docs/test_cases/t20034_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20035.md b/docs/test_cases/t20035.md index 1b60a073..9a210be0 100644 --- a/docs/test_cases/t20035.md +++ b/docs/test_cases/t20035.md @@ -44,7 +44,7 @@ int tmain(int argc, char **argv) { return a(argc); } { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20035_sequence.svg b/docs/test_cases/t20035_sequence.svg index 544c821b..bf85f19d 100644 --- a/docs/test_cases/t20035_sequence.svg +++ b/docs/test_cases/t20035_sequence.svg @@ -1,6 +1,6 @@ - + @@ -13,39 +13,39 @@ - - + + tmain(int,char **) - + tmain(int,char **) - - + + a(int) - + a(int) - - + + b1(int) - + b1(int) - - + + c(int) - + c(int) - + - + - + diff --git a/docs/test_cases/t20035_sequence_mermaid.svg b/docs/test_cases/t20035_sequence_mermaid.svg index f56672df..dbd1dab4 100644 --- a/docs/test_cases/t20035_sequence_mermaid.svg +++ b/docs/test_cases/t20035_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t20036.md b/docs/test_cases/t20036.md index 74179e91..16515bc4 100644 --- a/docs/test_cases/t20036.md +++ b/docs/test_cases/t20036.md @@ -73,7 +73,7 @@ struct D { { "diagram_type": "sequence", "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t20036_sequence.svg b/docs/test_cases/t20036_sequence.svg index f1a32b05..198a3314 100644 --- a/docs/test_cases/t20036_sequence.svg +++ b/docs/test_cases/t20036_sequence.svg @@ -1,6 +1,6 @@ - + @@ -13,131 +13,131 @@ - - + + C - + C - - + + B - + B - - + + A - + A - - + + D - + D c1() - + b1() - + a2() - + d1() - + c2() - + b2() - + a2() - + d3() - + a2() - + c4() - + b2() - + a2() - + c3() - + c2() - + b2() - + a2() - + d2() - + c2() - + b2() - + a2() diff --git a/docs/test_cases/t20036_sequence_mermaid.svg b/docs/test_cases/t20036_sequence_mermaid.svg index 22edc641..cd661d11 100644 --- a/docs/test_cases/t20036_sequence_mermaid.svg +++ b/docs/test_cases/t20036_sequence_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/test_cases/t30001.md b/docs/test_cases/t30001.md index f2faafa3..cfbead57 100644 --- a/docs/test_cases/t30001.md +++ b/docs/test_cases/t30001.md @@ -23,6 +23,18 @@ diagrams: - 'note right of {{ alias("A::AA::AAA") }}: A AAA note...' - '{% set e=element("A::AA") %} note top of {{ alias("A::AA") }} : {{ e.comment.formatted }}' - '{% set e=element("B::AA") %} note top of {{ alias("B::AA") }} : {{ e.comment.formatted }}' + mermaid: + before: + - "%% t30001 test diagram of type {{ diagram.type }}" + after: + - 'N_0001(A AAA note...)' + - 'N_0001 -.- {{ alias("A::AA::AAA") }}' + - '{% set e=element("A::AA") %}N_0002({{ e.comment.formatted }})' + - '{% set e=element("B::AA") %}N_0003({{ e.comment.formatted }})' + - 'N_0002 -.- {{ alias("A::AA") }}' + - 'N_0003 -.- {{ alias("B::AA") }}' + + ``` ## Source code @@ -241,7 +253,7 @@ namespace BB { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t30001_package.svg b/docs/test_cases/t30001_package.svg index 2a1765af..d473ee6c 100644 --- a/docs/test_cases/t30001_package.svg +++ b/docs/test_cases/t30001_package.svg @@ -1,6 +1,6 @@ - + @@ -9,63 +9,63 @@ - - + + A - - + + AA - - + + B - - + + AA - - + + AAA - - + + BBB - - + + BB - - + + AAA - - + + BBB - - + + BB - + A AAA note... - + This is namespace AA in namespace A - + This is namespace AA in namespace B diff --git a/docs/test_cases/t30001_package_mermaid.svg b/docs/test_cases/t30001_package_mermaid.svg index 852d0490..36542ab3 100644 --- a/docs/test_cases/t30001_package_mermaid.svg +++ b/docs/test_cases/t30001_package_mermaid.svg @@ -1 +1,210 @@ -
B
AA
AAA
BBB
BB
A
AA
AAA
BBB
BB
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ B +
+
+
+
+ + + + +
+ A +
+
+
+
+ + + + +
+ AA +
+
+
+
+
+ + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + +
+ AA +
+
+
+
+
+ + + + + + + + +
+ AAA +
+
+
+
+ + + + + +
+ BBB +
+
+
+
+
+
+ + + + + +
+ BB +
+
+
+
+ + + + + +
+ BB +
+
+
+
+ + + + + +
+ AAA +
+
+
+
+ + + + + +
+ BBB +
+
+
+
+ + + + + +
+ A AAA note... +
+
+
+
+ + + + + +
+ This is namespace AA in namespace A +
+
+
+
+ + + + + +
+ This is namespace AA in namespace B +
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t30002.md b/docs/test_cases/t30002.md index d696f817..fcf346fa 100644 --- a/docs/test_cases/t30002.md +++ b/docs/test_cases/t30002.md @@ -489,7 +489,7 @@ template std::map> cm() } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t30002_package.svg b/docs/test_cases/t30002_package.svg index 7d3a56da..1ee3f5e4 100644 --- a/docs/test_cases/t30002_package.svg +++ b/docs/test_cases/t30002_package.svg @@ -1,6 +1,6 @@ - + @@ -9,118 +9,118 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + A1 - - + + A2 - - + + A3 - - + + A4 - - + + A5 - - + + A6 - - + + A7 - - + + A8 - - + + A9 - - + + A10 - - + + A11 - - + + A12 - - + + A13 - - + + A14 - - + + A15 - - + + A16 - - + + A17 - - + + A18 - - + + BBB diff --git a/docs/test_cases/t30002_package_mermaid.svg b/docs/test_cases/t30002_package_mermaid.svg index 56382431..652965df 100644 --- a/docs/test_cases/t30002_package_mermaid.svg +++ b/docs/test_cases/t30002_package_mermaid.svg @@ -1 +1,462 @@ -
B
A
BB
AA
BBB
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A13
A14
A15
A16
A17
A18
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ B +
+
+
+
+ + + + +
+ A +
+
+
+
+ + + + +
+ BB +
+
+
+
+ + + + +
+ AA +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + +
+ BBB +
+
+
+
+ + + + + +
+ A1 +
+
+
+
+ + + + + +
+ A2 +
+
+
+
+ + + + + +
+ A3 +
+
+
+
+ + + + + +
+ A4 +
+
+
+
+ + + + + +
+ A5 +
+
+
+
+ + + + + +
+ A6 +
+
+
+
+ + + + + +
+ A7 +
+
+
+
+ + + + + +
+ A8 +
+
+
+
+ + + + + +
+ A9 +
+
+
+
+ + + + + +
+ A10 +
+
+
+
+ + + + + +
+ A11 +
+
+
+
+ + + + + +
+ A12 +
+
+
+
+ + + + + +
+ A13 +
+
+
+
+ + + + + +
+ A14 +
+
+
+
+ + + + + +
+ A15 +
+
+
+
+ + + + + +
+ A16 +
+
+
+
+ + + + + +
+ A17 +
+
+
+
+ + + + + +
+ A18 +
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t30003.md b/docs/test_cases/t30003.md index babd591e..e0bc016d 100644 --- a/docs/test_cases/t30003.md +++ b/docs/test_cases/t30003.md @@ -171,7 +171,7 @@ class B : public ns1::ns2::Anon { }; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t30003_package.svg b/docs/test_cases/t30003_package.svg index 79b28858..ef8c3bd3 100644 --- a/docs/test_cases/t30003_package.svg +++ b/docs/test_cases/t30003_package.svg @@ -1,6 +1,6 @@ - + @@ -9,35 +9,35 @@ - - + + ns1 - - + + ns3 «deprecated» - - + + ns1 - - + + ns2_v1_0_0 - - + + ns2_v0_9_0 «deprecated» - - + + ns2 diff --git a/docs/test_cases/t30003_package_mermaid.svg b/docs/test_cases/t30003_package_mermaid.svg index 673e9942..417d2e5b 100644 --- a/docs/test_cases/t30003_package_mermaid.svg +++ b/docs/test_cases/t30003_package_mermaid.svg @@ -1 +1,113 @@ -
ns1
ns3
ns2_v1_0_0
ns2
ns2_v0_9_0
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ns1 +
+
+
+
+ + + + +
+ ns3 +
+
+
+
+
+ + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + +
+ ns2_v1_0_0 +
+
+
+
+ + + + + +
+ ns2 +
+
+
+
+ + + + + +
+ ns2_v0_9_0 +
+
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t30004.md b/docs/test_cases/t30004.md index f72e4147..0af2a18d 100644 --- a/docs/test_cases/t30004.md +++ b/docs/test_cases/t30004.md @@ -182,7 +182,7 @@ namespace CCC { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t30004_package.svg b/docs/test_cases/t30004_package.svg index 02ca4a35..db7ad8c0 100644 --- a/docs/test_cases/t30004_package.svg +++ b/docs/test_cases/t30004_package.svg @@ -1,6 +1,6 @@ - + @@ -9,40 +9,40 @@ - - + + A - + Package AAA. - + Package BBB. - + CCCC package note. - + We skipped DDD. - - + + AAA - - + + BBB - - + + CCC - - + + EEE diff --git a/docs/test_cases/t30004_package_mermaid.svg b/docs/test_cases/t30004_package_mermaid.svg index 35259c3a..b3da38b3 100644 --- a/docs/test_cases/t30004_package_mermaid.svg +++ b/docs/test_cases/t30004_package_mermaid.svg @@ -1 +1,178 @@ -
A
AAA
Package AAA.
Package BBB.
BBB
CCCC package note.
CCC
We skipped DDD.
EEE
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ A +
+
+
+
+
+ + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + +
+ AAA +
+
+
+
+ + + + + +
+ Package AAA. +
+
+
+
+ + + + + +
+ Package BBB. +
+
+
+
+ + + + + +
+ BBB +
+
+
+
+ + + + + +
+ CCCC package note. +
+
+
+
+ + + + + +
+ CCC +
+
+
+
+ + + + + +
+ We skipped DDD. +
+
+
+
+ + + + + +
+ EEE +
+
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t30005.md b/docs/test_cases/t30005.md index c466ed22..bb662edb 100644 --- a/docs/test_cases/t30005.md +++ b/docs/test_cases/t30005.md @@ -216,7 +216,7 @@ struct C2 { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t30005_package.svg b/docs/test_cases/t30005_package.svg index e57b27ff..068615cf 100644 --- a/docs/test_cases/t30005_package.svg +++ b/docs/test_cases/t30005_package.svg @@ -1,6 +1,6 @@ - + @@ -9,48 +9,48 @@ - - + + A - - + + AA - - + + B - - + + BB - - + + C - - + + CC - - + + AAA - - + + BBB - - + + CCC diff --git a/docs/test_cases/t30005_package_mermaid.svg b/docs/test_cases/t30005_package_mermaid.svg index b1188274..f97615b4 100644 --- a/docs/test_cases/t30005_package_mermaid.svg +++ b/docs/test_cases/t30005_package_mermaid.svg @@ -1 +1,146 @@ -
C
B
A
CC
BB
AA
CCC
BBB
AAA
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ C +
+
+
+
+ + + + +
+ B +
+
+
+
+ + + + +
+ A +
+
+
+
+ + + + +
+ CC +
+
+
+
+ + + + +
+ BB +
+
+
+
+ + + + +
+ AA +
+
+
+
+
+ + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + +
+ CCC +
+
+
+
+ + + + + +
+ BBB +
+
+
+
+ + + + + +
+ AAA +
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t30006.md b/docs/test_cases/t30006.md index aff0dee5..06f98c8d 100644 --- a/docs/test_cases/t30006.md +++ b/docs/test_cases/t30006.md @@ -130,7 +130,7 @@ struct A2 { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t30006_package.svg b/docs/test_cases/t30006_package.svg index 8801d95e..e1d4cf01 100644 --- a/docs/test_cases/t30006_package.svg +++ b/docs/test_cases/t30006_package.svg @@ -1,6 +1,6 @@ - + @@ -9,22 +9,22 @@ - - + + B - - + + A - - + + C - + Top A note. diff --git a/docs/test_cases/t30006_package_mermaid.svg b/docs/test_cases/t30006_package_mermaid.svg index d5456be9..6bc8f006 100644 --- a/docs/test_cases/t30006_package_mermaid.svg +++ b/docs/test_cases/t30006_package_mermaid.svg @@ -1 +1,106 @@ -
Top A note.
A
B
C
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + +
+ Top A note. +
+
+
+
+ + + + + +
+ A +
+
+
+
+ + + + + +
+ B +
+
+
+
+ + + + + +
+ C +
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t30007.md b/docs/test_cases/t30007.md index da096382..89186482 100644 --- a/docs/test_cases/t30007.md +++ b/docs/test_cases/t30007.md @@ -153,7 +153,7 @@ struct A2 { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t30007_package.svg b/docs/test_cases/t30007_package.svg index d6438159..6612bbf6 100644 --- a/docs/test_cases/t30007_package.svg +++ b/docs/test_cases/t30007_package.svg @@ -1,6 +1,6 @@ - + @@ -9,27 +9,27 @@ - - + + A - - + + B - - + + AA - - + + C - + Compare layout with t30006. diff --git a/docs/test_cases/t30007_package_mermaid.svg b/docs/test_cases/t30007_package_mermaid.svg index 3f233bd2..bb0c362d 100644 --- a/docs/test_cases/t30007_package_mermaid.svg +++ b/docs/test_cases/t30007_package_mermaid.svg @@ -1 +1,117 @@ -
A
AA
Compare layout with t30006.
B
C
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ A +
+
+
+
+
+ + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + +
+ AA +
+
+
+
+ + + + + +
+ Compare layout with t30006. +
+
+
+
+ + + + + +
+ B +
+
+
+
+ + + + + +
+ C +
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t30008.md b/docs/test_cases/t30008.md index 98045c7f..b9c14fd7 100644 --- a/docs/test_cases/t30008.md +++ b/docs/test_cases/t30008.md @@ -213,7 +213,7 @@ struct FF { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t30008_package.svg b/docs/test_cases/t30008_package.svg index dca2d131..54d031fd 100644 --- a/docs/test_cases/t30008_package.svg +++ b/docs/test_cases/t30008_package.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - - + + dependants - - + + dependencies - - + + A - - + + B - - + + C - - + + D - - + + E - - + + F diff --git a/docs/test_cases/t30008_package_mermaid.svg b/docs/test_cases/t30008_package_mermaid.svg index 43c5c8f5..6d9fc16a 100644 --- a/docs/test_cases/t30008_package_mermaid.svg +++ b/docs/test_cases/t30008_package_mermaid.svg @@ -1 +1,176 @@ -
dependencies
D
E
F
dependants
A
B
C
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ dependencies +
+
+
+
+
+ + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + +
+ D +
+
+
+
+ + + + + +
+ E +
+
+
+
+ + + + + +
+ F +
+
+
+
+
+
+ + + + + + +
+ dependants +
+
+
+
+
+ + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + +
+ A +
+
+
+
+ + + + + +
+ B +
+
+
+
+ + + + + +
+ C +
+
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t30009.md b/docs/test_cases/t30009.md index 1430109c..e0e79408 100644 --- a/docs/test_cases/t30009.md +++ b/docs/test_cases/t30009.md @@ -219,7 +219,7 @@ namespace D { } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t30009_package.svg b/docs/test_cases/t30009_package.svg index ea607186..4792de09 100644 --- a/docs/test_cases/t30009_package.svg +++ b/docs/test_cases/t30009_package.svg @@ -1,6 +1,6 @@ - + @@ -9,53 +9,53 @@ - - + + One - - + + Two - - + + B - - + + D - - + + A - - + + C - - + + A - - + + B - - + + C - - + + D diff --git a/docs/test_cases/t30009_package_mermaid.svg b/docs/test_cases/t30009_package_mermaid.svg index f264109b..903c6979 100644 --- a/docs/test_cases/t30009_package_mermaid.svg +++ b/docs/test_cases/t30009_package_mermaid.svg @@ -1 +1,154 @@ -
Two
A
B
C
D
One
B
D
A
C
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Two +
+
+
+
+
+ + + + + + + + +
+ A +
+
+
+
+ + + + + +
+ B +
+
+
+
+ + + + + +
+ C +
+
+
+
+ + + + + +
+ D +
+
+
+
+
+
+ + + + + + +
+ One +
+
+
+
+
+ + + + + + + + +
+ B +
+
+
+
+ + + + + +
+ D +
+
+
+
+ + + + + +
+ A +
+
+
+
+ + + + + +
+ C +
+
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t30010.md b/docs/test_cases/t30010.md index f3dab758..0862cc8f 100644 --- a/docs/test_cases/t30010.md +++ b/docs/test_cases/t30010.md @@ -87,7 +87,7 @@ App app; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t30010_package_mermaid.svg b/docs/test_cases/t30010_package_mermaid.svg index b00c9104..f0026729 100644 --- a/docs/test_cases/t30010_package_mermaid.svg +++ b/docs/test_cases/t30010_package_mermaid.svg @@ -1 +1,138 @@ -
libraries
lib1
lib2
lib3
lib4
app
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ libraries +
+
+
+
+
+ + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + +
+ lib1 +
+
+
+
+ + + + + +
+ lib2 +
+
+
+
+ + + + + +
+ lib3 +
+
+
+
+ + + + + +
+ lib4 +
+
+
+
+ + + + + +
+ app +
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t30011.md b/docs/test_cases/t30011.md index 35c0399e..c251d6a3 100644 --- a/docs/test_cases/t30011.md +++ b/docs/test_cases/t30011.md @@ -77,7 +77,7 @@ struct t30011_App app; } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t30011_package_mermaid.svg b/docs/test_cases/t30011_package_mermaid.svg index b00c9104..f0026729 100644 --- a/docs/test_cases/t30011_package_mermaid.svg +++ b/docs/test_cases/t30011_package_mermaid.svg @@ -1 +1,138 @@ -
libraries
lib1
lib2
lib3
lib4
app
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ libraries +
+
+
+
+
+ + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + +
+ lib1 +
+
+
+
+ + + + + +
+ lib2 +
+
+
+
+ + + + + +
+ lib3 +
+
+
+
+ + + + + +
+ lib4 +
+
+
+
+ + + + + +
+ app +
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t40001.md b/docs/test_cases/t40001.md index cae2696f..14abdd43 100644 --- a/docs/test_cases/t40001.md +++ b/docs/test_cases/t40001.md @@ -25,9 +25,11 @@ diagrams: - 'note right of {{ alias("include/lib1") }}: This is a lib1 include dir' - 'note right of {{ alias("include/t40001_include1.h") }}: This is a t40001_include1.h include file' mermaid: + before: + - "%% t40001 test diagram of type {{ diagram.type }}" after: - 'N_00001(This is a lib1 include dir)-.-{{ alias("include/lib1") }}' - - 'N_00002(This is a lib1 include dir)-.-{{ alias("include/t40001_include1.h") }}' + - 'N_00002(This is a t40001_include1.h include file)-.-{{ alias("include/t40001_include1.h") }}' ``` ## Source code ## Generated PlantUML diagrams @@ -107,7 +109,7 @@ diagrams: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t40001_include.svg b/docs/test_cases/t40001_include.svg index e949b94a..b2da2c93 100644 --- a/docs/test_cases/t40001_include.svg +++ b/docs/test_cases/t40001_include.svg @@ -1,6 +1,6 @@ - + @@ -9,43 +9,43 @@ - + src - + include - + lib1 - - + + t40001.cc - - + + t40001_include1.h - - + + lib1.h - + string - + vector - + yaml-cpp/yaml.h - + This is a lib1 include dir - + This is a t40001_include1.h include file diff --git a/docs/test_cases/t40001_include_mermaid.svg b/docs/test_cases/t40001_include_mermaid.svg index db0830db..daff004b 100644 --- a/docs/test_cases/t40001_include_mermaid.svg +++ b/docs/test_cases/t40001_include_mermaid.svg @@ -1 +1,237 @@ -
include
src
lib1
t40001_include1.h
lib1.h
t40001.cc
string
vector
yaml-cpp/yaml.h
This is a lib1 include dir
This is a lib1 include dir
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ include +
+
+
+
+ + + + +
+ src +
+
+
+
+ + + + +
+ lib1 +
+
+
+
+
+ + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + +
+ t40001_include1.h +
+
+
+
+
+ + + + + + +
+ lib1.h +
+
+
+
+
+ + + + + + +
+ t40001.cc +
+
+
+
+
+ + + + + +
+ string +
+
+
+
+ + + + + +
+ vector +
+
+
+
+ + + + + +
+ yaml-cpp/yaml.h +
+
+
+
+ + + + + +
+ This is a lib1 include dir +
+
+
+
+ + + + + +
+ This is a t40001_include1.h include file +
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t40002.md b/docs/test_cases/t40002.md index 15a0c02d..0b8679aa 100644 --- a/docs/test_cases/t40002.md +++ b/docs/test_cases/t40002.md @@ -121,7 +121,7 @@ diagrams: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t40002_include.svg b/docs/test_cases/t40002_include.svg index 0d1f74de..7bea8ec7 100644 --- a/docs/test_cases/t40002_include.svg +++ b/docs/test_cases/t40002_include.svg @@ -1,6 +1,6 @@ - + @@ -9,46 +9,46 @@ - + src - + lib1 - + lib2 - + include - + lib1 - + lib2 - - + + t40002.cc - - + + lib1.cc - - + + lib2.cc - - + + lib1.h - - + + lib2.h diff --git a/docs/test_cases/t40002_include_mermaid.svg b/docs/test_cases/t40002_include_mermaid.svg index 6373a988..61802b75 100644 --- a/docs/test_cases/t40002_include_mermaid.svg +++ b/docs/test_cases/t40002_include_mermaid.svg @@ -1 +1,208 @@ -
include
src
lib1
lib2
lib1
lib2
lib2.h
lib1.h
t40002.cc
lib2.cc
lib1.cc
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ include +
+
+
+
+ + + + +
+ src +
+
+
+
+ + + + +
+ lib1 +
+
+
+
+ + + + +
+ lib2 +
+
+
+
+ + + + +
+ lib1 +
+
+
+
+ + + + +
+ lib2 +
+
+
+
+
+ + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + +
+ lib2.h +
+
+
+
+
+ + + + + + +
+ lib1.h +
+
+
+
+
+ + + + + + +
+ t40002.cc +
+
+
+
+
+ + + + + + +
+ lib2.cc +
+
+
+
+
+ + + + + + +
+ lib1.cc +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t40003.md b/docs/test_cases/t40003.md index 08d9074d..d7009117 100644 --- a/docs/test_cases/t40003.md +++ b/docs/test_cases/t40003.md @@ -147,7 +147,7 @@ diagrams: } ], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t40003_include.svg b/docs/test_cases/t40003_include.svg index 8a548f14..c69451d1 100644 --- a/docs/test_cases/t40003_include.svg +++ b/docs/test_cases/t40003_include.svg @@ -1,6 +1,6 @@ - + @@ -9,66 +9,66 @@ - + src - + dependants - + dependencies - + include - + dependants - + dependencies - - + + t1.cc - - + + t2.cc - - + + t3.h - - + + t2.h - - + + t1.h - - + + t3.h - - + + t2.h - - + + t1.h - - + + t5.h diff --git a/docs/test_cases/t40003_include_mermaid.svg b/docs/test_cases/t40003_include_mermaid.svg index a6907de6..3512df85 100644 --- a/docs/test_cases/t40003_include_mermaid.svg +++ b/docs/test_cases/t40003_include_mermaid.svg @@ -1 +1,290 @@ -
include
src
dependants
dependencies
dependants
dependencies
t3.h
t2.h
t1.h
t5.h
t3.h
t2.h
t1.h
t2.cc
t1.cc
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ include +
+
+
+
+ + + + +
+ src +
+
+
+
+ + + + +
+ dependants +
+
+
+
+ + + + +
+ dependencies +
+
+
+
+ + + + +
+ dependants +
+
+
+
+ + + + +
+ dependencies +
+
+
+
+
+ + + + + + + + + + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+ + + + + + + +
+ t3.h +
+
+
+
+
+ + + + + + +
+ t2.h +
+
+
+
+
+ + + + + + +
+ t1.h +
+
+
+
+
+ + + + + + +
+ t5.h +
+
+
+
+
+ + + + + + +
+ t3.h +
+
+
+
+
+ + + + + + +
+ t2.h +
+
+
+
+
+ + + + + + +
+ t1.h +
+
+
+
+
+ + + + + + +
+ t2.cc +
+
+
+
+
+ + + + + + +
+ t1.cc +
+
+
+
+
+
+
+
+
diff --git a/docs/test_cases/t90000.md b/docs/test_cases/t90000.md index 4ae6d9c9..a4377c0e 100644 --- a/docs/test_cases/t90000.md +++ b/docs/test_cases/t90000.md @@ -50,7 +50,7 @@ File t90000.cc "diagram_type": "class", "elements": [], "metadata": { - "clang_uml_version": "0.3.9-11-g4a19c8b", + "clang_uml_version": "0.3.9-23-g7e22b0b", "llvm_version": "Ubuntu clang version 16.0.1 (++20230328073357+42d1b276f779-1~exp1~20230328073502.65)", "schema_version": 1 }, diff --git a/docs/test_cases/t90000_class_mermaid.svg b/docs/test_cases/t90000_class_mermaid.svg index 41704b50..ea66542d 100644 --- a/docs/test_cases/t90000_class_mermaid.svg +++ b/docs/test_cases/t90000_class_mermaid.svg @@ -1,4 +1,4 @@ - + diff --git a/util/format_svg.py b/util/format_svg.py index dd244066..9ef13f19 100755 --- a/util/format_svg.py +++ b/util/format_svg.py @@ -42,11 +42,10 @@ def main(argv): # Add style color for links defs = tree.xpath('//svg:defs', namespaces={'svg':'http://www.w3.org/2000/svg'}) - if not defs: - continue - style = etree.SubElement(defs[0], 'style') - style.text = 'a:hover { text-decoration: underline; }' - style.set('type', 'text/css') + if defs: + style = etree.SubElement(defs[0], 'style') + style.text = 'a:hover { text-decoration: underline; }' + style.set('type', 'text/css') # Remove comments from SVG, to minimize diff # when updating diagrams in Git From 7b41295b07f8ff6d584d139fe68d2c92195f3dcd Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Wed, 13 Sep 2023 20:48:31 +0200 Subject: [PATCH 24/24] Fixed building on MSVC --- tests/catch.h | 9 ++++++--- tests/t00056/test_case.h | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/catch.h b/tests/catch.h index 8e780a2d..27888c9d 100644 --- a/tests/catch.h +++ b/tests/catch.h @@ -13299,9 +13299,12 @@ RegexMatcher::RegexMatcher( bool RegexMatcher::match(std::string const &matchee) const { - auto flags = std::regex::ECMAScript | - std::regex::multiline; // ECMAScript is the default syntax - // option anyway + auto flags = std::regex::ECMAScript; // ECMAScript is the default syntax + // option anyway +#if !defined(_WIN32) + flags |= std::regex::multiline; +#endif + if (m_caseSensitivity == CaseSensitive::Choice::No) { flags |= std::regex::icase; } diff --git a/tests/t00056/test_case.h b/tests/t00056/test_case.h index d271740c..d523766f 100644 --- a/tests/t00056/test_case.h +++ b/tests/t00056/test_case.h @@ -55,7 +55,7 @@ TEST_CASE("t00056", "[test-case][class]") src, IsConceptRequirement(_A("iterable"), "container.end()")); #ifdef _MSC_VER - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConceptRequirement( _A("convertible_to_string"), "std::string{s}")); #else @@ -162,7 +162,7 @@ TEST_CASE("t00056", "[test-case][class]") src, IsConceptRequirement(_A("iterable"), "container.end()")); #ifdef _MSC_VER - REQUIRE_THAT(puml, + REQUIRE_THAT(src, IsConceptRequirement( _A("convertible_to_string"), "std::string{s}")); #else