Added dependencies filter

This commit is contained in:
Bartek Kryza
2022-04-18 12:50:19 +02:00
parent 11dccf1496
commit 4ff563354f
7 changed files with 92 additions and 10 deletions

View File

@@ -11,5 +11,7 @@ diagrams:
include:
dependants:
- clanguml::t00043::dependants::A
dependencies:
- clanguml::t00043::dependencies::J
relationships:
- dependency

View File

@@ -29,4 +29,30 @@ struct F {
};
} // namespace dependants
namespace dependencies {
struct G {
};
struct GG {
};
struct H {
void h(G *g) { }
void hh(GG *gg) { }
};
struct HH {
void hh(G *g) { }
};
struct I {
void i(H *h) { }
};
struct J {
void i(I *i) { }
};
} // namespace dependencies
} // namespace clanguml::t00043

View File

@@ -35,6 +35,7 @@ TEST_CASE("t00043", "[test-case][class]")
REQUIRE_THAT(puml, StartsWith("@startuml"));
REQUIRE_THAT(puml, EndsWith("@enduml\n"));
// Check dependants filter
REQUIRE_THAT(puml, IsClass(_A("A")));
REQUIRE_THAT(puml, IsClass(_A("B")));
REQUIRE_THAT(puml, IsClass(_A("BB")));
@@ -48,6 +49,19 @@ TEST_CASE("t00043", "[test-case][class]")
REQUIRE_THAT(puml, IsDependency(_A("D"), _A("C")));
REQUIRE_THAT(puml, 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(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")));
save_puml(
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
}