Added --dump-config command line option (Fixes #77)

This commit is contained in:
Bartek Kryza
2023-01-17 23:43:44 +01:00
parent 74353603f8
commit 00b9321034
10 changed files with 1106 additions and 606 deletions

View File

@@ -187,4 +187,30 @@ TEST_CASE("Test config layout", "[unit-test]")
check_layout(static_cast<clanguml::config::package_diagram &>(
*cfg.diagrams["package_main"]),
clanguml::common::model::diagram_t::kPackage);
}
TEST_CASE("Test config emitters", "[unit-test]")
{
auto cfg = clanguml::config::load("./test_config_data/complete.yml");
YAML::Emitter out;
out.SetIndent(2);
out << cfg;
out << YAML::Newline;
// Write the emitted YAML to a temp file
auto tmp_file = std::filesystem::temp_directory_path() /
fmt::format("clang-uml-{:16}", rand());
{
std::ofstream stream(tmp_file.string().c_str(), std::ios::binary);
stream << out.c_str();
}
auto cfg_emitted = clanguml::config::load(tmp_file.string());
REQUIRE(cfg.diagrams.size() == cfg_emitted.diagrams.size());
std::filesystem::remove(tmp_file);
}