Added basic include diagram test case

This commit is contained in:
Bartek Kryza
2022-04-10 13:33:16 +02:00
parent ac624c9247
commit f4d4633ece
7 changed files with 74 additions and 5 deletions

View File

@@ -3,8 +3,17 @@ output_directory: puml
diagrams:
t40001_include:
type: include
# Provide the files to parse in order to look
# for #include directives
glob:
- ../../tests/t40001/t40001.cc
- ../../tests/t40001/**/*.cc
- ../../tests/t40001/**/*.h
# Render the paths relative to this directory
relative_to: ../../tests/t40001
include:
# Include only headers belonging to these paths
paths:
- ../../tests/t40001
plantuml:
before:
- "' t40001 test include diagram"

View File

@@ -0,0 +1,7 @@
#pragma once
namespace clanguml::t40001::lib1 {
int foo2() { return 0; }
}

View File

@@ -1,7 +1,7 @@
#include <string>
#include <vector>
#include "include/t40001_include1.h"
#include "../include/t40001_include1.h"
namespace clanguml {
namespace t40001 {

View File

@@ -35,6 +35,14 @@ TEST_CASE("t40001", "[test-case][package]")
REQUIRE_THAT(puml, StartsWith("@startuml"));
REQUIRE_THAT(puml, EndsWith("@enduml\n"));
REQUIRE_THAT(puml, IsFolder("lib1"));
REQUIRE_THAT(puml, IsFile("lib1.h"));
REQUIRE_THAT(puml, IsFile("t40001.cc"));
REQUIRE_THAT(puml, IsFile("t40001_include1.h"));
REQUIRE_THAT(puml, IsAssociation(_A("t40001.cc"), _A("t40001_include1.h")));
REQUIRE_THAT(puml, IsAssociation(_A("t40001_include1.h"), _A("lib1.h")));
save_puml(
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
}