From d7195d5a5d2cad087a0ee50836129387c09c8a7d Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Fri, 8 Dec 2023 08:17:00 +0100 Subject: [PATCH] Refactored handling of relative paths (#213) --- src/class_diagram/visitor/template_builder.cc | 5 +- src/common/model/diagram_filter.cc | 15 ++-- .../visitor/translation_unit_visitor.cc | 26 +++++-- src/config/config.cc | 3 +- src/config/config.h | 28 ++++++- src/config/yaml_decoders.cc | 33 +++------ .../visitor/translation_unit_visitor.cc | 26 ++----- .../plantuml/sequence_diagram_generator.cc | 2 +- .../visitor/translation_unit_visitor.cc | 10 ++- src/util/util.cc | 9 +++ src/util/util.h | 11 +++ tests/t00002/.clang-uml | 2 +- tests/t00003/.clang-uml | 2 +- tests/t00004/.clang-uml | 2 +- tests/t00005/.clang-uml | 2 +- tests/t00006/.clang-uml | 2 +- tests/t00007/.clang-uml | 2 +- tests/t00008/.clang-uml | 2 +- tests/t00009/.clang-uml | 2 +- tests/t00010/.clang-uml | 2 +- tests/t00011/.clang-uml | 2 +- tests/t00012/.clang-uml | 2 +- tests/t00013/.clang-uml | 2 +- tests/t00014/.clang-uml | 3 +- tests/t00015/.clang-uml | 2 +- tests/t00016/.clang-uml | 2 +- tests/t00017/.clang-uml | 2 +- tests/t00018/.clang-uml | 2 +- tests/t00019/.clang-uml | 2 +- tests/t00020/.clang-uml | 2 +- tests/t00021/.clang-uml | 2 +- tests/t00022/.clang-uml | 2 +- tests/t00023/.clang-uml | 2 +- tests/t00024/.clang-uml | 2 +- tests/t00025/.clang-uml | 2 +- tests/t00026/.clang-uml | 2 +- tests/t00027/.clang-uml | 2 +- tests/t00028/.clang-uml | 2 +- tests/t00029/.clang-uml | 2 +- tests/t00030/.clang-uml | 2 +- tests/t00031/.clang-uml | 2 +- tests/t00032/.clang-uml | 2 +- tests/t00033/.clang-uml | 2 +- tests/t00034/.clang-uml | 2 +- tests/t00035/.clang-uml | 2 +- tests/t00036/.clang-uml | 2 +- tests/t00037/.clang-uml | 2 +- tests/t00038/.clang-uml | 2 +- tests/t00039/.clang-uml | 2 +- tests/t00040/.clang-uml | 2 +- tests/t00041/.clang-uml | 2 +- tests/t00042/.clang-uml | 2 +- tests/t00043/.clang-uml | 2 +- tests/t00044/.clang-uml | 2 +- tests/t00045/.clang-uml | 2 +- tests/t00046/.clang-uml | 2 +- tests/t00047/.clang-uml | 2 +- tests/t00048/.clang-uml | 6 +- tests/t00049/.clang-uml | 2 +- tests/t00050/.clang-uml | 2 +- tests/t00051/.clang-uml | 2 +- tests/t00051/test_case.h | 45 ++++++------ tests/t00052/.clang-uml | 2 +- tests/t00053/.clang-uml | 2 +- tests/t00054/.clang-uml | 2 +- tests/t00055/.clang-uml | 2 +- tests/t00056/.clang-uml | 2 +- tests/t00057/.clang-uml | 4 +- tests/t00058/.clang-uml | 2 +- tests/t00059/.clang-uml | 2 +- tests/t00060/.clang-uml | 2 +- tests/t00062/.clang-uml | 2 +- tests/t00063/.clang-uml | 2 +- tests/t00064/.clang-uml | 2 +- tests/t00066/.clang-uml | 2 +- tests/t00067/.clang-uml | 2 +- tests/t00068/.clang-uml | 6 +- tests/t20001/.clang-uml | 2 +- tests/t20002/.clang-uml | 2 +- tests/t20003/.clang-uml | 2 +- tests/t20004/.clang-uml | 2 +- tests/t20005/.clang-uml | 2 +- tests/t20006/.clang-uml | 2 +- tests/t20007/.clang-uml | 2 +- tests/t20008/.clang-uml | 2 +- tests/t20009/.clang-uml | 2 +- tests/t20010/.clang-uml | 2 +- tests/t20011/.clang-uml | 2 +- tests/t20012/.clang-uml | 2 +- tests/t20012/test_case.h | 73 +++++++++---------- tests/t20013/.clang-uml | 2 +- tests/t20014/.clang-uml | 8 +- tests/t20015/.clang-uml | 2 +- tests/t20016/.clang-uml | 2 +- tests/t20018/.clang-uml | 2 +- tests/t20019/.clang-uml | 2 +- tests/t20020/.clang-uml | 2 +- tests/t20021/.clang-uml | 2 +- tests/t20022/.clang-uml | 2 +- tests/t20023/.clang-uml | 2 +- tests/t20024/.clang-uml | 2 +- tests/t20025/.clang-uml | 2 +- tests/t20026/.clang-uml | 2 +- tests/t20027/.clang-uml | 2 +- tests/t20028/.clang-uml | 2 +- tests/t20029/.clang-uml | 2 +- tests/t20030/.clang-uml | 2 +- tests/t20031/.clang-uml | 2 +- tests/t20032/.clang-uml | 2 +- tests/t20033/.clang-uml | 2 +- tests/t20034/.clang-uml | 2 +- tests/t20035/.clang-uml | 2 +- tests/t20036/.clang-uml | 2 +- tests/t20037/.clang-uml | 2 +- tests/t20038/.clang-uml | 2 +- tests/t30001/.clang-uml | 2 +- tests/t30002/.clang-uml | 2 +- tests/t30003/.clang-uml | 2 +- tests/t30004/.clang-uml | 2 +- tests/t30005/.clang-uml | 2 +- tests/t30006/.clang-uml | 2 +- tests/t30007/.clang-uml | 2 +- tests/t30008/.clang-uml | 2 +- tests/t30009/.clang-uml | 2 +- tests/t40001/.clang-uml | 3 +- tests/t40002/.clang-uml | 7 +- tests/t40003/.clang-uml | 4 +- tests/test_cases.cc | 18 +++++ tests/test_filters.cc | 2 +- tests/test_util.cc | 13 ++++ 130 files changed, 317 insertions(+), 255 deletions(-) diff --git a/src/class_diagram/visitor/template_builder.cc b/src/class_diagram/visitor/template_builder.cc index b282f661..2493d136 100644 --- a/src/class_diagram/visitor/template_builder.cc +++ b/src/class_diagram/visitor/template_builder.cc @@ -269,7 +269,10 @@ std::unique_ptr template_builder::build(const clang::NamedDecl *cls, template_instantiation.set_id( 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; } diff --git a/src/common/model/diagram_filter.cc b/src/common/model/diagram_filter.cc index 179b3291..da91b003 100644 --- a/src/common/model/diagram_filter.cc +++ b/src/common/model/diagram_filter.cc @@ -724,7 +724,10 @@ paths_filter::paths_filter(filter_t type, const std::filesystem::path &root, 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; } @@ -738,8 +741,8 @@ paths_filter::paths_filter(filter_t type, const std::filesystem::path &root, if (!match_successful) LOG_WARN("Paths filter pattern '{}' did not match " - "any files...", - path); + "any files relative to '{}'", + path, root_.string()); } } @@ -1059,8 +1062,7 @@ void diagram_filter::init_filters(const config::diagram &c) if (auto p = path.get(); p.has_value()) { std::filesystem::path dep_path{*p}; if (dep_path.is_relative()) { - dep_path = c.base_directory() / *p; - dep_path = relative(dep_path, c.relative_to()); + dep_path = relative(*p, c.root_directory()); } dependants.emplace_back( @@ -1072,8 +1074,7 @@ void diagram_filter::init_filters(const config::diagram &c) if (auto p = path.get(); p.has_value()) { std::filesystem::path dep_path{*p}; if (dep_path.is_relative()) { - dep_path = c.base_directory() / *p; - dep_path = relative(dep_path, c.relative_to()); + dep_path = relative(*p, c.root_directory()); } dependencies.emplace_back( diff --git a/src/common/visitor/translation_unit_visitor.cc b/src/common/visitor/translation_unit_visitor.cc index be873951..4cf0937d 100644 --- a/src/common/visitor/translation_unit_visitor.cc +++ b/src/common/visitor/translation_unit_visitor.cc @@ -26,7 +26,7 @@ namespace clanguml::common::visitor { translation_unit_visitor::translation_unit_visitor( clang::SourceManager &sm, const clanguml::config::diagram &config) : source_manager_{sm} - , relative_to_path_{config.relative_to()} + , relative_to_path_{config.root_directory()} { if (config.comment_parser() == config::comment_parser_t::plain) { comment_visitor_ = @@ -108,6 +108,8 @@ void translation_unit_visitor::set_source_location( const clang::SourceLocation &location, clanguml::common::model::source_location &element) { + namespace fs = std::filesystem; + std::string file; unsigned line{}; unsigned column{}; @@ -133,15 +135,25 @@ void translation_unit_visitor::set_source_location( } } - if (std::filesystem::path file_path{file}; !file_path.is_absolute()) { - file_path = - std::filesystem::canonical(std::filesystem::absolute(file_path)); - file = file_path.string(); + // ensure the path is absolute + fs::path file_path{file}; + if (!file_path.is_absolute()) { + 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_relative(util::path_to_url( - std::filesystem::relative(element.file(), relative_to_path_).string())); + if (util::is_relative_to(file_path, relative_to_path_)) { + element.set_file_relative(util::path_to_url( + fs::relative(element.file(), relative_to_path_).string())); + } element.set_translation_unit(tu_path().string()); element.set_line(line); element.set_column(column); diff --git a/src/config/config.cc b/src/config/config.cc index f54a5463..00297ee9 100644 --- a/src/config/config.cc +++ b/src/config/config.cc @@ -233,8 +233,7 @@ std::vector diagram::get_translation_units() const { std::vector translation_units{}; - LOG_DBG("Looking for translation units in {}", - std::filesystem::current_path().string()); + LOG_DBG("Looking for translation units in {}", root_directory().string()); for (const auto &g : glob()) { std::string glob_path = diff --git a/src/config/config.h b/src/config/config.h index 84651ac5..972dd069 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -482,10 +482,6 @@ struct inheritable_diagram_options { // This is the absolute filesystem path to the directory containing // the current .clang-uml config file - it is set automatically option 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 relative_to{"relative_to"}; option generate_system_headers{"generate_system_headers", false}; option relationship_hints{"relationship_hints"}; option type_aliases{"type_aliases"}; @@ -502,6 +498,30 @@ struct inheritable_diagram_options { "message_comment_width", clanguml::util::kDefaultMessageCommentWidth}; option debug_mode{"debug_mode", false}; option 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 &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 relative_to{"relative_to"}; + + friend YAML::Emitter &operator<<( + YAML::Emitter &out, const inheritable_diagram_options &c); }; /** diff --git a/src/config/yaml_decoders.cc b/src/config/yaml_decoders.cc index 8b2626dd..fb37a715 100644 --- a/src/config/yaml_decoders.cc +++ b/src/config/yaml_decoders.cc @@ -602,7 +602,7 @@ template <> struct convert { get_option(node, rhs.skip_redundant_dependencies); get_option(node, rhs.relationship_hints); 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_type_aliases(); @@ -626,15 +626,15 @@ template <> struct convert { get_option(node, rhs.combine_free_functions_into_file_participants); get_option(node, rhs.generate_return_types); 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.generate_method_arguments); get_option(node, rhs.generate_message_comments); get_option(node, rhs.message_comment_width); // Ensure relative_to has a value - if (!rhs.relative_to.has_value) - rhs.relative_to.set( + if (!rhs.get_relative_to().has_value) + rhs.get_relative_to().set( std::filesystem::current_path().lexically_normal()); rhs.initialize_type_aliases(); @@ -653,12 +653,12 @@ template <> struct convert { return false; get_option(node, rhs.layout); - get_option(node, rhs.relative_to); + get_option(node, rhs.get_relative_to()); get_option(node, rhs.package_type); // Ensure relative_to has a value - if (!rhs.relative_to.has_value) - rhs.relative_to.set( + if (!rhs.get_relative_to().has_value) + rhs.get_relative_to().set( std::filesystem::current_path().lexically_normal()); return true; @@ -675,21 +675,12 @@ template <> struct convert { return false; 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); - if (!rhs.relative_to) - rhs.relative_to.set(std::filesystem::current_path()); - - // 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()} / - rhs.relative_to(); - rhs.relative_to.set(absolute_relative_to.lexically_normal()); - } + if (!rhs.get_relative_to().has_value) + rhs.get_relative_to().set( + std::filesystem::current_path().lexically_normal()); return true; } @@ -824,7 +815,7 @@ template <> struct convert { get_option(node, rhs.message_comment_width); rhs.base_directory.set(node["__parent_path"].as()); - get_option(node, rhs.relative_to); + get_option(node, rhs.get_relative_to()); get_option(node, rhs.diagram_templates); diff --git a/src/include_diagram/visitor/translation_unit_visitor.cc b/src/include_diagram/visitor/translation_unit_visitor.cc index ccd8b766..edffae76 100644 --- a/src/include_diagram/visitor/translation_unit_visitor.cc +++ b/src/include_diagram/visitor/translation_unit_visitor.cc @@ -95,12 +95,8 @@ void translation_unit_visitor::include_visitor::InclusionDirective( LOG_DBG("Processing include directive {} in file {}", include_path.string(), current_file.string()); - auto relative_include_path = include_path; - if (config().relative_to) { - const std::filesystem::path relative_to{config().relative_to()}; - relative_include_path = - std::filesystem::relative(include_path, relative_to); - } + auto relative_include_path = + std::filesystem::relative(include_path, config().root_directory()); if (diagram().should_include(source_file{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) { // Make the path relative with respect to relative_to config option - auto relative_include_path = include_path; - if (config().relative_to) { - const std::filesystem::path relative_to{config().relative_to()}; - relative_include_path = - std::filesystem::relative(include_path, relative_to); - } + auto relative_include_path = + std::filesystem::relative(include_path, config().root_directory()); // Check if this source file is already registered in the diagram, // if not add it @@ -218,13 +210,9 @@ translation_unit_visitor::include_visitor::process_source_file( if (diagram().should_include(source_file{file_path})) { LOG_DBG("Processing source file {}", file.string()); - // Relativize the path with respect to relative_to config option - auto relative_file_path = file_path; - if (config().relative_to) { - const std::filesystem::path relative_to{config().relative_to()}; - relative_file_path = - std::filesystem::relative(file_path, relative_to); - } + // Relativize the path with respect to effective root directory + auto relative_file_path = + std::filesystem::relative(file_path, config().root_directory()); [[maybe_unused]] const auto relative_file_path_str = relative_file_path.string(); diff --git a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc index 36d5f808..f42bbb1a 100644 --- a/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc +++ b/src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc @@ -400,7 +400,7 @@ void generator::generate_participant( if (is_participant_generated(file_id)) 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()) .string()); diff --git a/src/sequence_diagram/visitor/translation_unit_visitor.cc b/src/sequence_diagram/visitor/translation_unit_visitor.cc index 7642ef2a..74ea432a 100644 --- a/src/sequence_diagram/visitor/translation_unit_visitor.cc +++ b/src/sequence_diagram/visitor/translation_unit_visitor.cc @@ -2311,9 +2311,13 @@ std::string translation_unit_visitor::make_lambda_name( const auto location = cls->getLocation(); const auto file_line = source_manager().getSpellingLineNumber(location); const auto file_column = source_manager().getSpellingColumnNumber(location); - const std::string file_name = util::path_to_url(std::filesystem::relative( - source_manager().getFilename(location).str(), config().relative_to()) - .string()); + const std::string file_name = config().make_path_relative( + source_manager().getFilename(location).str()); + // + // util::path_to_url(std::filesystem::relative( + // source_manager().getFilename(location).str(), + // config().relative_to()) + // .string()); if (context().caller_id() != 0 && get_participant(context().caller_id()).has_value()) { diff --git a/src/util/util.cc b/src/util/util.cc index 06510188..a6f207a1 100644 --- a/src/util/util.cc +++ b/src/util/util.cc @@ -404,6 +404,15 @@ std::filesystem::path ensure_path_is_absolute( 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) { if (width == 0) diff --git a/src/util/util.h b/src/util/util.h index 73e7334a..105485ec 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -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, 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( const std::string &c, unsigned width = kDefaultMessageCommentWidth); diff --git a/tests/t00002/.clang-uml b/tests/t00002/.clang-uml index 259723bc..6be32519 100644 --- a/tests/t00002/.clang-uml +++ b/tests/t00002/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class title: Basic class diagram example glob: - - ../../tests/t00002/t00002.cc + - tests/t00002/t00002.cc comment_parser: clang using_namespace: - clanguml::t00002 diff --git a/tests/t00003/.clang-uml b/tests/t00003/.clang-uml index e57c3032..3ba372b8 100644 --- a/tests/t00003/.clang-uml +++ b/tests/t00003/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00003_class: type: class glob: - - ../../tests/t00003/t00003.cc + - tests/t00003/t00003.cc using_namespace: clanguml::t00003 include: namespaces: diff --git a/tests/t00004/.clang-uml b/tests/t00004/.clang-uml index dceb4e5c..42c6e396 100644 --- a/tests/t00004/.clang-uml +++ b/tests/t00004/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00004_class: type: class glob: - - ../../tests/t00004/t00004.cc + - tests/t00004/t00004.cc using_namespace: - clanguml::t00004 - clanguml::t00004::A diff --git a/tests/t00005/.clang-uml b/tests/t00005/.clang-uml index 010559a3..499c750e 100644 --- a/tests/t00005/.clang-uml +++ b/tests/t00005/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00005_class: type: class glob: - - ../../tests/t00005/t00005.cc + - tests/t00005/t00005.cc using_namespace: - clanguml::t00005 include: diff --git a/tests/t00006/.clang-uml b/tests/t00006/.clang-uml index 1c2231a0..e6a0b5fe 100644 --- a/tests/t00006/.clang-uml +++ b/tests/t00006/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00006_class: type: class glob: - - ../../tests/t00006/t00006.cc + - tests/t00006/t00006.cc using_namespace: - clanguml::t00006 include: diff --git a/tests/t00007/.clang-uml b/tests/t00007/.clang-uml index c6e2cab5..06f50660 100644 --- a/tests/t00007/.clang-uml +++ b/tests/t00007/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00007_class: type: class glob: - - ../../tests/t00007/t00007.cc + - tests/t00007/t00007.cc using_namespace: - clanguml::t00007 include: diff --git a/tests/t00008/.clang-uml b/tests/t00008/.clang-uml index a46ad77c..90127280 100644 --- a/tests/t00008/.clang-uml +++ b/tests/t00008/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00008_class: type: class glob: - - ../../tests/t00008/t00008.cc + - tests/t00008/t00008.cc using_namespace: - clanguml::t00008 include: diff --git a/tests/t00009/.clang-uml b/tests/t00009/.clang-uml index fe115036..166c9fb8 100644 --- a/tests/t00009/.clang-uml +++ b/tests/t00009/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00009_class: type: class glob: - - ../../tests/t00009/t00009.cc + - tests/t00009/t00009.cc using_namespace: - clanguml::t00009 include: diff --git a/tests/t00010/.clang-uml b/tests/t00010/.clang-uml index 40230948..64666350 100644 --- a/tests/t00010/.clang-uml +++ b/tests/t00010/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00010_class: type: class glob: - - ../../tests/t00010/t00010.cc + - tests/t00010/t00010.cc using_namespace: - clanguml::t00010 include: diff --git a/tests/t00011/.clang-uml b/tests/t00011/.clang-uml index 96f0f3bb..8bda9ff2 100644 --- a/tests/t00011/.clang-uml +++ b/tests/t00011/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00011_class: type: class glob: - - ../../tests/t00011/t00011.cc + - tests/t00011/t00011.cc using_namespace: - clanguml::t00011 include: diff --git a/tests/t00012/.clang-uml b/tests/t00012/.clang-uml index bb52415c..9cdd9b54 100644 --- a/tests/t00012/.clang-uml +++ b/tests/t00012/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00012_class: type: class glob: - - ../../tests/t00012/t00012.cc + - tests/t00012/t00012.cc using_namespace: - clanguml::t00012 include: diff --git a/tests/t00013/.clang-uml b/tests/t00013/.clang-uml index 60c3939d..7ae839d1 100644 --- a/tests/t00013/.clang-uml +++ b/tests/t00013/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00013_class: type: class glob: - - ../../tests/t00013/t00013.cc + - tests/t00013/t00013.cc using_namespace: - clanguml::t00013 include: diff --git a/tests/t00014/.clang-uml b/tests/t00014/.clang-uml index 59ebf08d..e5e17265 100644 --- a/tests/t00014/.clang-uml +++ b/tests/t00014/.clang-uml @@ -4,7 +4,8 @@ diagrams: t00014_class: type: class glob: - - ../../tests/t00014/t00014.cc + - tests/t00014/t00014.cc +# relative_to: ../../.. using_namespace: - clanguml::t00014 include: diff --git a/tests/t00015/.clang-uml b/tests/t00015/.clang-uml index 205cf0a3..6c10e085 100644 --- a/tests/t00015/.clang-uml +++ b/tests/t00015/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00015_class: type: class glob: - - ../../tests/t00015/t00015.cc + - tests/t00015/t00015.cc using_namespace: - clanguml::t00015 include: diff --git a/tests/t00016/.clang-uml b/tests/t00016/.clang-uml index 300fb4b6..e7aa6fd6 100644 --- a/tests/t00016/.clang-uml +++ b/tests/t00016/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00016_class: type: class glob: - - ../../tests/t00016/t00016.cc + - tests/t00016/t00016.cc using_namespace: - clanguml::t00016 include: diff --git a/tests/t00017/.clang-uml b/tests/t00017/.clang-uml index d0f1302b..2c221bae 100644 --- a/tests/t00017/.clang-uml +++ b/tests/t00017/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class include_relations_also_as_members: false glob: - - ../../tests/t00017/t00017.cc + - tests/t00017/t00017.cc using_namespace: - clanguml::t00017 include: diff --git a/tests/t00018/.clang-uml b/tests/t00018/.clang-uml index ab7fa538..43fdd795 100644 --- a/tests/t00018/.clang-uml +++ b/tests/t00018/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00018_class: type: class glob: - - ../../tests/t00018/**.cc + - tests/t00018/**.cc using_namespace: - clanguml::t00018 include: diff --git a/tests/t00019/.clang-uml b/tests/t00019/.clang-uml index b4c73903..9f6244b2 100644 --- a/tests/t00019/.clang-uml +++ b/tests/t00019/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00019_class: type: class glob: - - ../../tests/t00019/**.cc + - tests/t00019/**.cc generate_template_argument_dependencies: false using_namespace: - clanguml::t00019 diff --git a/tests/t00020/.clang-uml b/tests/t00020/.clang-uml index 5bac46fb..b18c4092 100644 --- a/tests/t00020/.clang-uml +++ b/tests/t00020/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00020_class: type: class glob: - - ../../tests/t00020/t00020.cc + - tests/t00020/t00020.cc using_namespace: - clanguml::t00020 include: diff --git a/tests/t00021/.clang-uml b/tests/t00021/.clang-uml index f221d426..242a68e8 100644 --- a/tests/t00021/.clang-uml +++ b/tests/t00021/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00021_class: type: class glob: - - ../../tests/t00021/t00021.cc + - tests/t00021/t00021.cc using_namespace: - clanguml::t00021 include: diff --git a/tests/t00022/.clang-uml b/tests/t00022/.clang-uml index 08421149..52cae5ec 100644 --- a/tests/t00022/.clang-uml +++ b/tests/t00022/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00022_class: type: class glob: - - ../../tests/t00022/t00022.cc + - tests/t00022/t00022.cc using_namespace: - clanguml::t00022 include: diff --git a/tests/t00023/.clang-uml b/tests/t00023/.clang-uml index 145dd839..5635666c 100644 --- a/tests/t00023/.clang-uml +++ b/tests/t00023/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00023_class: type: class glob: - - ../../tests/t00023/t00023.cc + - tests/t00023/t00023.cc using_namespace: - clanguml::t00023 include: diff --git a/tests/t00024/.clang-uml b/tests/t00024/.clang-uml index 79c516f6..b5ee9373 100644 --- a/tests/t00024/.clang-uml +++ b/tests/t00024/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00024_class: type: class glob: - - ../../tests/t00024/t00024.cc + - tests/t00024/t00024.cc using_namespace: - clanguml::t00024 include: diff --git a/tests/t00025/.clang-uml b/tests/t00025/.clang-uml index 1dd15940..ad285640 100644 --- a/tests/t00025/.clang-uml +++ b/tests/t00025/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00025_class: type: class glob: - - ../../tests/t00025/t00025.cc + - tests/t00025/t00025.cc using_namespace: - clanguml::t00025 include: diff --git a/tests/t00026/.clang-uml b/tests/t00026/.clang-uml index d406ef09..e985c8ed 100644 --- a/tests/t00026/.clang-uml +++ b/tests/t00026/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00026_class: type: class glob: - - ../../tests/t00026/t00026.cc + - tests/t00026/t00026.cc using_namespace: - clanguml::t00026 include: diff --git a/tests/t00027/.clang-uml b/tests/t00027/.clang-uml index 64dc709e..06cfa721 100644 --- a/tests/t00027/.clang-uml +++ b/tests/t00027/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00027_class: type: class glob: - - ../../tests/t00027/t00027.cc + - tests/t00027/t00027.cc using_namespace: - clanguml::t00027 include: diff --git a/tests/t00028/.clang-uml b/tests/t00028/.clang-uml index ac0f8f09..466d1027 100644 --- a/tests/t00028/.clang-uml +++ b/tests/t00028/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00028_class: type: class glob: - - ../../tests/t00028/t00028.cc + - tests/t00028/t00028.cc using_namespace: - clanguml::t00028 include: diff --git a/tests/t00029/.clang-uml b/tests/t00029/.clang-uml index b856a2cd..164d8405 100644 --- a/tests/t00029/.clang-uml +++ b/tests/t00029/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00029_class: type: class glob: - - ../../tests/t00029/t00029.cc + - tests/t00029/t00029.cc using_namespace: - clanguml::t00029 include: diff --git a/tests/t00030/.clang-uml b/tests/t00030/.clang-uml index 8c9e6b2c..c4ef6dc2 100644 --- a/tests/t00030/.clang-uml +++ b/tests/t00030/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00030_class: type: class glob: - - ../../tests/t00030/t00030.cc + - tests/t00030/t00030.cc using_namespace: - clanguml::t00030 include: diff --git a/tests/t00031/.clang-uml b/tests/t00031/.clang-uml index affa76b5..64c1bf0c 100644 --- a/tests/t00031/.clang-uml +++ b/tests/t00031/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00031_class: type: class glob: - - ../../tests/t00031/t00031.cc + - tests/t00031/t00031.cc skip_redundant_dependencies: false using_namespace: - clanguml::t00031 diff --git a/tests/t00032/.clang-uml b/tests/t00032/.clang-uml index 0c5d4e93..4820d73d 100644 --- a/tests/t00032/.clang-uml +++ b/tests/t00032/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00032_class: type: class glob: - - ../../tests/t00032/t00032.cc + - tests/t00032/t00032.cc using_namespace: - clanguml::t00032 include: diff --git a/tests/t00033/.clang-uml b/tests/t00033/.clang-uml index 74d0bd30..f9a3d408 100644 --- a/tests/t00033/.clang-uml +++ b/tests/t00033/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00033_class: type: class glob: - - ../../tests/t00033/t00033.cc + - tests/t00033/t00033.cc using_namespace: - clanguml::t00033 include: diff --git a/tests/t00034/.clang-uml b/tests/t00034/.clang-uml index b8198a99..62588ba7 100644 --- a/tests/t00034/.clang-uml +++ b/tests/t00034/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00034_class: type: class glob: - - ../../tests/t00034/t00034.cc + - tests/t00034/t00034.cc using_namespace: - clanguml::t00034 include: diff --git a/tests/t00035/.clang-uml b/tests/t00035/.clang-uml index ac19e302..300af744 100644 --- a/tests/t00035/.clang-uml +++ b/tests/t00035/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00035_class: type: class glob: - - ../../tests/t00035/t00035.cc + - tests/t00035/t00035.cc using_namespace: - clanguml::t00035 include: diff --git a/tests/t00036/.clang-uml b/tests/t00036/.clang-uml index 87ac943a..cbf3d637 100644 --- a/tests/t00036/.clang-uml +++ b/tests/t00036/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class generate_packages: true glob: - - ../../tests/t00036/t00036.cc + - tests/t00036/t00036.cc using_namespace: - clanguml::t00036 include: diff --git a/tests/t00037/.clang-uml b/tests/t00037/.clang-uml index f2616bd8..479778fc 100644 --- a/tests/t00037/.clang-uml +++ b/tests/t00037/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class generate_packages: true glob: - - ../../tests/t00037/t00037.cc + - tests/t00037/t00037.cc using_namespace: - clanguml::t00037 include: diff --git a/tests/t00038/.clang-uml b/tests/t00038/.clang-uml index ab17a394..a762d0b4 100644 --- a/tests/t00038/.clang-uml +++ b/tests/t00038/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class generate_packages: false glob: - - ../../tests/t00038/t00038.cc + - tests/t00038/t00038.cc using_namespace: - clanguml::t00038 include: diff --git a/tests/t00039/.clang-uml b/tests/t00039/.clang-uml index 31a1d55c..ee841b25 100644 --- a/tests/t00039/.clang-uml +++ b/tests/t00039/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class generate_packages: false glob: - - ../../tests/t00039/t00039.cc + - tests/t00039/t00039.cc using_namespace: - clanguml::t00039 include: diff --git a/tests/t00040/.clang-uml b/tests/t00040/.clang-uml index ea120d19..966100e2 100644 --- a/tests/t00040/.clang-uml +++ b/tests/t00040/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class generate_packages: false glob: - - ../../tests/t00040/t00040.cc + - tests/t00040/t00040.cc using_namespace: - clanguml::t00040 include: diff --git a/tests/t00041/.clang-uml b/tests/t00041/.clang-uml index 191ba681..96dc34ae 100644 --- a/tests/t00041/.clang-uml +++ b/tests/t00041/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class generate_packages: false glob: - - ../../tests/t00041/t00041.cc + - tests/t00041/t00041.cc using_namespace: - clanguml::t00041 include: diff --git a/tests/t00042/.clang-uml b/tests/t00042/.clang-uml index cdd55719..671323f3 100644 --- a/tests/t00042/.clang-uml +++ b/tests/t00042/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class generate_packages: false glob: - - ../../tests/t00042/t00042.cc + - tests/t00042/t00042.cc using_namespace: - clanguml::t00042 include: diff --git a/tests/t00043/.clang-uml b/tests/t00043/.clang-uml index 6ca42b14..59dc3a8b 100644 --- a/tests/t00043/.clang-uml +++ b/tests/t00043/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class generate_packages: true glob: - - ../../tests/t00043/t00043.cc + - tests/t00043/t00043.cc using_namespace: - clanguml::t00043 include: diff --git a/tests/t00044/.clang-uml b/tests/t00044/.clang-uml index b0e819d2..b2fcd42d 100644 --- a/tests/t00044/.clang-uml +++ b/tests/t00044/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class generate_packages: true glob: - - ../../tests/t00044/t00044.cc + - tests/t00044/t00044.cc using_namespace: - clanguml::t00044 include: diff --git a/tests/t00045/.clang-uml b/tests/t00045/.clang-uml index 51184d16..f3190ddf 100644 --- a/tests/t00045/.clang-uml +++ b/tests/t00045/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00045_class: type: class glob: - - ../../tests/t00045/t00045.cc + - tests/t00045/t00045.cc exclude: namespaces: - std \ No newline at end of file diff --git a/tests/t00046/.clang-uml b/tests/t00046/.clang-uml index 9a3b0f50..4a836860 100644 --- a/tests/t00046/.clang-uml +++ b/tests/t00046/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class generate_packages: true glob: - - ../../tests/t00046/t00046.cc + - tests/t00046/t00046.cc exclude: namespaces: - std \ No newline at end of file diff --git a/tests/t00047/.clang-uml b/tests/t00047/.clang-uml index 0072a2cc..bb090e58 100644 --- a/tests/t00047/.clang-uml +++ b/tests/t00047/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00047_class: type: class glob: - - ../../tests/t00047/t00047.cc + - tests/t00047/t00047.cc using_namespace: clanguml::t00047 include: namespaces: diff --git a/tests/t00048/.clang-uml b/tests/t00048/.clang-uml index ecbc732a..5e2868eb 100644 --- a/tests/t00048/.clang-uml +++ b/tests/t00048/.clang-uml @@ -4,9 +4,9 @@ diagrams: t00048_class: type: class glob: - - ../../tests/t00048/b_t00048.cc - - ../../tests/t00048/a_t00048.cc - - ../../tests/t00048/t00048.cc + - tests/t00048/b_t00048.cc + - tests/t00048/a_t00048.cc + - tests/t00048/t00048.cc using_namespace: clanguml::t00048 include: namespaces: diff --git a/tests/t00049/.clang-uml b/tests/t00049/.clang-uml index 13eb1cea..08987f31 100644 --- a/tests/t00049/.clang-uml +++ b/tests/t00049/.clang-uml @@ -11,7 +11,7 @@ diagrams: "std::vector": string_vector "std::map": intmap glob: - - ../../tests/t00049/t00049.cc + - tests/t00049/t00049.cc include: namespaces: - clanguml::t00049 \ No newline at end of file diff --git a/tests/t00050/.clang-uml b/tests/t00050/.clang-uml index 9a80b579..31d649e8 100644 --- a/tests/t00050/.clang-uml +++ b/tests/t00050/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00050_class: type: class glob: - - ../../tests/t00050/t00050.cc + - tests/t00050/t00050.cc comment_parser: clang include: namespaces: diff --git a/tests/t00051/.clang-uml b/tests/t00051/.clang-uml index 1e6daa3a..c8084955 100644 --- a/tests/t00051/.clang-uml +++ b/tests/t00051/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00051_class: type: class glob: - - ../../tests/t00051/t00051.cc + - tests/t00051/t00051.cc include: namespaces: - clanguml::t00051 diff --git a/tests/t00051/test_case.h b/tests/t00051/test_case.h index ea66c8e0..73685a04 100644 --- a/tests/t00051/test_case.h +++ b/tests/t00051/test_case.h @@ -45,14 +45,14 @@ TEST_CASE("t00051", "[test-case][class]") "Function && f, Args &&... args"))); REQUIRE_THAT(src, (IsMethod("thread", "void", - "(lambda at ../../tests/t00051/t00051.cc:59:27) &&"))); + "(lambda at tests/t00051/t00051.cc:59:27) &&"))); REQUIRE_THAT(src, (IsMethod("start_thread3", - "B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at " - "../../tests/t00051/t00051.cc:43:27)>"))); + "B<(lambda at tests/t00051/t00051.cc:43:18),(lambda at " + "tests/t00051/t00051.cc:43:27)>"))); REQUIRE_THAT(src, - (IsMethod("get_function", - "(lambda at ../../tests/t00051/t00051.cc:48:16)"))); + (IsMethod( + "get_function", "(lambda at tests/t00051/t00051.cc:48:16)"))); REQUIRE_THAT(src, IsClassTemplate("B", "F,FF=F")); REQUIRE_THAT(src, (IsMethod("f", "void"))); @@ -60,18 +60,18 @@ TEST_CASE("t00051", "[test-case][class]") REQUIRE_THAT(src, IsClassTemplate("B", - "(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at " - "../../tests/t00051/t00051.cc:43:27)")); + "(lambda at tests/t00051/t00051.cc:43:18),(lambda at " + "tests/t00051/t00051.cc:43:27)")); REQUIRE_THAT(src, IsInstantiation(_A("B"), - _A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " - "at ../../tests/t00051/t00051.cc:43:27)>"))); + _A("B<(lambda at tests/t00051/t00051.cc:43:18),(lambda " + "at tests/t00051/t00051.cc:43:27)>"))); REQUIRE_THAT(src, IsDependency(_A("A"), - _A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " - "at ../../tests/t00051/t00051.cc:43:27)>"))); + _A("B<(lambda at tests/t00051/t00051.cc:43:18),(lambda " + "at tests/t00051/t00051.cc:43:27)>"))); save_puml(config.output_directory(), diagram->name + ".puml", src); } @@ -103,33 +103,32 @@ TEST_CASE("t00051", "[test-case][class]") "Function && f, Args &&... args"))); REQUIRE_THAT(src, (IsMethod("thread", "void", - "(lambda at ../../tests/t00051/t00051.cc:59:27) &&"))); + "(lambda at tests/t00051/t00051.cc:59:27) &&"))); REQUIRE_THAT(src, (IsMethod("start_thread3", - "B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at " - "../../tests/t00051/t00051.cc:43:27)>"))); + "B<(lambda at tests/t00051/t00051.cc:43:18),(lambda at " + "tests/t00051/t00051.cc:43:27)>"))); REQUIRE_THAT(src, - (IsMethod("get_function", - "(lambda at ../../tests/t00051/t00051.cc:48:16)"))); + (IsMethod( + "get_function", "(lambda at tests/t00051/t00051.cc:48:16)"))); REQUIRE_THAT(src, IsClass(_A("B"))); REQUIRE_THAT(src, (IsMethod("f", "void"))); REQUIRE_THAT(src, (IsMethod("ff", "void"))); REQUIRE_THAT(src, - IsClass(_A( - "B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda at " - "../../tests/t00051/t00051.cc:43:27)>"))); + IsClass(_A("B<(lambda at tests/t00051/t00051.cc:43:18),(lambda at " + "tests/t00051/t00051.cc:43:27)>"))); REQUIRE_THAT(src, IsInstantiation(_A("B"), - _A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " - "at ../../tests/t00051/t00051.cc:43:27)>"))); + _A("B<(lambda at tests/t00051/t00051.cc:43:18),(lambda " + "at tests/t00051/t00051.cc:43:27)>"))); REQUIRE_THAT(src, IsDependency(_A("A"), - _A("B<(lambda at ../../tests/t00051/t00051.cc:43:18),(lambda " - "at ../../tests/t00051/t00051.cc:43:27)>"))); + _A("B<(lambda at tests/t00051/t00051.cc:43:18),(lambda " + "at tests/t00051/t00051.cc:43:27)>"))); save_mermaid(config.output_directory(), diagram->name + ".mmd", src); } diff --git a/tests/t00052/.clang-uml b/tests/t00052/.clang-uml index aa5a68c0..b6a64218 100644 --- a/tests/t00052/.clang-uml +++ b/tests/t00052/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00052_class: type: class glob: - - ../../tests/t00052/t00052.cc + - tests/t00052/t00052.cc include: namespaces: - clanguml::t00052 diff --git a/tests/t00053/.clang-uml b/tests/t00053/.clang-uml index 628a1237..42a2c1e3 100644 --- a/tests/t00053/.clang-uml +++ b/tests/t00053/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00053_class: type: class glob: - - ../../tests/t00053/t00053.cc + - tests/t00053/t00053.cc include: namespaces: - clanguml::t00053 diff --git a/tests/t00054/.clang-uml b/tests/t00054/.clang-uml index 6000cf79..74b9346c 100644 --- a/tests/t00054/.clang-uml +++ b/tests/t00054/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00054_class: type: class glob: - - ../../tests/t00054/t00054.cc + - tests/t00054/t00054.cc include: namespaces: - clanguml::t00054 diff --git a/tests/t00055/.clang-uml b/tests/t00055/.clang-uml index 88c6a6f2..def3b164 100644 --- a/tests/t00055/.clang-uml +++ b/tests/t00055/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00055_class: type: class glob: - - ../../tests/t00055/t00055.cc + - tests/t00055/t00055.cc include: namespaces: - clanguml::t00055 diff --git a/tests/t00056/.clang-uml b/tests/t00056/.clang-uml index 58b5f2af..d3248dd9 100644 --- a/tests/t00056/.clang-uml +++ b/tests/t00056/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00056_class: type: class glob: - - ../../tests/t00056/t00056.cc + - tests/t00056/t00056.cc include: namespaces: - clanguml::t00056 diff --git a/tests/t00057/.clang-uml b/tests/t00057/.clang-uml index 1bd80828..e6e9f236 100644 --- a/tests/t00057/.clang-uml +++ b/tests/t00057/.clang-uml @@ -4,5 +4,5 @@ diagrams: t00057_class: type: class glob: - - ../../tests/t00057/t00057.c - - ../../tests/t00057/src/t00057_impl.c \ No newline at end of file + - tests/t00057/t00057.c + - tests/t00057/src/t00057_impl.c \ No newline at end of file diff --git a/tests/t00058/.clang-uml b/tests/t00058/.clang-uml index 2732bc62..f723261d 100644 --- a/tests/t00058/.clang-uml +++ b/tests/t00058/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00058_class: type: class glob: - - ../../tests/t00058/t00058.cc + - tests/t00058/t00058.cc include: namespaces: - clanguml::t00058 diff --git a/tests/t00059/.clang-uml b/tests/t00059/.clang-uml index aea07570..945433ad 100644 --- a/tests/t00059/.clang-uml +++ b/tests/t00059/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00059_class: type: class glob: - - ../../tests/t00059/t00059.cc + - tests/t00059/t00059.cc include: namespaces: - clanguml::t00059 diff --git a/tests/t00060/.clang-uml b/tests/t00060/.clang-uml index a3e0feb5..bd6de4cc 100644 --- a/tests/t00060/.clang-uml +++ b/tests/t00060/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00060_class: type: class glob: - - ../../tests/t00060/t00060.cc + - tests/t00060/t00060.cc include: namespaces: - clanguml::t00060 diff --git a/tests/t00062/.clang-uml b/tests/t00062/.clang-uml index 23540c84..1a0ab2d6 100644 --- a/tests/t00062/.clang-uml +++ b/tests/t00062/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00062_class: type: class glob: - - ../../tests/t00062/t00062.cc + - tests/t00062/t00062.cc include: namespaces: - clanguml::t00062 diff --git a/tests/t00063/.clang-uml b/tests/t00063/.clang-uml index 46e5bb1a..13ddeb16 100644 --- a/tests/t00063/.clang-uml +++ b/tests/t00063/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00063_class: type: class glob: - - ../../tests/t00063/t00063.cc + - tests/t00063/t00063.cc include: namespaces: - clanguml::t00063 diff --git a/tests/t00064/.clang-uml b/tests/t00064/.clang-uml index 313c0bac..0a76352a 100644 --- a/tests/t00064/.clang-uml +++ b/tests/t00064/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00064_class: type: class glob: - - ../../tests/t00064/t00064.cc + - tests/t00064/t00064.cc include: namespaces: - clanguml::t00064 diff --git a/tests/t00066/.clang-uml b/tests/t00066/.clang-uml index abab698f..9c32c193 100644 --- a/tests/t00066/.clang-uml +++ b/tests/t00066/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00066_class: type: class glob: - - ../../tests/t00066/t00066.cc + - tests/t00066/t00066.cc include: namespaces: - clanguml::t00066 diff --git a/tests/t00067/.clang-uml b/tests/t00067/.clang-uml index b2a26a0e..9c15ab95 100644 --- a/tests/t00067/.clang-uml +++ b/tests/t00067/.clang-uml @@ -4,7 +4,7 @@ diagrams: t00067_class: type: class glob: - - ../../tests/t00067/t00067.cc + - tests/t00067/t00067.cc include: namespaces: - clanguml::t00067 diff --git a/tests/t00068/.clang-uml b/tests/t00068/.clang-uml index 65bf9354..e0fe8c16 100644 --- a/tests/t00068/.clang-uml +++ b/tests/t00068/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: class title: AAA context of radius 0 glob: - - ../../tests/t00068/t00068.cc + - tests/t00068/t00068.cc include: namespaces: - clanguml::t00068 @@ -19,7 +19,7 @@ diagrams: type: class title: AAA context of radius 1 glob: - - ../../tests/t00068/t00068.cc + - tests/t00068/t00068.cc include: namespaces: - clanguml::t00068 @@ -33,7 +33,7 @@ diagrams: type: class title: AAA context of radius 2 glob: - - ../../tests/t00068/t00068.cc + - tests/t00068/t00068.cc include: namespaces: - clanguml::t00068 diff --git a/tests/t20001/.clang-uml b/tests/t20001/.clang-uml index 10304840..71cc0776 100644 --- a/tests/t20001/.clang-uml +++ b/tests/t20001/.clang-uml @@ -7,7 +7,7 @@ diagrams: type: sequence title: Basic sequence diagram example glob: - - ../../tests/t20001/t20001.cc + - tests/t20001/t20001.cc include: namespaces: - clanguml::t20001 diff --git a/tests/t20002/.clang-uml b/tests/t20002/.clang-uml index 437d25a6..f66173bb 100644 --- a/tests/t20002/.clang-uml +++ b/tests/t20002/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20002_sequence: type: sequence glob: - - ../../tests/t20002/t20002.cc + - tests/t20002/t20002.cc include: namespaces: - clanguml::t20002 diff --git a/tests/t20003/.clang-uml b/tests/t20003/.clang-uml index 40cb7eee..c2999319 100644 --- a/tests/t20003/.clang-uml +++ b/tests/t20003/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20003_sequence: type: sequence glob: - - ../../tests/t20003/t20003.cc + - tests/t20003/t20003.cc include: namespaces: - clanguml::t20003 diff --git a/tests/t20004/.clang-uml b/tests/t20004/.clang-uml index 00ef7901..8390da4e 100644 --- a/tests/t20004/.clang-uml +++ b/tests/t20004/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20004_sequence: type: sequence glob: - - ../../tests/t20004/t20004.cc + - tests/t20004/t20004.cc include: namespaces: - clanguml::t20004 diff --git a/tests/t20005/.clang-uml b/tests/t20005/.clang-uml index 7c497c16..f5767bdd 100644 --- a/tests/t20005/.clang-uml +++ b/tests/t20005/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20005_sequence: type: sequence glob: - - ../../tests/t20005/t20005.cc + - tests/t20005/t20005.cc include: namespaces: - clanguml::t20005 diff --git a/tests/t20006/.clang-uml b/tests/t20006/.clang-uml index a99a842e..a10bc370 100644 --- a/tests/t20006/.clang-uml +++ b/tests/t20006/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20006_sequence: type: sequence glob: - - ../../tests/t20006/t20006.cc + - tests/t20006/t20006.cc include: namespaces: - clanguml::t20006 diff --git a/tests/t20007/.clang-uml b/tests/t20007/.clang-uml index 953db3ed..69332706 100644 --- a/tests/t20007/.clang-uml +++ b/tests/t20007/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20007_sequence: type: sequence glob: - - ../../tests/t20007/t20007.cc + - tests/t20007/t20007.cc include: namespaces: - clanguml::t20007 diff --git a/tests/t20008/.clang-uml b/tests/t20008/.clang-uml index adecc8e0..8ae97a37 100644 --- a/tests/t20008/.clang-uml +++ b/tests/t20008/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20008_sequence: type: sequence glob: - - ../../tests/t20008/t20008.cc + - tests/t20008/t20008.cc include: namespaces: - clanguml::t20008 diff --git a/tests/t20009/.clang-uml b/tests/t20009/.clang-uml index a316f367..f807e809 100644 --- a/tests/t20009/.clang-uml +++ b/tests/t20009/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20009_sequence: type: sequence glob: - - ../../tests/t20009/t20009.cc + - tests/t20009/t20009.cc include: namespaces: - clanguml::t20009 diff --git a/tests/t20010/.clang-uml b/tests/t20010/.clang-uml index 1b708ad2..a56f2a5d 100644 --- a/tests/t20010/.clang-uml +++ b/tests/t20010/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20010_sequence: type: sequence glob: - - ../../tests/t20010/t20010.cc + - tests/t20010/t20010.cc include: namespaces: - clanguml::t20010 diff --git a/tests/t20011/.clang-uml b/tests/t20011/.clang-uml index 9c59bd5b..3ede9df0 100644 --- a/tests/t20011/.clang-uml +++ b/tests/t20011/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20011_sequence: type: sequence glob: - - ../../tests/t20011/t20011.cc + - tests/t20011/t20011.cc include: namespaces: - clanguml::t20011 diff --git a/tests/t20012/.clang-uml b/tests/t20012/.clang-uml index 318c2e6b..6d31f7df 100644 --- a/tests/t20012/.clang-uml +++ b/tests/t20012/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20012_sequence: type: sequence glob: - - ../../tests/t20012/t20012.cc + - tests/t20012/t20012.cc include: namespaces: - clanguml::t20012 diff --git a/tests/t20012/test_case.h b/tests/t20012/test_case.h index 1ffbf6df..5d51b952 100644 --- a/tests/t20012/test_case.h +++ b/tests/t20012/test_case.h @@ -37,41 +37,41 @@ TEST_CASE("t20012", "[test-case][sequence]") // Check if all calls exist REQUIRE_THAT(src, HasCall(_A("tmain()"), - _A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), + _A("tmain()::(lambda tests/t20012/t20012.cc:67:20)"), "operator()()")); 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()")); REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aa()")); REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aaa()")); 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()")); REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bb()")); REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bbb()")); 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()")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "cc()")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); REQUIRE_THAT(src, - HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)"), - _A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), + HasCall(_A("tmain()::(lambda tests/t20012/t20012.cc:80:20)"), + _A("tmain()::(lambda tests/t20012/t20012.cc:67:20)"), "operator()()")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); REQUIRE_THAT(src, HasCall(_A("tmain()"), - _A("R"), "r()")); + _A("R"), "r()")); REQUIRE_THAT(src, - HasCall(_A("R"), - _A("tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)"), + HasCall(_A("R"), + _A("tmain()::(lambda tests/t20012/t20012.cc:86:9)"), "operator()()")); 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()")); // @todo #168 @@ -87,32 +87,27 @@ TEST_CASE("t20012", "[test-case][sequence]") std::vector messages = { FindMessage(j, "tmain()", - "tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)", + "tmain()::(lambda tests/t20012/t20012.cc:67:20)", "operator()()"), - FindMessage(j, - "tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)", "A", - "a()"), + FindMessage(j, "tmain()::(lambda tests/t20012/t20012.cc:67:20)", + "A", "a()"), FindMessage(j, "A", "A", "aa()"), FindMessage(j, "A", "A", "aaa()"), - FindMessage(j, - "tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)", "B", - "b()"), + FindMessage(j, "tmain()::(lambda tests/t20012/t20012.cc:67:20)", + "B", "b()"), FindMessage(j, "B", "B", "bb()"), FindMessage(j, "B", "B", "bbb()"), - FindMessage(j, - "tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)", "C", - "c()"), + FindMessage(j, "tmain()::(lambda tests/t20012/t20012.cc:80:20)", + "C", "c()"), FindMessage(j, "C", "C", "cc()"), FindMessage(j, "C", "C", "ccc()"), - FindMessage(j, - "tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)", - "tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)", + FindMessage(j, "tmain()::(lambda tests/t20012/t20012.cc:80:20)", + "tmain()::(lambda tests/t20012/t20012.cc:67:20)", "operator()()"), FindMessage(j, "tmain()", - "R", "r()"), - FindMessage(j, "R", - "tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)", + "R", "r()"), + FindMessage(j, "R", + "tmain()::(lambda tests/t20012/t20012.cc:86:9)", "operator()()"), - FindMessage(j, - "tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)", "C", - "c()"), + FindMessage( + j, "tmain()::(lambda tests/t20012/t20012.cc:86:9)", "C", "c()"), // @todo #168 // FindMessage(j, "tmain()", "D", "add5(int)") }; @@ -130,41 +125,41 @@ TEST_CASE("t20012", "[test-case][sequence]") REQUIRE_THAT(src, HasCall(_A("tmain()"), - _A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), + _A("tmain()::(lambda tests/t20012/t20012.cc:67:20)"), "operator()()")); 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()")); REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aa()")); REQUIRE_THAT(src, HasCall(_A("A"), _A("A"), "aaa()")); 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()")); REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bb()")); REQUIRE_THAT(src, HasCall(_A("B"), _A("B"), "bbb()")); 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()")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "cc()")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); REQUIRE_THAT(src, - HasCall(_A("tmain()::(lambda ../../tests/t20012/t20012.cc:80:20)"), - _A("tmain()::(lambda ../../tests/t20012/t20012.cc:67:20)"), + HasCall(_A("tmain()::(lambda tests/t20012/t20012.cc:80:20)"), + _A("tmain()::(lambda tests/t20012/t20012.cc:67:20)"), "operator()()")); REQUIRE_THAT(src, HasCall(_A("C"), _A("C"), "ccc()")); REQUIRE_THAT(src, HasCall(_A("tmain()"), - _A("R"), "r()")); + _A("R"), "r()")); REQUIRE_THAT(src, - HasCall(_A("R"), - _A("tmain()::(lambda ../../tests/t20012/t20012.cc:86:9)"), + HasCall(_A("R"), + _A("tmain()::(lambda tests/t20012/t20012.cc:86:9)"), "operator()()")); 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()")); save_mermaid(config.output_directory(), diagram->name + ".mmd", src); diff --git a/tests/t20013/.clang-uml b/tests/t20013/.clang-uml index a8620c1a..5696f7b1 100644 --- a/tests/t20013/.clang-uml +++ b/tests/t20013/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20013_sequence: type: sequence glob: - - ../../tests/t20013/t20013.cc + - tests/t20013/t20013.cc include: namespaces: - clanguml::t20013 diff --git a/tests/t20014/.clang-uml b/tests/t20014/.clang-uml index 26cb0913..8de177d0 100644 --- a/tests/t20014/.clang-uml +++ b/tests/t20014/.clang-uml @@ -4,10 +4,10 @@ diagrams: t20014_sequence: type: sequence glob: - - ../../tests/t20014/t20014.cc - - ../../tests/t20014/t20014_c.cc - - ../../tests/t20014/t20014_b.cc - - ../../tests/t20014/t20014_a.cc + - tests/t20014/t20014.cc + - tests/t20014/t20014_c.cc + - tests/t20014/t20014_b.cc + - tests/t20014/t20014_a.cc include: namespaces: - clanguml::t20014 diff --git a/tests/t20015/.clang-uml b/tests/t20015/.clang-uml index 4f550ad4..4c928590 100644 --- a/tests/t20015/.clang-uml +++ b/tests/t20015/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20015_sequence: type: sequence glob: - - ../../tests/t20015/t20015.cc + - tests/t20015/t20015.cc include: namespaces: - clanguml::t20015 diff --git a/tests/t20016/.clang-uml b/tests/t20016/.clang-uml index d1bb343b..d9df2ee8 100644 --- a/tests/t20016/.clang-uml +++ b/tests/t20016/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20016_sequence: type: sequence glob: - - ../../tests/t20016/t20016.cc + - tests/t20016/t20016.cc include: namespaces: - clanguml::t20016 diff --git a/tests/t20018/.clang-uml b/tests/t20018/.clang-uml index 6168917d..ca5fd24b 100644 --- a/tests/t20018/.clang-uml +++ b/tests/t20018/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20018_sequence: type: sequence glob: - - ../../tests/t20018/t20018.cc + - tests/t20018/t20018.cc include: namespaces: - clanguml::t20018 diff --git a/tests/t20019/.clang-uml b/tests/t20019/.clang-uml index de0bffa3..e45dae93 100644 --- a/tests/t20019/.clang-uml +++ b/tests/t20019/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20019_sequence: type: sequence glob: - - ../../tests/t20019/t20019.cc + - tests/t20019/t20019.cc include: namespaces: - clanguml::t20019 diff --git a/tests/t20020/.clang-uml b/tests/t20020/.clang-uml index 891d3df2..cd97df03 100644 --- a/tests/t20020/.clang-uml +++ b/tests/t20020/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20020_sequence: type: sequence glob: - - ../../tests/t20020/t20020.cc + - tests/t20020/t20020.cc include: namespaces: - clanguml::t20020 diff --git a/tests/t20021/.clang-uml b/tests/t20021/.clang-uml index 8fdf0132..4df4d4b2 100644 --- a/tests/t20021/.clang-uml +++ b/tests/t20021/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20021_sequence: type: sequence glob: - - ../../tests/t20021/t20021.cc + - tests/t20021/t20021.cc include: namespaces: - clanguml::t20021 diff --git a/tests/t20022/.clang-uml b/tests/t20022/.clang-uml index 6fe768b8..48ccf51d 100644 --- a/tests/t20022/.clang-uml +++ b/tests/t20022/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20022_sequence: type: sequence glob: - - ../../tests/t20022/t20022.cc + - tests/t20022/t20022.cc include: namespaces: - clanguml::t20022 diff --git a/tests/t20023/.clang-uml b/tests/t20023/.clang-uml index 49f82a99..0e1c7079 100644 --- a/tests/t20023/.clang-uml +++ b/tests/t20023/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20023_sequence: type: sequence glob: - - ../../tests/t20023/t20023.cc + - tests/t20023/t20023.cc include: namespaces: - clanguml::t20023 diff --git a/tests/t20024/.clang-uml b/tests/t20024/.clang-uml index 52b29956..a93e71f5 100644 --- a/tests/t20024/.clang-uml +++ b/tests/t20024/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20024_sequence: type: sequence glob: - - ../../tests/t20024/t20024.cc + - tests/t20024/t20024.cc include: namespaces: - clanguml::t20024 diff --git a/tests/t20025/.clang-uml b/tests/t20025/.clang-uml index 0e72c357..8c027694 100644 --- a/tests/t20025/.clang-uml +++ b/tests/t20025/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20025_sequence: type: sequence glob: - - ../../tests/t20025/t20025.cc + - tests/t20025/t20025.cc include: namespaces: - clanguml::t20025 diff --git a/tests/t20026/.clang-uml b/tests/t20026/.clang-uml index 0ade1944..ee37b674 100644 --- a/tests/t20026/.clang-uml +++ b/tests/t20026/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20026_sequence: type: sequence glob: - - ../../tests/t20026/t20026.cc + - tests/t20026/t20026.cc include: namespaces: - clanguml::t20026 diff --git a/tests/t20027/.clang-uml b/tests/t20027/.clang-uml index 32752095..714dc20b 100644 --- a/tests/t20027/.clang-uml +++ b/tests/t20027/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20027_sequence: type: sequence glob: - - ../../tests/t20027/t20027.cc + - tests/t20027/t20027.cc include: namespaces: - clanguml::t20027 diff --git a/tests/t20028/.clang-uml b/tests/t20028/.clang-uml index cf295f8b..0094b818 100644 --- a/tests/t20028/.clang-uml +++ b/tests/t20028/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20028_sequence: type: sequence glob: - - ../../tests/t20028/t20028.cc + - tests/t20028/t20028.cc include: namespaces: - clanguml::t20028 diff --git a/tests/t20029/.clang-uml b/tests/t20029/.clang-uml index cc9e5703..2041eb9a 100644 --- a/tests/t20029/.clang-uml +++ b/tests/t20029/.clang-uml @@ -6,7 +6,7 @@ diagrams: t20029_sequence: type: sequence glob: - - ../../tests/t20029/t20029.cc + - tests/t20029/t20029.cc include: namespaces: - clanguml::t20029 diff --git a/tests/t20030/.clang-uml b/tests/t20030/.clang-uml index a54e474d..ea567241 100644 --- a/tests/t20030/.clang-uml +++ b/tests/t20030/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20030_sequence: type: sequence glob: - - ../../tests/t20030/t20030.cc + - tests/t20030/t20030.cc include: namespaces: - clanguml::t20030 diff --git a/tests/t20031/.clang-uml b/tests/t20031/.clang-uml index 3907966f..c3fc9cf3 100644 --- a/tests/t20031/.clang-uml +++ b/tests/t20031/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20031_sequence: type: sequence glob: - - ../../tests/t20031/t20031.cc + - tests/t20031/t20031.cc include: namespaces: - clanguml::t20031 diff --git a/tests/t20032/.clang-uml b/tests/t20032/.clang-uml index 104141ab..c700aa06 100644 --- a/tests/t20032/.clang-uml +++ b/tests/t20032/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20032_sequence: type: sequence glob: - - ../../tests/t20032/t20032.cc + - tests/t20032/t20032.cc include: namespaces: - clanguml::t20032 diff --git a/tests/t20033/.clang-uml b/tests/t20033/.clang-uml index 0f230c2b..c69328ea 100644 --- a/tests/t20033/.clang-uml +++ b/tests/t20033/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20033_sequence: type: sequence glob: - - ../../tests/t20033/t20033.cc + - tests/t20033/t20033.cc include: namespaces: - clanguml::t20033 diff --git a/tests/t20034/.clang-uml b/tests/t20034/.clang-uml index 3e970e05..40562200 100644 --- a/tests/t20034/.clang-uml +++ b/tests/t20034/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20034_sequence: type: sequence glob: - - ../../tests/t20034/t20034.cc + - tests/t20034/t20034.cc include: namespaces: - clanguml::t20034 diff --git a/tests/t20035/.clang-uml b/tests/t20035/.clang-uml index c7ee1c78..9059020a 100644 --- a/tests/t20035/.clang-uml +++ b/tests/t20035/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20035_sequence: type: sequence glob: - - ../../tests/t20035/t20035.cc + - tests/t20035/t20035.cc include: namespaces: - clanguml::t20035 diff --git a/tests/t20036/.clang-uml b/tests/t20036/.clang-uml index 9339d814..c89b120d 100644 --- a/tests/t20036/.clang-uml +++ b/tests/t20036/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20036_sequence: type: sequence glob: - - ../../tests/t20036/t20036.cc + - tests/t20036/t20036.cc include: namespaces: - clanguml::t20036 diff --git a/tests/t20037/.clang-uml b/tests/t20037/.clang-uml index c910987e..54c57eb2 100644 --- a/tests/t20037/.clang-uml +++ b/tests/t20037/.clang-uml @@ -4,7 +4,7 @@ diagrams: t20037_sequence: type: sequence glob: - - ../../tests/t20037/t20037.cc + - tests/t20037/t20037.cc include: namespaces: - clanguml::t20037 diff --git a/tests/t20038/.clang-uml b/tests/t20038/.clang-uml index 70601a0a..f56703a1 100644 --- a/tests/t20038/.clang-uml +++ b/tests/t20038/.clang-uml @@ -6,7 +6,7 @@ diagrams: t20038_sequence: type: sequence glob: - - ../../tests/t20038/t20038.cc + - tests/t20038/t20038.cc include: namespaces: - clanguml::t20038 diff --git a/tests/t30001/.clang-uml b/tests/t30001/.clang-uml index f3ad247d..21466f6d 100644 --- a/tests/t30001/.clang-uml +++ b/tests/t30001/.clang-uml @@ -5,7 +5,7 @@ diagrams: type: package title: Basic package diagram example glob: - - ../../tests/t30001/t30001.cc + - tests/t30001/t30001.cc include: namespaces: - clanguml::t30001 diff --git a/tests/t30002/.clang-uml b/tests/t30002/.clang-uml index c2111c65..e747d5e2 100644 --- a/tests/t30002/.clang-uml +++ b/tests/t30002/.clang-uml @@ -4,7 +4,7 @@ diagrams: t30002_package: type: package glob: - - ../../tests/t30002/t30002.cc + - tests/t30002/t30002.cc include: namespaces: - clanguml::t30002 diff --git a/tests/t30003/.clang-uml b/tests/t30003/.clang-uml index b4322243..87a0b1c4 100644 --- a/tests/t30003/.clang-uml +++ b/tests/t30003/.clang-uml @@ -4,7 +4,7 @@ diagrams: t30003_package: type: package glob: - - ../../tests/t30003/t30003.cc + - tests/t30003/t30003.cc include: namespaces: - clanguml::t30003 diff --git a/tests/t30004/.clang-uml b/tests/t30004/.clang-uml index c273c5f6..9c71a5a7 100644 --- a/tests/t30004/.clang-uml +++ b/tests/t30004/.clang-uml @@ -4,7 +4,7 @@ diagrams: t30004_package: type: package glob: - - ../../tests/t30004/t30004.cc + - tests/t30004/t30004.cc include: namespaces: - clanguml::t30004 diff --git a/tests/t30005/.clang-uml b/tests/t30005/.clang-uml index bbfe0e64..56eeae88 100644 --- a/tests/t30005/.clang-uml +++ b/tests/t30005/.clang-uml @@ -4,7 +4,7 @@ diagrams: t30005_package: type: package glob: - - ../../tests/t30005/t30005.cc + - tests/t30005/t30005.cc include: namespaces: - clanguml::t30005 diff --git a/tests/t30006/.clang-uml b/tests/t30006/.clang-uml index 5f970f91..08eb530d 100644 --- a/tests/t30006/.clang-uml +++ b/tests/t30006/.clang-uml @@ -4,7 +4,7 @@ diagrams: t30006_package: type: package glob: - - ../../tests/t30006/t30006.cc + - tests/t30006/t30006.cc include: namespaces: - clanguml::t30006 diff --git a/tests/t30007/.clang-uml b/tests/t30007/.clang-uml index 4551c4da..9f01cdea 100644 --- a/tests/t30007/.clang-uml +++ b/tests/t30007/.clang-uml @@ -4,7 +4,7 @@ diagrams: t30007_package: type: package glob: - - ../../tests/t30007/t30007.cc + - tests/t30007/t30007.cc include: namespaces: - clanguml::t30007 diff --git a/tests/t30008/.clang-uml b/tests/t30008/.clang-uml index 9325c7af..0a4c65c8 100644 --- a/tests/t30008/.clang-uml +++ b/tests/t30008/.clang-uml @@ -4,7 +4,7 @@ diagrams: t30008_package: type: package glob: - - ../../tests/t30008/t30008.cc + - tests/t30008/t30008.cc include: dependants: - clanguml::t30008::dependants::A diff --git a/tests/t30009/.clang-uml b/tests/t30009/.clang-uml index 13e21029..ffdff80c 100644 --- a/tests/t30009/.clang-uml +++ b/tests/t30009/.clang-uml @@ -4,7 +4,7 @@ diagrams: t30009_package: type: package glob: - - ../../tests/t30009/t30009.cc + - tests/t30009/t30009.cc include: namespaces: - clanguml::t30009 diff --git a/tests/t40001/.clang-uml b/tests/t40001/.clang-uml index 3509f844..2f977986 100644 --- a/tests/t40001/.clang-uml +++ b/tests/t40001/.clang-uml @@ -7,8 +7,7 @@ diagrams: # Provide the files to parse in order to look # for #include directives glob: - - ../../tests/t40001/src/t40001.cc - # Render the paths relative to this directory + - src/t40001.cc relative_to: ../../../tests/t40001 # Include also external system headers generate_system_headers: true diff --git a/tests/t40002/.clang-uml b/tests/t40002/.clang-uml index 21514d18..8c2b34db 100644 --- a/tests/t40002/.clang-uml +++ b/tests/t40002/.clang-uml @@ -6,10 +6,9 @@ diagrams: # Provide the files to parse in order to look # for #include directives glob: - - ../../tests/t40002/src/t40002.cc - - ../../tests/t40002/src/lib1/lib1.cc - - ../../tests/t40002/src/lib2/lib2.cc - # Render the paths relative to this directory + - src/t40002.cc + - src/lib1/lib1.cc + - src/lib2/lib2.cc relative_to: ../../../tests/t40002 include: # Include only files belonging to these paths relative to relative_to diff --git a/tests/t40003/.clang-uml b/tests/t40003/.clang-uml index 782b375a..2fc3135d 100644 --- a/tests/t40003/.clang-uml +++ b/tests/t40003/.clang-uml @@ -6,8 +6,8 @@ diagrams: # Provide the files to parse in order to look # for #include directives glob: - - ../../tests/t40003/src/dependants/t1.cc - - ../../tests/t40003/src/dependencies/t2.cc + - src/dependants/t1.cc + - src/dependencies/t2.cc # Render the paths relative to this directory relative_to: ../../../tests/t40003 include: diff --git a/tests/test_cases.cc b/tests/test_cases.cc index ebd4c4a0..4fd9dd1d 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -21,9 +21,12 @@ #include "cli/cli_handler.h" #include "common/compilation_database.h" #include "common/generators/generators.h" +#include "util/util.h" #include +#include + void inject_diagram_options(std::shared_ptr diagram) { // Inject links config to all test cases @@ -32,6 +35,18 @@ void inject_diagram_options(std::shared_ptr diagram) R"({% if existsIn(element, "comment") and existsIn(element.comment, "brief") %}{{ abbrv(trim(replace(element.comment.brief.0, "\n+", " ")), 256) }}{% else %}{{ element.name }}{% endif %})"}; diagram->generate_links.set(links_config); + + using namespace std::literals; + + std::vector tests_with_custom_relative_to_paths{ + "t00061_class"s, "t00065_class"s, "t20017_sequence"s, "t30010_package"s, + "t30011_package"s, "t40001_include"s, "t40002_include"s, + "t40003_include"s}; + + if (!clanguml::util::contains( + tests_with_custom_relative_to_paths, diagram->name)) { + diagram->get_relative_to().set("../../.."); + } } std::pair @@ -63,6 +78,9 @@ template auto generate_diagram_impl(clanguml::common::compilation_database &db, std::shared_ptr diagram) { + LOG_INFO("All paths will be evaluated relative to {}", + diagram->root_directory().string()); + using diagram_config = DiagramConfig; using diagram_model = typename clanguml::common::generators::diagram_model_t< diff --git a/tests/test_filters.cc b/tests/test_filters.cc index 5d42bd97..97c6f4b6 100644 --- a/tests/test_filters.cc +++ b/tests/test_filters.cc @@ -44,7 +44,7 @@ TEST_CASE("Test diagram paths filter", "[unit-test]") diagram_filter filter(diagram, config); auto make_path = [&](std::string_view p) { - return source_file{config.relative_to() / p}; + return source_file{config.root_directory() / p}; }; CHECK(filter.should_include( diff --git a/tests/test_util.cc b/tests/test_util.cc index 862de173..193e6293 100644 --- a/tests/test_util.cc +++ b/tests/test_util.cc @@ -417,3 +417,16 @@ TEST_CASE("Test format_message_comment", "[unit-test]") CHECK(format_message_comment("This is a url: http://example.com/test/12345", 15) == "This is a url:\nhttp://example.com/test/12345"); } + +TEST_CASE("Test is_relative_to", "[unit-test]") +{ + using std::filesystem::path; + using namespace clanguml::util; + + path child{"/a/b/c/d/include.h"}; + path base1{"/a/b/c"}; + path base2{"/tmp"}; + + CHECK(is_relative_to(child, base1)); + CHECK_FALSE(is_relative_to(child, base2)); +}