Added support for external system headers

This commit is contained in:
Bartek Kryza
2022-04-25 00:18:13 +02:00
parent 6e78e87bb0
commit bd0bb4455f
8 changed files with 33 additions and 0 deletions

View File

@@ -10,6 +10,8 @@ diagrams:
- ../../tests/t40001/**/*.h
# Render the paths relative to this directory
relative_to: ../../tests/t40001
# Include also external system headers
generate_system_headers: true
include:
# Include only headers belonging to these paths
paths:

View File

@@ -2,6 +2,10 @@
#include "lib1/lib1.h"
#include <cppast/cpp_preprocessor.hpp>
#include <string>
namespace clanguml::t40001 {
int foo() { return lib1::foo2(); }

View File

@@ -40,9 +40,14 @@ TEST_CASE("t40001", "[test-case][package]")
REQUIRE_THAT(puml, IsFile("t40001.cc"));
REQUIRE_THAT(puml, IsFile("t40001_include1.h"));
REQUIRE_THAT(puml, IsFile("string"));
REQUIRE_THAT(puml, IsFile("cppast/cpp_preprocessor.hpp"));
REQUIRE_THAT(puml, IsAssociation(_A("t40001.cc"), _A("t40001_include1.h")));
REQUIRE_THAT(puml, IsAssociation(_A("t40001_include1.h"), _A("lib1.h")));
REQUIRE_THAT(puml, IsDependency(_A("t40001_include1.h"), _A("string")));
save_puml(
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
}

View File

@@ -1,5 +1,7 @@
#include "../../include/lib1/lib1.h"
#include <string>
namespace clanguml::t40002::lib1 {
int foo0() { return 0; }

View File

@@ -44,6 +44,8 @@ TEST_CASE("t40002", "[test-case][package]")
REQUIRE_THAT(puml, IsFile("lib1.cc"));
REQUIRE_THAT(puml, IsFile("lib2.cc"));
REQUIRE_THAT(puml, !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")));