Fixed config includes relative paths
This commit is contained in:
@@ -51,4 +51,24 @@ TEST_CASE("Test config inherited", "[unit-test]")
|
||||
CHECK(cus.glob()[0] == "src/main.cc");
|
||||
CHECK(clanguml::util::contains(cus.using_namespace(), "clanguml::ns1"));
|
||||
CHECK(cus.include_relations_also_as_members());
|
||||
}
|
||||
|
||||
TEST_CASE("Test config includes", "[unit-test]")
|
||||
{
|
||||
auto cfg = clanguml::config::load("./test_config_data/includes.yml");
|
||||
|
||||
CHECK(cfg.diagrams.size() == 2);
|
||||
auto &def = *cfg.diagrams["class_1"];
|
||||
CHECK(def.type() == clanguml::config::diagram_type::class_diagram);
|
||||
CHECK(def.glob().size() == 2);
|
||||
CHECK(def.glob()[0] == "src/**/*.cc");
|
||||
CHECK(def.glob()[1] == "src/**/*.h");
|
||||
CHECK(clanguml::util::contains(def.using_namespace(), "clanguml"));
|
||||
|
||||
auto &cus = *cfg.diagrams["class_2"];
|
||||
CHECK(cus.type() == clanguml::config::diagram_type::class_diagram);
|
||||
CHECK(cus.glob().size() == 1);
|
||||
CHECK(cus.glob()[0] == "src/main.cc");
|
||||
CHECK(clanguml::util::contains(cus.using_namespace(), "clanguml::ns1"));
|
||||
CHECK(cus.include_relations_also_as_members());
|
||||
}
|
||||
18
tests/test_config_data/includes.yml
Normal file
18
tests/test_config_data/includes.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
compilation_database_dir: debug
|
||||
output_directory: output
|
||||
include_relations_also_as_members: false
|
||||
using_namespace:
|
||||
- clanguml
|
||||
include:
|
||||
namespaces:
|
||||
- clanguml
|
||||
- ABCD
|
||||
glob:
|
||||
- src/**/*.cc
|
||||
- src/**/*.h
|
||||
|
||||
diagrams:
|
||||
class_1:
|
||||
include!: includes1.yml
|
||||
class_2:
|
||||
include!: includes2.yml
|
||||
1
tests/test_config_data/includes1.yml
Normal file
1
tests/test_config_data/includes1.yml
Normal file
@@ -0,0 +1 @@
|
||||
type: class
|
||||
6
tests/test_config_data/includes2.yml
Normal file
6
tests/test_config_data/includes2.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
type: class
|
||||
using_namespace:
|
||||
- clanguml::ns1
|
||||
include_relations_also_as_members: true
|
||||
glob:
|
||||
- src/main.cc
|
||||
Reference in New Issue
Block a user