Refactored command line handling

This commit is contained in:
Bartek Kryza
2023-03-11 19:00:14 +01:00
parent 41537c5401
commit f1c125bf32
17 changed files with 1066 additions and 609 deletions
+28 -12
View File
@@ -265,39 +265,55 @@ TEST_CASE("Test config diagram_templates", "[unit-test]")
auto cfg =
clanguml::config::load("./test_config_data/diagram_templates.yml");
REQUIRE(cfg.diagram_templates().size() == 3);
REQUIRE(cfg.diagram_templates().size() == 4);
REQUIRE(cfg.diagram_templates()["bases_hierarchy_tmpl"].type ==
REQUIRE(cfg.diagram_templates()["parents_hierarchy_tmpl"].type ==
clanguml::common::model::diagram_t::kClass);
REQUIRE(cfg.diagram_templates()["bases_hierarchy_tmpl"].jinja_template ==
R"("{{ class_name }}_parents_hierarchy":
REQUIRE(cfg.diagram_templates()["parents_hierarchy_tmpl"].jinja_template ==
"{{ diagram_name }}:"
R"(
type: class
{% if exists("glob") %}
glob: [{{ glob }}]
{% endif %}
{% if exists("using_namespace") %}
using_namespace: {{ using_namespace }}
{% endif %}
include:
parents: "{{ class_name }}"
namespaces: "{{ namespace_name }}"
parents: [{{ class_name }}]
namespaces: [{{ namespace_names }}]
relationships:
- inheritance
exclude:
access: [public, protected, private]
plantuml:
before:
- left to right direction)");
- left to right direction
)");
REQUIRE(cfg.diagram_templates()["children_hierarchy_tmpl"].type ==
clanguml::common::model::diagram_t::kClass);
REQUIRE(cfg.diagram_templates()["children_hierarchy_tmpl"].jinja_template ==
R"("{{ class_name }}_children_hierarchy":
REQUIRE(cfg.diagram_templates()["subclass_hierarchy_tmpl"].jinja_template ==
"{{ diagram_name }}:"
R"(
type: class
{% if exists("glob") %}
glob: [{{ glob }}]
{% endif %}
{% if exists("using_namespace") %}
using_namespace: {{ using_namespace }}
{% endif %}
include:
subclasses: "{{ class_name }}"
namespaces: "{{ namespace_name }}"
parents: [{{ class_name }}]
namespaces: [{{ namespace_name }}]
relationships:
- inheritance
exclude:
access: [public, protected, private]
plantuml:
before:
- left to right direction)");
- left to right direction
)");
REQUIRE(cfg.diagram_templates()["main_sequence_tmpl"].type ==
clanguml::common::model::diagram_t::kSequence);