Refactored handling of relative paths (#213)

This commit is contained in:
Bartek Kryza
2023-12-08 08:17:00 +01:00
parent f1d3695ccc
commit d7195d5a5d
130 changed files with 317 additions and 255 deletions

View File

@@ -269,7 +269,10 @@ std::unique_ptr<class_> template_builder::build(const clang::NamedDecl *cls,
template_instantiation.set_id( template_instantiation.set_id(
common::to_id(template_instantiation_ptr->full_name(false))); common::to_id(template_instantiation_ptr->full_name(false)));
visitor_.set_source_location(*template_decl, *template_instantiation_ptr); visitor_.set_source_location(*template_decl, template_instantiation);
LOG_DBG("**** {} -> {}", template_instantiation.full_name(false),
template_instantiation.file());
return template_instantiation_ptr; return template_instantiation_ptr;
} }

View File

@@ -724,7 +724,10 @@ paths_filter::paths_filter(filter_t type, const std::filesystem::path &root,
resolved_absolute_path.make_preferred(); resolved_absolute_path.make_preferred();
paths_.emplace_back(resolved_absolute_path); LOG_DBG("Added path {} to paths_filter",
resolved_absolute_path.string());
paths_.emplace_back(std::move(resolved_absolute_path));
match_successful = true; match_successful = true;
} }
@@ -738,8 +741,8 @@ paths_filter::paths_filter(filter_t type, const std::filesystem::path &root,
if (!match_successful) if (!match_successful)
LOG_WARN("Paths filter pattern '{}' did not match " LOG_WARN("Paths filter pattern '{}' did not match "
"any files...", "any files relative to '{}'",
path); path, root_.string());
} }
} }
@@ -1059,8 +1062,7 @@ void diagram_filter::init_filters(const config::diagram &c)
if (auto p = path.get<std::string>(); p.has_value()) { if (auto p = path.get<std::string>(); p.has_value()) {
std::filesystem::path dep_path{*p}; std::filesystem::path dep_path{*p};
if (dep_path.is_relative()) { if (dep_path.is_relative()) {
dep_path = c.base_directory() / *p; dep_path = relative(*p, c.root_directory());
dep_path = relative(dep_path, c.relative_to());
} }
dependants.emplace_back( dependants.emplace_back(
@@ -1072,8 +1074,7 @@ void diagram_filter::init_filters(const config::diagram &c)
if (auto p = path.get<std::string>(); p.has_value()) { if (auto p = path.get<std::string>(); p.has_value()) {
std::filesystem::path dep_path{*p}; std::filesystem::path dep_path{*p};
if (dep_path.is_relative()) { if (dep_path.is_relative()) {
dep_path = c.base_directory() / *p; dep_path = relative(*p, c.root_directory());
dep_path = relative(dep_path, c.relative_to());
} }
dependencies.emplace_back( dependencies.emplace_back(

View File

@@ -26,7 +26,7 @@ namespace clanguml::common::visitor {
translation_unit_visitor::translation_unit_visitor( translation_unit_visitor::translation_unit_visitor(
clang::SourceManager &sm, const clanguml::config::diagram &config) clang::SourceManager &sm, const clanguml::config::diagram &config)
: source_manager_{sm} : source_manager_{sm}
, relative_to_path_{config.relative_to()} , relative_to_path_{config.root_directory()}
{ {
if (config.comment_parser() == config::comment_parser_t::plain) { if (config.comment_parser() == config::comment_parser_t::plain) {
comment_visitor_ = comment_visitor_ =
@@ -108,6 +108,8 @@ void translation_unit_visitor::set_source_location(
const clang::SourceLocation &location, const clang::SourceLocation &location,
clanguml::common::model::source_location &element) clanguml::common::model::source_location &element)
{ {
namespace fs = std::filesystem;
std::string file; std::string file;
unsigned line{}; unsigned line{};
unsigned column{}; unsigned column{};
@@ -133,15 +135,25 @@ void translation_unit_visitor::set_source_location(
} }
} }
if (std::filesystem::path file_path{file}; !file_path.is_absolute()) { // ensure the path is absolute
file_path = fs::path file_path{file};
std::filesystem::canonical(std::filesystem::absolute(file_path)); if (!file_path.is_absolute()) {
file = file_path.string(); file_path = fs::absolute(file_path);
} }
file_path = fs::canonical(file_path);
if (!util::is_relative_to(file_path, relative_to_path_)) {
return;
}
file = file_path.string();
element.set_file(file); element.set_file(file);
if (util::is_relative_to(file_path, relative_to_path_)) {
element.set_file_relative(util::path_to_url( element.set_file_relative(util::path_to_url(
std::filesystem::relative(element.file(), relative_to_path_).string())); fs::relative(element.file(), relative_to_path_).string()));
}
element.set_translation_unit(tu_path().string()); element.set_translation_unit(tu_path().string());
element.set_line(line); element.set_line(line);
element.set_column(column); element.set_column(column);

View File

@@ -233,8 +233,7 @@ std::vector<std::string> diagram::get_translation_units() const
{ {
std::vector<std::string> translation_units{}; std::vector<std::string> translation_units{};
LOG_DBG("Looking for translation units in {}", LOG_DBG("Looking for translation units in {}", root_directory().string());
std::filesystem::current_path().string());
for (const auto &g : glob()) { for (const auto &g : glob()) {
std::string glob_path = std::string glob_path =

View File

@@ -482,10 +482,6 @@ struct inheritable_diagram_options {
// This is the absolute filesystem path to the directory containing // This is the absolute filesystem path to the directory containing
// the current .clang-uml config file - it is set automatically // the current .clang-uml config file - it is set automatically
option<std::filesystem::path> base_directory{"__parent_path"}; option<std::filesystem::path> base_directory{"__parent_path"};
// This is the relative path with respect to the `base_directory`,
// against which all matches are made, if not provided it defaults to
// the `base_directory`
option<std::filesystem::path> relative_to{"relative_to"};
option<bool> generate_system_headers{"generate_system_headers", false}; option<bool> generate_system_headers{"generate_system_headers", false};
option<relationship_hints_t> relationship_hints{"relationship_hints"}; option<relationship_hints_t> relationship_hints{"relationship_hints"};
option<type_aliases_t> type_aliases{"type_aliases"}; option<type_aliases_t> type_aliases{"type_aliases"};
@@ -502,6 +498,30 @@ struct inheritable_diagram_options {
"message_comment_width", clanguml::util::kDefaultMessageCommentWidth}; "message_comment_width", clanguml::util::kDefaultMessageCommentWidth};
option<bool> debug_mode{"debug_mode", false}; option<bool> debug_mode{"debug_mode", false};
option<bool> generate_metadata{"generate_metadata", true}; option<bool> generate_metadata{"generate_metadata", true};
/**
* @brief Get reference to `relative_to` diagram config option
*
* This method is only to allow access to `relative_to` for loading
* and adjusting configuration file and for making test cases work.
*
* Instead use @see config::diagram::root_directory() method.
*
* @return Reference to `relative_to` config option.
*/
option<std::filesystem::path> &get_relative_to() { return relative_to; }
protected:
// This is the relative path with respect to the `base_directory`,
// against which all matches are made, if not provided it defaults to
// the `base_directory`
//
// This option should not be accessed directly in code - instead use
// @see config::diagram::root_directory()
option<std::filesystem::path> relative_to{"relative_to"};
friend YAML::Emitter &operator<<(
YAML::Emitter &out, const inheritable_diagram_options &c);
}; };
/** /**

View File

@@ -602,7 +602,7 @@ template <> struct convert<class_diagram> {
get_option(node, rhs.skip_redundant_dependencies); get_option(node, rhs.skip_redundant_dependencies);
get_option(node, rhs.relationship_hints); get_option(node, rhs.relationship_hints);
get_option(node, rhs.type_aliases); get_option(node, rhs.type_aliases);
get_option(node, rhs.relative_to); get_option(node, rhs.get_relative_to());
rhs.initialize_relationship_hints(); rhs.initialize_relationship_hints();
rhs.initialize_type_aliases(); rhs.initialize_type_aliases();
@@ -626,15 +626,15 @@ template <> struct convert<sequence_diagram> {
get_option(node, rhs.combine_free_functions_into_file_participants); get_option(node, rhs.combine_free_functions_into_file_participants);
get_option(node, rhs.generate_return_types); get_option(node, rhs.generate_return_types);
get_option(node, rhs.generate_condition_statements); get_option(node, rhs.generate_condition_statements);
get_option(node, rhs.relative_to); get_option(node, rhs.get_relative_to());
get_option(node, rhs.participants_order); get_option(node, rhs.participants_order);
get_option(node, rhs.generate_method_arguments); get_option(node, rhs.generate_method_arguments);
get_option(node, rhs.generate_message_comments); get_option(node, rhs.generate_message_comments);
get_option(node, rhs.message_comment_width); get_option(node, rhs.message_comment_width);
// Ensure relative_to has a value // Ensure relative_to has a value
if (!rhs.relative_to.has_value) if (!rhs.get_relative_to().has_value)
rhs.relative_to.set( rhs.get_relative_to().set(
std::filesystem::current_path().lexically_normal()); std::filesystem::current_path().lexically_normal());
rhs.initialize_type_aliases(); rhs.initialize_type_aliases();
@@ -653,12 +653,12 @@ template <> struct convert<package_diagram> {
return false; return false;
get_option(node, rhs.layout); get_option(node, rhs.layout);
get_option(node, rhs.relative_to); get_option(node, rhs.get_relative_to());
get_option(node, rhs.package_type); get_option(node, rhs.package_type);
// Ensure relative_to has a value // Ensure relative_to has a value
if (!rhs.relative_to.has_value) if (!rhs.get_relative_to().has_value)
rhs.relative_to.set( rhs.get_relative_to().set(
std::filesystem::current_path().lexically_normal()); std::filesystem::current_path().lexically_normal());
return true; return true;
@@ -675,21 +675,12 @@ template <> struct convert<include_diagram> {
return false; return false;
get_option(node, rhs.layout); get_option(node, rhs.layout);
get_option(node, rhs.relative_to); get_option(node, rhs.get_relative_to());
get_option(node, rhs.generate_system_headers); get_option(node, rhs.generate_system_headers);
if (!rhs.relative_to) if (!rhs.get_relative_to().has_value)
rhs.relative_to.set(std::filesystem::current_path()); rhs.get_relative_to().set(
std::filesystem::current_path().lexically_normal());
// Convert the path in relative_to to an absolute path, with respect
// to the directory where the `.clang-uml` configuration file is
// located
if (rhs.relative_to) {
auto absolute_relative_to =
std::filesystem::path{node["__parent_path"].as<std::string>()} /
rhs.relative_to();
rhs.relative_to.set(absolute_relative_to.lexically_normal());
}
return true; return true;
} }
@@ -824,7 +815,7 @@ template <> struct convert<config> {
get_option(node, rhs.message_comment_width); get_option(node, rhs.message_comment_width);
rhs.base_directory.set(node["__parent_path"].as<std::string>()); rhs.base_directory.set(node["__parent_path"].as<std::string>());
get_option(node, rhs.relative_to); get_option(node, rhs.get_relative_to());
get_option(node, rhs.diagram_templates); get_option(node, rhs.diagram_templates);

View File

@@ -95,12 +95,8 @@ void translation_unit_visitor::include_visitor::InclusionDirective(
LOG_DBG("Processing include directive {} in file {}", include_path.string(), LOG_DBG("Processing include directive {} in file {}", include_path.string(),
current_file.string()); current_file.string());
auto relative_include_path = include_path; auto relative_include_path =
if (config().relative_to) { std::filesystem::relative(include_path, config().root_directory());
const std::filesystem::path relative_to{config().relative_to()};
relative_include_path =
std::filesystem::relative(include_path, relative_to);
}
if (diagram().should_include(source_file{include_path})) { if (diagram().should_include(source_file{include_path})) {
process_internal_header(include_path, process_internal_header(include_path,
@@ -133,12 +129,8 @@ void translation_unit_visitor::include_visitor::process_internal_header(
const common::id_t current_file_id) const common::id_t current_file_id)
{ {
// Make the path relative with respect to relative_to config option // Make the path relative with respect to relative_to config option
auto relative_include_path = include_path; auto relative_include_path =
if (config().relative_to) { std::filesystem::relative(include_path, config().root_directory());
const std::filesystem::path relative_to{config().relative_to()};
relative_include_path =
std::filesystem::relative(include_path, relative_to);
}
// Check if this source file is already registered in the diagram, // Check if this source file is already registered in the diagram,
// if not add it // if not add it
@@ -218,13 +210,9 @@ translation_unit_visitor::include_visitor::process_source_file(
if (diagram().should_include(source_file{file_path})) { if (diagram().should_include(source_file{file_path})) {
LOG_DBG("Processing source file {}", file.string()); LOG_DBG("Processing source file {}", file.string());
// Relativize the path with respect to relative_to config option // Relativize the path with respect to effective root directory
auto relative_file_path = file_path; auto relative_file_path =
if (config().relative_to) { std::filesystem::relative(file_path, config().root_directory());
const std::filesystem::path relative_to{config().relative_to()};
relative_file_path =
std::filesystem::relative(file_path, relative_to);
}
[[maybe_unused]] const auto relative_file_path_str = [[maybe_unused]] const auto relative_file_path_str =
relative_file_path.string(); relative_file_path.string();

View File

@@ -400,7 +400,7 @@ void generator::generate_participant(
if (is_participant_generated(file_id)) if (is_participant_generated(file_id))
return; return;
auto participant_name = util::path_to_url(std::filesystem::relative( auto participant_name = util::path_to_url(relative(
std::filesystem::path{file_path}, config().root_directory()) std::filesystem::path{file_path}, config().root_directory())
.string()); .string());

View File

@@ -2311,9 +2311,13 @@ std::string translation_unit_visitor::make_lambda_name(
const auto location = cls->getLocation(); const auto location = cls->getLocation();
const auto file_line = source_manager().getSpellingLineNumber(location); const auto file_line = source_manager().getSpellingLineNumber(location);
const auto file_column = source_manager().getSpellingColumnNumber(location); const auto file_column = source_manager().getSpellingColumnNumber(location);
const std::string file_name = util::path_to_url(std::filesystem::relative( const std::string file_name = config().make_path_relative(
source_manager().getFilename(location).str(), config().relative_to()) source_manager().getFilename(location).str());
.string()); //
// util::path_to_url(std::filesystem::relative(
// source_manager().getFilename(location).str(),
// config().relative_to())
// .string());
if (context().caller_id() != 0 && if (context().caller_id() != 0 &&
get_participant(context().caller_id()).has_value()) { get_participant(context().caller_id()).has_value()) {

View File

@@ -404,6 +404,15 @@ std::filesystem::path ensure_path_is_absolute(
return result; return result;
} }
bool is_relative_to(
const std::filesystem::path &child, const std::filesystem::path &parent)
{
if (child.has_root_directory() != parent.has_root_directory())
return false;
return starts_with(child, parent);
}
std::string format_message_comment(const std::string &comment, unsigned width) std::string format_message_comment(const std::string &comment, unsigned width)
{ {
if (width == 0) if (width == 0)

View File

@@ -435,6 +435,17 @@ std::string path_to_url(const std::filesystem::path &p);
std::filesystem::path ensure_path_is_absolute(const std::filesystem::path &p, std::filesystem::path ensure_path_is_absolute(const std::filesystem::path &p,
const std::filesystem::path &root = std::filesystem::current_path()); const std::filesystem::path &root = std::filesystem::current_path());
/**
* @brief Check if a given path is relative to another path.
*
* @param parent The path to be checked for relativity.
* @param right The base path against which the relativity is checked.
* @return True if the child path is relative to the parent path, false
* otherwise.
*/
bool is_relative_to(
const std::filesystem::path &parent, const std::filesystem::path &child);
std::string format_message_comment( std::string format_message_comment(
const std::string &c, unsigned width = kDefaultMessageCommentWidth); const std::string &c, unsigned width = kDefaultMessageCommentWidth);

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
title: Basic class diagram example title: Basic class diagram example
glob: glob:
- ../../tests/t00002/t00002.cc - tests/t00002/t00002.cc
comment_parser: clang comment_parser: clang
using_namespace: using_namespace:
- clanguml::t00002 - clanguml::t00002

View File

@@ -4,7 +4,7 @@ diagrams:
t00003_class: t00003_class:
type: class type: class
glob: glob:
- ../../tests/t00003/t00003.cc - tests/t00003/t00003.cc
using_namespace: clanguml::t00003 using_namespace: clanguml::t00003
include: include:
namespaces: namespaces:

View File

@@ -4,7 +4,7 @@ diagrams:
t00004_class: t00004_class:
type: class type: class
glob: glob:
- ../../tests/t00004/t00004.cc - tests/t00004/t00004.cc
using_namespace: using_namespace:
- clanguml::t00004 - clanguml::t00004
- clanguml::t00004::A - clanguml::t00004::A

View File

@@ -4,7 +4,7 @@ diagrams:
t00005_class: t00005_class:
type: class type: class
glob: glob:
- ../../tests/t00005/t00005.cc - tests/t00005/t00005.cc
using_namespace: using_namespace:
- clanguml::t00005 - clanguml::t00005
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00006_class: t00006_class:
type: class type: class
glob: glob:
- ../../tests/t00006/t00006.cc - tests/t00006/t00006.cc
using_namespace: using_namespace:
- clanguml::t00006 - clanguml::t00006
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00007_class: t00007_class:
type: class type: class
glob: glob:
- ../../tests/t00007/t00007.cc - tests/t00007/t00007.cc
using_namespace: using_namespace:
- clanguml::t00007 - clanguml::t00007
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00008_class: t00008_class:
type: class type: class
glob: glob:
- ../../tests/t00008/t00008.cc - tests/t00008/t00008.cc
using_namespace: using_namespace:
- clanguml::t00008 - clanguml::t00008
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00009_class: t00009_class:
type: class type: class
glob: glob:
- ../../tests/t00009/t00009.cc - tests/t00009/t00009.cc
using_namespace: using_namespace:
- clanguml::t00009 - clanguml::t00009
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00010_class: t00010_class:
type: class type: class
glob: glob:
- ../../tests/t00010/t00010.cc - tests/t00010/t00010.cc
using_namespace: using_namespace:
- clanguml::t00010 - clanguml::t00010
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00011_class: t00011_class:
type: class type: class
glob: glob:
- ../../tests/t00011/t00011.cc - tests/t00011/t00011.cc
using_namespace: using_namespace:
- clanguml::t00011 - clanguml::t00011
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00012_class: t00012_class:
type: class type: class
glob: glob:
- ../../tests/t00012/t00012.cc - tests/t00012/t00012.cc
using_namespace: using_namespace:
- clanguml::t00012 - clanguml::t00012
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00013_class: t00013_class:
type: class type: class
glob: glob:
- ../../tests/t00013/t00013.cc - tests/t00013/t00013.cc
using_namespace: using_namespace:
- clanguml::t00013 - clanguml::t00013
include: include:

View File

@@ -4,7 +4,8 @@ diagrams:
t00014_class: t00014_class:
type: class type: class
glob: glob:
- ../../tests/t00014/t00014.cc - tests/t00014/t00014.cc
# relative_to: ../../..
using_namespace: using_namespace:
- clanguml::t00014 - clanguml::t00014
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00015_class: t00015_class:
type: class type: class
glob: glob:
- ../../tests/t00015/t00015.cc - tests/t00015/t00015.cc
using_namespace: using_namespace:
- clanguml::t00015 - clanguml::t00015
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00016_class: t00016_class:
type: class type: class
glob: glob:
- ../../tests/t00016/t00016.cc - tests/t00016/t00016.cc
using_namespace: using_namespace:
- clanguml::t00016 - clanguml::t00016
include: include:

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
include_relations_also_as_members: false include_relations_also_as_members: false
glob: glob:
- ../../tests/t00017/t00017.cc - tests/t00017/t00017.cc
using_namespace: using_namespace:
- clanguml::t00017 - clanguml::t00017
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00018_class: t00018_class:
type: class type: class
glob: glob:
- ../../tests/t00018/**.cc - tests/t00018/**.cc
using_namespace: using_namespace:
- clanguml::t00018 - clanguml::t00018
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00019_class: t00019_class:
type: class type: class
glob: glob:
- ../../tests/t00019/**.cc - tests/t00019/**.cc
generate_template_argument_dependencies: false generate_template_argument_dependencies: false
using_namespace: using_namespace:
- clanguml::t00019 - clanguml::t00019

View File

@@ -4,7 +4,7 @@ diagrams:
t00020_class: t00020_class:
type: class type: class
glob: glob:
- ../../tests/t00020/t00020.cc - tests/t00020/t00020.cc
using_namespace: using_namespace:
- clanguml::t00020 - clanguml::t00020
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00021_class: t00021_class:
type: class type: class
glob: glob:
- ../../tests/t00021/t00021.cc - tests/t00021/t00021.cc
using_namespace: using_namespace:
- clanguml::t00021 - clanguml::t00021
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00022_class: t00022_class:
type: class type: class
glob: glob:
- ../../tests/t00022/t00022.cc - tests/t00022/t00022.cc
using_namespace: using_namespace:
- clanguml::t00022 - clanguml::t00022
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00023_class: t00023_class:
type: class type: class
glob: glob:
- ../../tests/t00023/t00023.cc - tests/t00023/t00023.cc
using_namespace: using_namespace:
- clanguml::t00023 - clanguml::t00023
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00024_class: t00024_class:
type: class type: class
glob: glob:
- ../../tests/t00024/t00024.cc - tests/t00024/t00024.cc
using_namespace: using_namespace:
- clanguml::t00024 - clanguml::t00024
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00025_class: t00025_class:
type: class type: class
glob: glob:
- ../../tests/t00025/t00025.cc - tests/t00025/t00025.cc
using_namespace: using_namespace:
- clanguml::t00025 - clanguml::t00025
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00026_class: t00026_class:
type: class type: class
glob: glob:
- ../../tests/t00026/t00026.cc - tests/t00026/t00026.cc
using_namespace: using_namespace:
- clanguml::t00026 - clanguml::t00026
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00027_class: t00027_class:
type: class type: class
glob: glob:
- ../../tests/t00027/t00027.cc - tests/t00027/t00027.cc
using_namespace: using_namespace:
- clanguml::t00027 - clanguml::t00027
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00028_class: t00028_class:
type: class type: class
glob: glob:
- ../../tests/t00028/t00028.cc - tests/t00028/t00028.cc
using_namespace: using_namespace:
- clanguml::t00028 - clanguml::t00028
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00029_class: t00029_class:
type: class type: class
glob: glob:
- ../../tests/t00029/t00029.cc - tests/t00029/t00029.cc
using_namespace: using_namespace:
- clanguml::t00029 - clanguml::t00029
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00030_class: t00030_class:
type: class type: class
glob: glob:
- ../../tests/t00030/t00030.cc - tests/t00030/t00030.cc
using_namespace: using_namespace:
- clanguml::t00030 - clanguml::t00030
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00031_class: t00031_class:
type: class type: class
glob: glob:
- ../../tests/t00031/t00031.cc - tests/t00031/t00031.cc
skip_redundant_dependencies: false skip_redundant_dependencies: false
using_namespace: using_namespace:
- clanguml::t00031 - clanguml::t00031

View File

@@ -4,7 +4,7 @@ diagrams:
t00032_class: t00032_class:
type: class type: class
glob: glob:
- ../../tests/t00032/t00032.cc - tests/t00032/t00032.cc
using_namespace: using_namespace:
- clanguml::t00032 - clanguml::t00032
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00033_class: t00033_class:
type: class type: class
glob: glob:
- ../../tests/t00033/t00033.cc - tests/t00033/t00033.cc
using_namespace: using_namespace:
- clanguml::t00033 - clanguml::t00033
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00034_class: t00034_class:
type: class type: class
glob: glob:
- ../../tests/t00034/t00034.cc - tests/t00034/t00034.cc
using_namespace: using_namespace:
- clanguml::t00034 - clanguml::t00034
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00035_class: t00035_class:
type: class type: class
glob: glob:
- ../../tests/t00035/t00035.cc - tests/t00035/t00035.cc
using_namespace: using_namespace:
- clanguml::t00035 - clanguml::t00035
include: include:

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
generate_packages: true generate_packages: true
glob: glob:
- ../../tests/t00036/t00036.cc - tests/t00036/t00036.cc
using_namespace: using_namespace:
- clanguml::t00036 - clanguml::t00036
include: include:

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
generate_packages: true generate_packages: true
glob: glob:
- ../../tests/t00037/t00037.cc - tests/t00037/t00037.cc
using_namespace: using_namespace:
- clanguml::t00037 - clanguml::t00037
include: include:

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
generate_packages: false generate_packages: false
glob: glob:
- ../../tests/t00038/t00038.cc - tests/t00038/t00038.cc
using_namespace: using_namespace:
- clanguml::t00038 - clanguml::t00038
include: include:

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
generate_packages: false generate_packages: false
glob: glob:
- ../../tests/t00039/t00039.cc - tests/t00039/t00039.cc
using_namespace: using_namespace:
- clanguml::t00039 - clanguml::t00039
include: include:

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
generate_packages: false generate_packages: false
glob: glob:
- ../../tests/t00040/t00040.cc - tests/t00040/t00040.cc
using_namespace: using_namespace:
- clanguml::t00040 - clanguml::t00040
include: include:

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
generate_packages: false generate_packages: false
glob: glob:
- ../../tests/t00041/t00041.cc - tests/t00041/t00041.cc
using_namespace: using_namespace:
- clanguml::t00041 - clanguml::t00041
include: include:

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
generate_packages: false generate_packages: false
glob: glob:
- ../../tests/t00042/t00042.cc - tests/t00042/t00042.cc
using_namespace: using_namespace:
- clanguml::t00042 - clanguml::t00042
include: include:

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
generate_packages: true generate_packages: true
glob: glob:
- ../../tests/t00043/t00043.cc - tests/t00043/t00043.cc
using_namespace: using_namespace:
- clanguml::t00043 - clanguml::t00043
include: include:

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
generate_packages: true generate_packages: true
glob: glob:
- ../../tests/t00044/t00044.cc - tests/t00044/t00044.cc
using_namespace: using_namespace:
- clanguml::t00044 - clanguml::t00044
include: include:

View File

@@ -4,7 +4,7 @@ diagrams:
t00045_class: t00045_class:
type: class type: class
glob: glob:
- ../../tests/t00045/t00045.cc - tests/t00045/t00045.cc
exclude: exclude:
namespaces: namespaces:
- std - std

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
generate_packages: true generate_packages: true
glob: glob:
- ../../tests/t00046/t00046.cc - tests/t00046/t00046.cc
exclude: exclude:
namespaces: namespaces:
- std - std

View File

@@ -4,7 +4,7 @@ diagrams:
t00047_class: t00047_class:
type: class type: class
glob: glob:
- ../../tests/t00047/t00047.cc - tests/t00047/t00047.cc
using_namespace: clanguml::t00047 using_namespace: clanguml::t00047
include: include:
namespaces: namespaces:

View File

@@ -4,9 +4,9 @@ diagrams:
t00048_class: t00048_class:
type: class type: class
glob: glob:
- ../../tests/t00048/b_t00048.cc - tests/t00048/b_t00048.cc
- ../../tests/t00048/a_t00048.cc - tests/t00048/a_t00048.cc
- ../../tests/t00048/t00048.cc - tests/t00048/t00048.cc
using_namespace: clanguml::t00048 using_namespace: clanguml::t00048
include: include:
namespaces: namespaces:

View File

@@ -11,7 +11,7 @@ diagrams:
"std::vector<thestring>": string_vector "std::vector<thestring>": string_vector
"std::map<int,int>": intmap "std::map<int,int>": intmap
glob: glob:
- ../../tests/t00049/t00049.cc - tests/t00049/t00049.cc
include: include:
namespaces: namespaces:
- clanguml::t00049 - clanguml::t00049

View File

@@ -4,7 +4,7 @@ diagrams:
t00050_class: t00050_class:
type: class type: class
glob: glob:
- ../../tests/t00050/t00050.cc - tests/t00050/t00050.cc
comment_parser: clang comment_parser: clang
include: include:
namespaces: namespaces:

View File

@@ -4,7 +4,7 @@ diagrams:
t00051_class: t00051_class:
type: class type: class
glob: glob:
- ../../tests/t00051/t00051.cc - tests/t00051/t00051.cc
include: include:
namespaces: namespaces:
- clanguml::t00051 - clanguml::t00051

View File

@@ -45,14 +45,14 @@ TEST_CASE("t00051", "[test-case][class]")
"Function && f, Args &&... args"))); "Function && f, Args &&... args")));
REQUIRE_THAT(src, REQUIRE_THAT(src,
(IsMethod<Public>("thread", "void", (IsMethod<Public>("thread", "void",
"(lambda at ../../tests/t00051/t00051.cc:59:27) &&"))); "(lambda at tests/t00051/t00051.cc:59:27) &&")));
REQUIRE_THAT(src, REQUIRE_THAT(src,
(IsMethod<Private>("start_thread3", (IsMethod<Private>("start_thread3",
"B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at " "B<(lambda at tests/t00051/t00051.cc:43:18),(lambda at "
"../../tests/t00051/t00051.cc:43:27)>"))); "tests/t00051/t00051.cc:43:27)>")));
REQUIRE_THAT(src, REQUIRE_THAT(src,
(IsMethod<Private>("get_function", (IsMethod<Private>(
"(lambda at ../../tests/t00051/t00051.cc:48:16)"))); "get_function", "(lambda at tests/t00051/t00051.cc:48:16)")));
REQUIRE_THAT(src, IsClassTemplate("B", "F,FF=F")); REQUIRE_THAT(src, IsClassTemplate("B", "F,FF=F"));
REQUIRE_THAT(src, (IsMethod<Public>("f", "void"))); REQUIRE_THAT(src, (IsMethod<Public>("f", "void")));
@@ -60,18 +60,18 @@ TEST_CASE("t00051", "[test-case][class]")
REQUIRE_THAT(src, REQUIRE_THAT(src,
IsClassTemplate("B", IsClassTemplate("B",
"(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at " "(lambda at tests/t00051/t00051.cc:43:18),(lambda at "
"../../tests/t00051/t00051.cc:43:27)")); "tests/t00051/t00051.cc:43:27)"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
IsInstantiation(_A("B<F,FF=F>"), IsInstantiation(_A("B<F,FF=F>"),
_A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " _A("B<(lambda at tests/t00051/t00051.cc:43:18),(lambda "
"at ../../tests/t00051/t00051.cc:43:27)>"))); "at tests/t00051/t00051.cc:43:27)>")));
REQUIRE_THAT(src, REQUIRE_THAT(src,
IsDependency(_A("A"), IsDependency(_A("A"),
_A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " _A("B<(lambda at tests/t00051/t00051.cc:43:18),(lambda "
"at ../../tests/t00051/t00051.cc:43:27)>"))); "at tests/t00051/t00051.cc:43:27)>")));
save_puml(config.output_directory(), diagram->name + ".puml", src); save_puml(config.output_directory(), diagram->name + ".puml", src);
} }
@@ -103,33 +103,32 @@ TEST_CASE("t00051", "[test-case][class]")
"Function && f, Args &&... args"))); "Function && f, Args &&... args")));
REQUIRE_THAT(src, REQUIRE_THAT(src,
(IsMethod<Public>("thread", "void", (IsMethod<Public>("thread", "void",
"(lambda at ../../tests/t00051/t00051.cc:59:27) &&"))); "(lambda at tests/t00051/t00051.cc:59:27) &&")));
REQUIRE_THAT(src, REQUIRE_THAT(src,
(IsMethod<Private>("start_thread3", (IsMethod<Private>("start_thread3",
"B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at " "B<(lambda at tests/t00051/t00051.cc:43:18),(lambda at "
"../../tests/t00051/t00051.cc:43:27)>"))); "tests/t00051/t00051.cc:43:27)>")));
REQUIRE_THAT(src, REQUIRE_THAT(src,
(IsMethod<Private>("get_function", (IsMethod<Private>(
"(lambda at ../../tests/t00051/t00051.cc:48:16)"))); "get_function", "(lambda at tests/t00051/t00051.cc:48:16)")));
REQUIRE_THAT(src, IsClass(_A("B<F,FF=F>"))); REQUIRE_THAT(src, IsClass(_A("B<F,FF=F>")));
REQUIRE_THAT(src, (IsMethod<Public>("f", "void"))); REQUIRE_THAT(src, (IsMethod<Public>("f", "void")));
REQUIRE_THAT(src, (IsMethod<Public>("ff", "void"))); REQUIRE_THAT(src, (IsMethod<Public>("ff", "void")));
REQUIRE_THAT(src, REQUIRE_THAT(src,
IsClass(_A( IsClass(_A("B<(lambda at tests/t00051/t00051.cc:43:18),(lambda at "
"B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at " "tests/t00051/t00051.cc:43:27)>")));
"../../tests/t00051/t00051.cc:43:27)>")));
REQUIRE_THAT(src, REQUIRE_THAT(src,
IsInstantiation(_A("B<F,FF=F>"), IsInstantiation(_A("B<F,FF=F>"),
_A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " _A("B<(lambda at tests/t00051/t00051.cc:43:18),(lambda "
"at ../../tests/t00051/t00051.cc:43:27)>"))); "at tests/t00051/t00051.cc:43:27)>")));
REQUIRE_THAT(src, REQUIRE_THAT(src,
IsDependency(_A("A"), IsDependency(_A("A"),
_A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " _A("B<(lambda at tests/t00051/t00051.cc:43:18),(lambda "
"at ../../tests/t00051/t00051.cc:43:27)>"))); "at tests/t00051/t00051.cc:43:27)>")));
save_mermaid(config.output_directory(), diagram->name + ".mmd", src); save_mermaid(config.output_directory(), diagram->name + ".mmd", src);
} }

View File

@@ -4,7 +4,7 @@ diagrams:
t00052_class: t00052_class:
type: class type: class
glob: glob:
- ../../tests/t00052/t00052.cc - tests/t00052/t00052.cc
include: include:
namespaces: namespaces:
- clanguml::t00052 - clanguml::t00052

View File

@@ -4,7 +4,7 @@ diagrams:
t00053_class: t00053_class:
type: class type: class
glob: glob:
- ../../tests/t00053/t00053.cc - tests/t00053/t00053.cc
include: include:
namespaces: namespaces:
- clanguml::t00053 - clanguml::t00053

View File

@@ -4,7 +4,7 @@ diagrams:
t00054_class: t00054_class:
type: class type: class
glob: glob:
- ../../tests/t00054/t00054.cc - tests/t00054/t00054.cc
include: include:
namespaces: namespaces:
- clanguml::t00054 - clanguml::t00054

View File

@@ -4,7 +4,7 @@ diagrams:
t00055_class: t00055_class:
type: class type: class
glob: glob:
- ../../tests/t00055/t00055.cc - tests/t00055/t00055.cc
include: include:
namespaces: namespaces:
- clanguml::t00055 - clanguml::t00055

View File

@@ -4,7 +4,7 @@ diagrams:
t00056_class: t00056_class:
type: class type: class
glob: glob:
- ../../tests/t00056/t00056.cc - tests/t00056/t00056.cc
include: include:
namespaces: namespaces:
- clanguml::t00056 - clanguml::t00056

View File

@@ -4,5 +4,5 @@ diagrams:
t00057_class: t00057_class:
type: class type: class
glob: glob:
- ../../tests/t00057/t00057.c - tests/t00057/t00057.c
- ../../tests/t00057/src/t00057_impl.c - tests/t00057/src/t00057_impl.c

View File

@@ -4,7 +4,7 @@ diagrams:
t00058_class: t00058_class:
type: class type: class
glob: glob:
- ../../tests/t00058/t00058.cc - tests/t00058/t00058.cc
include: include:
namespaces: namespaces:
- clanguml::t00058 - clanguml::t00058

View File

@@ -4,7 +4,7 @@ diagrams:
t00059_class: t00059_class:
type: class type: class
glob: glob:
- ../../tests/t00059/t00059.cc - tests/t00059/t00059.cc
include: include:
namespaces: namespaces:
- clanguml::t00059 - clanguml::t00059

View File

@@ -4,7 +4,7 @@ diagrams:
t00060_class: t00060_class:
type: class type: class
glob: glob:
- ../../tests/t00060/t00060.cc - tests/t00060/t00060.cc
include: include:
namespaces: namespaces:
- clanguml::t00060 - clanguml::t00060

View File

@@ -4,7 +4,7 @@ diagrams:
t00062_class: t00062_class:
type: class type: class
glob: glob:
- ../../tests/t00062/t00062.cc - tests/t00062/t00062.cc
include: include:
namespaces: namespaces:
- clanguml::t00062 - clanguml::t00062

View File

@@ -4,7 +4,7 @@ diagrams:
t00063_class: t00063_class:
type: class type: class
glob: glob:
- ../../tests/t00063/t00063.cc - tests/t00063/t00063.cc
include: include:
namespaces: namespaces:
- clanguml::t00063 - clanguml::t00063

View File

@@ -4,7 +4,7 @@ diagrams:
t00064_class: t00064_class:
type: class type: class
glob: glob:
- ../../tests/t00064/t00064.cc - tests/t00064/t00064.cc
include: include:
namespaces: namespaces:
- clanguml::t00064 - clanguml::t00064

View File

@@ -4,7 +4,7 @@ diagrams:
t00066_class: t00066_class:
type: class type: class
glob: glob:
- ../../tests/t00066/t00066.cc - tests/t00066/t00066.cc
include: include:
namespaces: namespaces:
- clanguml::t00066 - clanguml::t00066

View File

@@ -4,7 +4,7 @@ diagrams:
t00067_class: t00067_class:
type: class type: class
glob: glob:
- ../../tests/t00067/t00067.cc - tests/t00067/t00067.cc
include: include:
namespaces: namespaces:
- clanguml::t00067 - clanguml::t00067

View File

@@ -5,7 +5,7 @@ diagrams:
type: class type: class
title: AAA context of radius 0 title: AAA context of radius 0
glob: glob:
- ../../tests/t00068/t00068.cc - tests/t00068/t00068.cc
include: include:
namespaces: namespaces:
- clanguml::t00068 - clanguml::t00068
@@ -19,7 +19,7 @@ diagrams:
type: class type: class
title: AAA context of radius 1 title: AAA context of radius 1
glob: glob:
- ../../tests/t00068/t00068.cc - tests/t00068/t00068.cc
include: include:
namespaces: namespaces:
- clanguml::t00068 - clanguml::t00068
@@ -33,7 +33,7 @@ diagrams:
type: class type: class
title: AAA context of radius 2 title: AAA context of radius 2
glob: glob:
- ../../tests/t00068/t00068.cc - tests/t00068/t00068.cc
include: include:
namespaces: namespaces:
- clanguml::t00068 - clanguml::t00068

View File

@@ -7,7 +7,7 @@ diagrams:
type: sequence type: sequence
title: Basic sequence diagram example title: Basic sequence diagram example
glob: glob:
- ../../tests/t20001/t20001.cc - tests/t20001/t20001.cc
include: include:
namespaces: namespaces:
- clanguml::t20001 - clanguml::t20001

View File

@@ -4,7 +4,7 @@ diagrams:
t20002_sequence: t20002_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20002/t20002.cc - tests/t20002/t20002.cc
include: include:
namespaces: namespaces:
- clanguml::t20002 - clanguml::t20002

View File

@@ -4,7 +4,7 @@ diagrams:
t20003_sequence: t20003_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20003/t20003.cc - tests/t20003/t20003.cc
include: include:
namespaces: namespaces:
- clanguml::t20003 - clanguml::t20003

View File

@@ -4,7 +4,7 @@ diagrams:
t20004_sequence: t20004_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20004/t20004.cc - tests/t20004/t20004.cc
include: include:
namespaces: namespaces:
- clanguml::t20004 - clanguml::t20004

View File

@@ -4,7 +4,7 @@ diagrams:
t20005_sequence: t20005_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20005/t20005.cc - tests/t20005/t20005.cc
include: include:
namespaces: namespaces:
- clanguml::t20005 - clanguml::t20005

View File

@@ -4,7 +4,7 @@ diagrams:
t20006_sequence: t20006_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20006/t20006.cc - tests/t20006/t20006.cc
include: include:
namespaces: namespaces:
- clanguml::t20006 - clanguml::t20006

View File

@@ -4,7 +4,7 @@ diagrams:
t20007_sequence: t20007_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20007/t20007.cc - tests/t20007/t20007.cc
include: include:
namespaces: namespaces:
- clanguml::t20007 - clanguml::t20007

View File

@@ -4,7 +4,7 @@ diagrams:
t20008_sequence: t20008_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20008/t20008.cc - tests/t20008/t20008.cc
include: include:
namespaces: namespaces:
- clanguml::t20008 - clanguml::t20008

View File

@@ -4,7 +4,7 @@ diagrams:
t20009_sequence: t20009_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20009/t20009.cc - tests/t20009/t20009.cc
include: include:
namespaces: namespaces:
- clanguml::t20009 - clanguml::t20009

View File

@@ -4,7 +4,7 @@ diagrams:
t20010_sequence: t20010_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20010/t20010.cc - tests/t20010/t20010.cc
include: include:
namespaces: namespaces:
- clanguml::t20010 - clanguml::t20010

View File

@@ -4,7 +4,7 @@ diagrams:
t20011_sequence: t20011_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20011/t20011.cc - tests/t20011/t20011.cc
include: include:
namespaces: namespaces:
- clanguml::t20011 - clanguml::t20011

View File

@@ -4,7 +4,7 @@ diagrams:
t20012_sequence: t20012_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20012/t20012.cc - tests/t20012/t20012.cc
include: include:
namespaces: namespaces:
- clanguml::t20012 - clanguml::t20012

View File

@@ -37,41 +37,41 @@ TEST_CASE("t20012", "[test-case][sequence]")
// Check if all calls exist // Check if all calls exist
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()"), HasCall(_A("tmain()"),
_A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), _A("tmain()::(lambda tests/t20012/t20012.cc:67:20)"),
"operator()()")); "operator()()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), HasCall(_A("tmain()::(lambda tests/t20012/t20012.cc:67:20)"),
_A("A"), "a()")); _A("A"), "a()"));
REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aa()")); REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aa()"));
REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aaa()")); REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aaa()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), HasCall(_A("tmain()::(lambda tests/t20012/t20012.cc:67:20)"),
_A("B"), "b()")); _A("B"), "b()"));
REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bb()")); REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bb()"));
REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bbb()")); REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bbb()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)"), HasCall(_A("tmain()::(lambda tests/t20012/t20012.cc:80:20)"),
_A("C"), "c()")); _A("C"), "c()"));
REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "cc()")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "cc()"));
REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)"), HasCall(_A("tmain()::(lambda tests/t20012/t20012.cc:80:20)"),
_A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), _A("tmain()::(lambda tests/t20012/t20012.cc:67:20)"),
"operator()()")); "operator()()"));
REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()"), HasCall(_A("tmain()"),
_A("R<R::(lambda ../../tests/t20012/t20012.cc:86:9)>"), "r()")); _A("R<R::(lambda tests/t20012/t20012.cc:86:9)>"), "r()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("R<R::(lambda ../../tests/t20012/t20012.cc:86:9)>"), HasCall(_A("R<R::(lambda tests/t20012/t20012.cc:86:9)>"),
_A("tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)"), _A("tmain()::(lambda tests/t20012/t20012.cc:86:9)"),
"operator()()")); "operator()()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)"), HasCall(_A("tmain()::(lambda tests/t20012/t20012.cc:86:9)"),
_A("C"), "c()")); _A("C"), "c()"));
// @todo #168 // @todo #168
@@ -87,32 +87,27 @@ TEST_CASE("t20012", "[test-case][sequence]")
std::vector<int> messages = { std::vector<int> messages = {
FindMessage(j, "tmain()", FindMessage(j, "tmain()",
"tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)", "tmain()::(lambda tests/t20012/t20012.cc:67:20)",
"operator()()"), "operator()()"),
FindMessage(j, FindMessage(j, "tmain()::(lambda tests/t20012/t20012.cc:67:20)",
"tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)", "A", "A", "a()"),
"a()"),
FindMessage(j, "A", "A", "aa()"), FindMessage(j, "A", "A", "aaa()"), FindMessage(j, "A", "A", "aa()"), FindMessage(j, "A", "A", "aaa()"),
FindMessage(j, FindMessage(j, "tmain()::(lambda tests/t20012/t20012.cc:67:20)",
"tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)", "B", "B", "b()"),
"b()"),
FindMessage(j, "B", "B", "bb()"), FindMessage(j, "B", "B", "bbb()"), FindMessage(j, "B", "B", "bb()"), FindMessage(j, "B", "B", "bbb()"),
FindMessage(j, FindMessage(j, "tmain()::(lambda tests/t20012/t20012.cc:80:20)",
"tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)", "C", "C", "c()"),
"c()"),
FindMessage(j, "C", "C", "cc()"), FindMessage(j, "C", "C", "ccc()"), FindMessage(j, "C", "C", "cc()"), FindMessage(j, "C", "C", "ccc()"),
FindMessage(j, FindMessage(j, "tmain()::(lambda tests/t20012/t20012.cc:80:20)",
"tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)", "tmain()::(lambda tests/t20012/t20012.cc:67:20)",
"tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)",
"operator()()"), "operator()()"),
FindMessage(j, "tmain()", FindMessage(j, "tmain()",
"R<R::(lambda ../../tests/t20012/t20012.cc:86:9)>", "r()"), "R<R::(lambda tests/t20012/t20012.cc:86:9)>", "r()"),
FindMessage(j, "R<R::(lambda ../../tests/t20012/t20012.cc:86:9)>", FindMessage(j, "R<R::(lambda tests/t20012/t20012.cc:86:9)>",
"tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)", "tmain()::(lambda tests/t20012/t20012.cc:86:9)",
"operator()()"), "operator()()"),
FindMessage(j, FindMessage(
"tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)", "C", j, "tmain()::(lambda tests/t20012/t20012.cc:86:9)", "C", "c()"),
"c()"),
// @todo #168 // @todo #168
// FindMessage(j, "tmain()", "D", "add5(int)") // FindMessage(j, "tmain()", "D", "add5(int)")
}; };
@@ -130,41 +125,41 @@ TEST_CASE("t20012", "[test-case][sequence]")
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()"), HasCall(_A("tmain()"),
_A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), _A("tmain()::(lambda tests/t20012/t20012.cc:67:20)"),
"operator()()")); "operator()()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), HasCall(_A("tmain()::(lambda tests/t20012/t20012.cc:67:20)"),
_A("A"), "a()")); _A("A"), "a()"));
REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aa()")); REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aa()"));
REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aaa()")); REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aaa()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), HasCall(_A("tmain()::(lambda tests/t20012/t20012.cc:67:20)"),
_A("B"), "b()")); _A("B"), "b()"));
REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bb()")); REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bb()"));
REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bbb()")); REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bbb()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)"), HasCall(_A("tmain()::(lambda tests/t20012/t20012.cc:80:20)"),
_A("C"), "c()")); _A("C"), "c()"));
REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "cc()")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "cc()"));
REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)"), HasCall(_A("tmain()::(lambda tests/t20012/t20012.cc:80:20)"),
_A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), _A("tmain()::(lambda tests/t20012/t20012.cc:67:20)"),
"operator()()")); "operator()()"));
REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()"), HasCall(_A("tmain()"),
_A("R<R::(lambda ../../tests/t20012/t20012.cc:86:9)>"), "r()")); _A("R<R::(lambda tests/t20012/t20012.cc:86:9)>"), "r()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("R<R::(lambda ../../tests/t20012/t20012.cc:86:9)>"), HasCall(_A("R<R::(lambda tests/t20012/t20012.cc:86:9)>"),
_A("tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)"), _A("tmain()::(lambda tests/t20012/t20012.cc:86:9)"),
"operator()()")); "operator()()"));
REQUIRE_THAT(src, REQUIRE_THAT(src,
HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)"), HasCall(_A("tmain()::(lambda tests/t20012/t20012.cc:86:9)"),
_A("C"), "c()")); _A("C"), "c()"));
save_mermaid(config.output_directory(), diagram->name + ".mmd", src); save_mermaid(config.output_directory(), diagram->name + ".mmd", src);

View File

@@ -4,7 +4,7 @@ diagrams:
t20013_sequence: t20013_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20013/t20013.cc - tests/t20013/t20013.cc
include: include:
namespaces: namespaces:
- clanguml::t20013 - clanguml::t20013

View File

@@ -4,10 +4,10 @@ diagrams:
t20014_sequence: t20014_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20014/t20014.cc - tests/t20014/t20014.cc
- ../../tests/t20014/t20014_c.cc - tests/t20014/t20014_c.cc
- ../../tests/t20014/t20014_b.cc - tests/t20014/t20014_b.cc
- ../../tests/t20014/t20014_a.cc - tests/t20014/t20014_a.cc
include: include:
namespaces: namespaces:
- clanguml::t20014 - clanguml::t20014

View File

@@ -4,7 +4,7 @@ diagrams:
t20015_sequence: t20015_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20015/t20015.cc - tests/t20015/t20015.cc
include: include:
namespaces: namespaces:
- clanguml::t20015 - clanguml::t20015

View File

@@ -4,7 +4,7 @@ diagrams:
t20016_sequence: t20016_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20016/t20016.cc - tests/t20016/t20016.cc
include: include:
namespaces: namespaces:
- clanguml::t20016 - clanguml::t20016

View File

@@ -4,7 +4,7 @@ diagrams:
t20018_sequence: t20018_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20018/t20018.cc - tests/t20018/t20018.cc
include: include:
namespaces: namespaces:
- clanguml::t20018 - clanguml::t20018

View File

@@ -4,7 +4,7 @@ diagrams:
t20019_sequence: t20019_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20019/t20019.cc - tests/t20019/t20019.cc
include: include:
namespaces: namespaces:
- clanguml::t20019 - clanguml::t20019

View File

@@ -4,7 +4,7 @@ diagrams:
t20020_sequence: t20020_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20020/t20020.cc - tests/t20020/t20020.cc
include: include:
namespaces: namespaces:
- clanguml::t20020 - clanguml::t20020

View File

@@ -4,7 +4,7 @@ diagrams:
t20021_sequence: t20021_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20021/t20021.cc - tests/t20021/t20021.cc
include: include:
namespaces: namespaces:
- clanguml::t20021 - clanguml::t20021

View File

@@ -4,7 +4,7 @@ diagrams:
t20022_sequence: t20022_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20022/t20022.cc - tests/t20022/t20022.cc
include: include:
namespaces: namespaces:
- clanguml::t20022 - clanguml::t20022

View File

@@ -4,7 +4,7 @@ diagrams:
t20023_sequence: t20023_sequence:
type: sequence type: sequence
glob: glob:
- ../../tests/t20023/t20023.cc - tests/t20023/t20023.cc
include: include:
namespaces: namespaces:
- clanguml::t20023 - clanguml::t20023

Some files were not shown because too many files have changed in this diff Show More