Ported remaining tests from Catch to doctest (#266)
This commit is contained in:
@@ -103,9 +103,9 @@ foreach(TEST_NAME ${TEST_NAMES})
|
||||
${TEST_CASE_MODULE_SOURCES})
|
||||
endif(ENABLE_CXX_MODULES_TEST_CASES)
|
||||
target_sources(${TEST_NAME} PUBLIC ${TEST_NAME}.cc
|
||||
${TEST_CASE_SOURCES} catch.h)
|
||||
${TEST_CASE_SOURCES})
|
||||
else()
|
||||
target_sources(${TEST_NAME} PUBLIC ${TEST_NAME}.cc catch.h)
|
||||
target_sources(${TEST_NAME} PUBLIC ${TEST_NAME}.cc)
|
||||
endif(TEST_NAME STREQUAL "test_cases")
|
||||
|
||||
target_compile_features(${TEST_NAME} PRIVATE
|
||||
|
||||
20325
tests/catch.h
20325
tests/catch.h
File diff suppressed because it is too large
Load Diff
@@ -15,12 +15,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||
|
||||
#include "cli/cli_handler.h"
|
||||
#include "version.h"
|
||||
|
||||
#include "catch.h"
|
||||
#include "doctest/doctest.h"
|
||||
|
||||
#include <spdlog/sinks/ostream_sink.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
@@ -32,7 +32,7 @@ std::shared_ptr<spdlog::logger> make_sstream_logger(std::ostream &ostr)
|
||||
"clanguml-logger", std::move(oss_sink));
|
||||
}
|
||||
|
||||
TEST_CASE("Test cli handler print_version", "[unit-test]")
|
||||
TEST_CASE("Test cli handler print_version")
|
||||
{
|
||||
using clanguml::cli::cli_flow_t;
|
||||
using clanguml::cli::cli_handler;
|
||||
@@ -52,7 +52,7 @@ TEST_CASE("Test cli handler print_version", "[unit-test]")
|
||||
"clang-uml {}", clanguml::version::CLANG_UML_VERSION)) == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("Test cli handler print_config", "[unit-test]")
|
||||
TEST_CASE("Test cli handler print_config")
|
||||
{
|
||||
using clanguml::cli::cli_flow_t;
|
||||
using clanguml::cli::cli_handler;
|
||||
@@ -73,7 +73,7 @@ TEST_CASE("Test cli handler print_config", "[unit-test]")
|
||||
REQUIRE(doc["diagrams"]["class_main"]);
|
||||
}
|
||||
|
||||
TEST_CASE("Test cli handler print_diagrams_list", "[unit-test]")
|
||||
TEST_CASE("Test cli handler print_diagrams_list")
|
||||
{
|
||||
using clanguml::cli::cli_flow_t;
|
||||
using clanguml::cli::cli_handler;
|
||||
@@ -97,7 +97,7 @@ TEST_CASE("Test cli handler print_diagrams_list", "[unit-test]")
|
||||
)");
|
||||
}
|
||||
|
||||
TEST_CASE("Test cli handler print_diagram_templates", "[unit-test]")
|
||||
TEST_CASE("Test cli handler print_diagram_templates")
|
||||
{
|
||||
using clanguml::cli::cli_flow_t;
|
||||
using clanguml::cli::cli_handler;
|
||||
@@ -123,7 +123,7 @@ TEST_CASE("Test cli handler print_diagram_templates", "[unit-test]")
|
||||
)");
|
||||
}
|
||||
|
||||
TEST_CASE("Test cli handler print_diagram_template", "[unit-test]")
|
||||
TEST_CASE("Test cli handler print_diagram_template")
|
||||
{
|
||||
using clanguml::cli::cli_flow_t;
|
||||
using clanguml::cli::cli_handler;
|
||||
@@ -158,8 +158,7 @@ TEST_CASE("Test cli handler print_diagram_template", "[unit-test]")
|
||||
)");
|
||||
}
|
||||
|
||||
TEST_CASE(
|
||||
"Test cli handler add_compile_flag and remove_compile_flag", "[unit-test]")
|
||||
TEST_CASE("Test cli handler add_compile_flag and remove_compile_flag")
|
||||
{
|
||||
using clanguml::cli::cli_flow_t;
|
||||
using clanguml::cli::cli_handler;
|
||||
@@ -185,8 +184,7 @@ TEST_CASE(
|
||||
REQUIRE(contains(cli.config.remove_compile_flags(), "-I/usr/include"));
|
||||
}
|
||||
|
||||
TEST_CASE(
|
||||
"Test cli handler puml config inheritance with render cmd", "[unit-test]")
|
||||
TEST_CASE("Test cli handler puml config inheritance with render cmd")
|
||||
{
|
||||
using clanguml::cli::cli_flow_t;
|
||||
using clanguml::cli::cli_handler;
|
||||
|
||||
@@ -15,16 +15,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#define CATCH_CONFIG_CONSOLE_WIDTH 512
|
||||
#define DOCTEST_CONFIG_IMPLEMENT
|
||||
|
||||
#include "catch.h"
|
||||
#include "doctest/doctest.h"
|
||||
|
||||
#include "cli/cli_handler.h"
|
||||
#include "common/compilation_database.h"
|
||||
#include "util/util.h"
|
||||
|
||||
#include "catch.h"
|
||||
#include <spdlog/sinks/ostream_sink.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
@@ -35,7 +33,7 @@ std::shared_ptr<spdlog::logger> make_sstream_logger(std::ostream &ostr)
|
||||
"clanguml-logger", std::move(oss_sink));
|
||||
}
|
||||
|
||||
TEST_CASE("Test compilation_database should work", "[unit-test]")
|
||||
TEST_CASE("Test compilation_database should work")
|
||||
{
|
||||
using clanguml::common::compilation_database;
|
||||
using clanguml::common::compilation_database_ptr;
|
||||
@@ -82,7 +80,7 @@ TEST_CASE("Test compilation_database should work", "[unit-test]")
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Test compilation_database should throw", "[unit-test]")
|
||||
TEST_CASE("Test compilation_database should throw")
|
||||
{
|
||||
using clanguml::common::compilation_database;
|
||||
using clanguml::common::compilation_database_ptr;
|
||||
@@ -102,30 +100,23 @@ TEST_CASE("Test compilation_database should throw", "[unit-test]")
|
||||
///
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Catch::Session session;
|
||||
using namespace Catch::clara;
|
||||
doctest::Context context;
|
||||
|
||||
bool debug_log{false};
|
||||
auto cli = session.cli() |
|
||||
Opt(debug_log, "debug_log")["-u"]["--debug-log"]("Enable debug logs");
|
||||
|
||||
session.cli(cli);
|
||||
|
||||
int returnCode = session.applyCommandLine(argc, argv);
|
||||
if (returnCode != 0)
|
||||
return returnCode;
|
||||
context.applyCommandLine(argc, argv);
|
||||
|
||||
clanguml::cli::cli_handler clih;
|
||||
|
||||
std::vector<const char *> argvv = {
|
||||
"clang-uml", "--config", "./test_config_data/simple.yml"};
|
||||
|
||||
if (debug_log)
|
||||
argvv.push_back("-vvv");
|
||||
else
|
||||
argvv.push_back("-q");
|
||||
argvv.push_back("-q");
|
||||
|
||||
clih.handle_options(argvv.size(), argvv.data());
|
||||
|
||||
return session.run();
|
||||
int res = context.run();
|
||||
|
||||
if (context.shouldExit())
|
||||
return res;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#define CATCH_CONFIG_CONSOLE_WIDTH 512
|
||||
#include "catch.h"
|
||||
#define DOCTEST_CONFIG_IMPLEMENT
|
||||
|
||||
#include "doctest/doctest.h"
|
||||
|
||||
#include "cli/cli_handler.h"
|
||||
#include "config/config.h"
|
||||
#include "util/util.h"
|
||||
|
||||
TEST_CASE("Test config simple", "[unit-test]")
|
||||
TEST_CASE("Test config simple")
|
||||
{
|
||||
using clanguml::common::model::access_t;
|
||||
using clanguml::common::model::relationship_t;
|
||||
@@ -102,7 +102,7 @@ TEST_CASE("Test config simple", "[unit-test]")
|
||||
relationship_t::kAggregation);
|
||||
}
|
||||
|
||||
TEST_CASE("Test config inherited", "[unit-test]")
|
||||
TEST_CASE("Test config inherited")
|
||||
{
|
||||
auto cfg = clanguml::config::load("./test_config_data/inherited.yml");
|
||||
|
||||
@@ -132,7 +132,7 @@ TEST_CASE("Test config inherited", "[unit-test]")
|
||||
CHECK(cus.puml().after.at(1) == "This is a common footnote");
|
||||
}
|
||||
|
||||
TEST_CASE("Test config includes", "[unit-test]")
|
||||
TEST_CASE("Test config includes")
|
||||
{
|
||||
auto cfg = clanguml::config::load("./test_config_data/includes.yml");
|
||||
|
||||
@@ -156,7 +156,7 @@ TEST_CASE("Test config includes", "[unit-test]")
|
||||
clanguml::config::method_arguments::none);
|
||||
}
|
||||
|
||||
TEST_CASE("Test config layout", "[unit-test]")
|
||||
TEST_CASE("Test config layout")
|
||||
{
|
||||
using namespace std::string_literals;
|
||||
|
||||
@@ -242,7 +242,7 @@ TEST_CASE("Test config layout", "[unit-test]")
|
||||
clanguml::common::model::diagram_t::kPackage);
|
||||
}
|
||||
|
||||
TEST_CASE("Test config emitters", "[unit-test]")
|
||||
TEST_CASE("Test config emitters")
|
||||
{
|
||||
auto cfg = clanguml::config::load("./test_config_data/complete.yml");
|
||||
|
||||
@@ -268,7 +268,7 @@ TEST_CASE("Test config emitters", "[unit-test]")
|
||||
std::filesystem::remove(tmp_file);
|
||||
}
|
||||
|
||||
TEST_CASE("Test config diagram_templates", "[unit-test]")
|
||||
TEST_CASE("Test config diagram_templates")
|
||||
{
|
||||
auto cfg =
|
||||
clanguml::config::load("./test_config_data/diagram_templates.yml");
|
||||
@@ -327,7 +327,7 @@ TEST_CASE("Test config diagram_templates", "[unit-test]")
|
||||
clanguml::common::model::diagram_t::kSequence);
|
||||
}
|
||||
|
||||
TEST_CASE("Test config sequence inherited", "[unit-test]")
|
||||
TEST_CASE("Test config sequence inherited")
|
||||
{
|
||||
auto cfg = clanguml::config::load(
|
||||
"./test_config_data/sequence_inheritable_options.yml");
|
||||
@@ -344,7 +344,7 @@ TEST_CASE("Test config sequence inherited", "[unit-test]")
|
||||
CHECK(def.generate_return_types() == false);
|
||||
}
|
||||
|
||||
TEST_CASE("Test config relative paths handling", "[unit-test]")
|
||||
TEST_CASE("Test config relative paths handling")
|
||||
{
|
||||
auto cfg = clanguml::config::load("./test_config_data/relative_to.yml");
|
||||
|
||||
@@ -378,7 +378,7 @@ TEST_CASE("Test config relative paths handling", "[unit-test]")
|
||||
"{}/test_config_data", std::filesystem::current_path().string()));
|
||||
}
|
||||
|
||||
TEST_CASE("Test using_module relative to", "[unit-test]")
|
||||
TEST_CASE("Test using_module relative to")
|
||||
{
|
||||
auto cfg = clanguml::config::load("./test_config_data/using_module.yml");
|
||||
|
||||
@@ -403,7 +403,7 @@ TEST_CASE("Test using_module relative to", "[unit-test]")
|
||||
std::string{"modA"}, std::string{"modB"}, std::string{"modC"}});
|
||||
}
|
||||
|
||||
TEST_CASE("Test config full clang uml dump", "[unit-test]")
|
||||
TEST_CASE("Test config full clang uml dump")
|
||||
{
|
||||
auto cfg =
|
||||
clanguml::config::load("./test_config_data/clang_uml_config.yml");
|
||||
@@ -411,7 +411,7 @@ TEST_CASE("Test config full clang uml dump", "[unit-test]")
|
||||
CHECK(cfg.diagrams.size() == 32);
|
||||
}
|
||||
|
||||
TEST_CASE("Test config type aliases", "[unit-test]")
|
||||
TEST_CASE("Test config type aliases")
|
||||
{
|
||||
auto cfg = clanguml::config::load("./test_config_data/type_aliases.yml");
|
||||
|
||||
@@ -447,30 +447,23 @@ TEST_CASE("Test config type aliases", "[unit-test]")
|
||||
///
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Catch::Session session;
|
||||
using namespace Catch::clara;
|
||||
doctest::Context context;
|
||||
|
||||
bool debug_log{false};
|
||||
auto cli = session.cli() |
|
||||
Opt(debug_log, "debug_log")["-u"]["--debug-log"]("Enable debug logs");
|
||||
|
||||
session.cli(cli);
|
||||
|
||||
int returnCode = session.applyCommandLine(argc, argv);
|
||||
if (returnCode != 0)
|
||||
return returnCode;
|
||||
context.applyCommandLine(argc, argv);
|
||||
|
||||
clanguml::cli::cli_handler clih;
|
||||
|
||||
std::vector<const char *> argvv = {
|
||||
"clang-uml", "--config", "./test_config_data/simple.yml"};
|
||||
|
||||
if (debug_log)
|
||||
argvv.push_back("-vvv");
|
||||
else
|
||||
argvv.push_back("-q");
|
||||
argvv.push_back("-q");
|
||||
|
||||
clih.handle_options(argvv.size(), argvv.data());
|
||||
|
||||
return session.run();
|
||||
int res = context.run();
|
||||
|
||||
if (context.shouldExit())
|
||||
return res;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||
|
||||
#include "decorators/decorators.h"
|
||||
|
||||
#include "catch.h"
|
||||
#include "util/util.h"
|
||||
|
||||
TEST_CASE("Test decorator parser on regular comment", "[unit-test]")
|
||||
#include "doctest/doctest.h"
|
||||
|
||||
TEST_CASE("Test decorator parser on regular comment")
|
||||
{
|
||||
std::string comment = R"(
|
||||
\brief This is a comment.
|
||||
@@ -42,7 +42,7 @@ TEST_CASE("Test decorator parser on regular comment", "[unit-test]")
|
||||
CHECK(clanguml::util::trim(comment) == stripped);
|
||||
}
|
||||
|
||||
TEST_CASE("Test decorator parser on note", "[unit-test]")
|
||||
TEST_CASE("Test decorator parser on note")
|
||||
{
|
||||
std::string comment = R"(
|
||||
\brief This is a comment.
|
||||
@@ -99,7 +99,7 @@ TEST_CASE("Test decorator parser on note", "[unit-test]")
|
||||
\param b float a float)");
|
||||
}
|
||||
|
||||
TEST_CASE("Test decorator parser on note with custom tag", "[unit-test]")
|
||||
TEST_CASE("Test decorator parser on note with custom tag")
|
||||
{
|
||||
std::string comment = R"(
|
||||
\brief This is a comment.
|
||||
@@ -156,7 +156,7 @@ TEST_CASE("Test decorator parser on note with custom tag", "[unit-test]")
|
||||
\param b float a float)");
|
||||
}
|
||||
|
||||
TEST_CASE("Test decorator parser on style", "[unit-test]")
|
||||
TEST_CASE("Test decorator parser on style")
|
||||
{
|
||||
std::string comment = R"(
|
||||
\uml{style[#green,dashed,thickness=4]}
|
||||
@@ -175,7 +175,7 @@ TEST_CASE("Test decorator parser on style", "[unit-test]")
|
||||
CHECK(stripped.empty());
|
||||
}
|
||||
|
||||
TEST_CASE("Test decorator parser on aggregation", "[unit-test]")
|
||||
TEST_CASE("Test decorator parser on aggregation")
|
||||
{
|
||||
std::string comment = R"(
|
||||
\uml{aggregation[0..1:0..*]}
|
||||
@@ -194,7 +194,7 @@ TEST_CASE("Test decorator parser on aggregation", "[unit-test]")
|
||||
CHECK(stripped.empty());
|
||||
}
|
||||
|
||||
TEST_CASE("Test decorator parser on skip", "[unit-test]")
|
||||
TEST_CASE("Test decorator parser on skip")
|
||||
{
|
||||
std::string comment = R"(
|
||||
\uml{skip}
|
||||
@@ -212,7 +212,7 @@ TEST_CASE("Test decorator parser on skip", "[unit-test]")
|
||||
CHECK(stripped.empty());
|
||||
}
|
||||
|
||||
TEST_CASE("Test decorator parser on skiprelationship", "[unit-test]")
|
||||
TEST_CASE("Test decorator parser on skiprelationship")
|
||||
{
|
||||
std::string comment = R"(
|
||||
\uml{skiprelationship}
|
||||
@@ -230,7 +230,7 @@ TEST_CASE("Test decorator parser on skiprelationship", "[unit-test]")
|
||||
CHECK(stripped.empty());
|
||||
}
|
||||
|
||||
TEST_CASE("Test decorator parser on diagram scope", "[unit-test]")
|
||||
TEST_CASE("Test decorator parser on diagram scope")
|
||||
{
|
||||
std::string comment = R"(
|
||||
\uml{note:diagram1, diagram2,
|
||||
@@ -259,7 +259,7 @@ TEST_CASE("Test decorator parser on diagram scope", "[unit-test]")
|
||||
CHECK(stripped.empty());
|
||||
}
|
||||
|
||||
TEST_CASE("Test invalid comment - unterminated curly brace", "[unit-test]")
|
||||
TEST_CASE("Test invalid comment - unterminated curly brace")
|
||||
{
|
||||
std::string comment = R"(
|
||||
Test test test
|
||||
|
||||
@@ -15,11 +15,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#define DOCTEST_CONFIG_IMPLEMENT
|
||||
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#define CATCH_CONFIG_CONSOLE_WIDTH 512
|
||||
|
||||
#include "catch.h"
|
||||
#include "doctest/doctest.h"
|
||||
|
||||
#include "class_diagram/model/class.h"
|
||||
#include "cli/cli_handler.h"
|
||||
@@ -31,7 +29,7 @@
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
TEST_CASE("Test diagram paths filter", "[unit-test]")
|
||||
TEST_CASE("Test diagram paths filter")
|
||||
{
|
||||
using clanguml::common::model::diagram_filter;
|
||||
using clanguml::common::model::source_file;
|
||||
@@ -56,7 +54,7 @@ TEST_CASE("Test diagram paths filter", "[unit-test]")
|
||||
make_path("sequence_diagram/visitor/translation_unit_visitor.h")));
|
||||
}
|
||||
|
||||
TEST_CASE("Test method_types include filter", "[unit-test]")
|
||||
TEST_CASE("Test method_types include filter")
|
||||
{
|
||||
using clanguml::class_diagram::model::class_method;
|
||||
using clanguml::common::model::access_t;
|
||||
@@ -81,7 +79,7 @@ TEST_CASE("Test method_types include filter", "[unit-test]")
|
||||
CHECK(!filter.should_include(cm));
|
||||
}
|
||||
|
||||
TEST_CASE("Test method_types exclude filter", "[unit-test]")
|
||||
TEST_CASE("Test method_types exclude filter")
|
||||
{
|
||||
using clanguml::class_diagram::model::class_method;
|
||||
using clanguml::common::model::access_t;
|
||||
@@ -109,7 +107,7 @@ TEST_CASE("Test method_types exclude filter", "[unit-test]")
|
||||
CHECK(!filter.should_include(cm));
|
||||
}
|
||||
|
||||
TEST_CASE("Test namespaces filter", "[unit-test]")
|
||||
TEST_CASE("Test namespaces filter")
|
||||
{
|
||||
using clanguml::class_diagram::model::class_method;
|
||||
using clanguml::class_diagram::model::class_parent;
|
||||
@@ -173,7 +171,7 @@ TEST_CASE("Test namespaces filter", "[unit-test]")
|
||||
CHECK(!filter.should_include(p));
|
||||
}
|
||||
|
||||
TEST_CASE("Test elements regexp filter", "[unit-test]")
|
||||
TEST_CASE("Test elements regexp filter")
|
||||
{
|
||||
using clanguml::class_diagram::model::class_method;
|
||||
using clanguml::common::model::access_t;
|
||||
@@ -213,7 +211,7 @@ TEST_CASE("Test elements regexp filter", "[unit-test]")
|
||||
CHECK(filter.should_include(c));
|
||||
}
|
||||
|
||||
TEST_CASE("Test namespaces regexp filter", "[unit-test]")
|
||||
TEST_CASE("Test namespaces regexp filter")
|
||||
{
|
||||
using clanguml::class_diagram::model::class_method;
|
||||
using clanguml::class_diagram::model::class_parent;
|
||||
@@ -272,7 +270,7 @@ TEST_CASE("Test namespaces regexp filter", "[unit-test]")
|
||||
CHECK(filter.should_include(p));
|
||||
}
|
||||
|
||||
TEST_CASE("Test subclasses regexp filter", "[unit-test]")
|
||||
TEST_CASE("Test subclasses regexp filter")
|
||||
{
|
||||
using clanguml::class_diagram::model::class_method;
|
||||
using clanguml::class_diagram::model::class_parent;
|
||||
@@ -362,7 +360,7 @@ TEST_CASE("Test subclasses regexp filter", "[unit-test]")
|
||||
CHECK(!filter.should_include(*diagram.find<class_>("ns1::ns2::C1")));
|
||||
}
|
||||
|
||||
TEST_CASE("Test parents regexp filter", "[unit-test]")
|
||||
TEST_CASE("Test parents regexp filter")
|
||||
{
|
||||
using clanguml::class_diagram::model::class_method;
|
||||
using clanguml::class_diagram::model::class_parent;
|
||||
@@ -452,7 +450,7 @@ TEST_CASE("Test parents regexp filter", "[unit-test]")
|
||||
CHECK(!filter.should_include(*diagram.find<class_>("ns1::ns2::Common")));
|
||||
}
|
||||
|
||||
TEST_CASE("Test specializations regexp filter", "[unit-test]")
|
||||
TEST_CASE("Test specializations regexp filter")
|
||||
{
|
||||
using clanguml::class_diagram::model::class_method;
|
||||
using clanguml::class_diagram::model::class_parent;
|
||||
@@ -516,7 +514,7 @@ TEST_CASE("Test specializations regexp filter", "[unit-test]")
|
||||
CHECK(!filter.should_include(*diagram.find<class_>("A<double>")));
|
||||
}
|
||||
|
||||
TEST_CASE("Test context regexp filter", "[unit-test]")
|
||||
TEST_CASE("Test context regexp filter")
|
||||
{
|
||||
using clanguml::class_diagram::model::class_;
|
||||
using clanguml::class_diagram::model::class_method;
|
||||
@@ -605,7 +603,7 @@ TEST_CASE("Test context regexp filter", "[unit-test]")
|
||||
CHECK(!filter.should_include(*diagram.find<class_>("C1")));
|
||||
}
|
||||
|
||||
TEST_CASE("Test dependencies regexp filter", "[unit-test]")
|
||||
TEST_CASE("Test dependencies regexp filter")
|
||||
{
|
||||
using clanguml::class_diagram::model::class_;
|
||||
using clanguml::class_diagram::model::class_method;
|
||||
@@ -689,7 +687,7 @@ TEST_CASE("Test dependencies regexp filter", "[unit-test]")
|
||||
CHECK(!filter.should_include(*diagram.find<class_>("C1")));
|
||||
}
|
||||
|
||||
TEST_CASE("Test dependants regexp filter", "[unit-test]")
|
||||
TEST_CASE("Test dependants regexp filter")
|
||||
{
|
||||
using clanguml::class_diagram::model::class_;
|
||||
using clanguml::class_diagram::model::class_method;
|
||||
@@ -773,7 +771,7 @@ TEST_CASE("Test dependants regexp filter", "[unit-test]")
|
||||
CHECK(!filter.should_include(*diagram.find<class_>("C1")));
|
||||
}
|
||||
|
||||
TEST_CASE("Test callee_types filter", "[unit-test]")
|
||||
TEST_CASE("Test callee_types filter")
|
||||
{
|
||||
using clanguml::common::to_id;
|
||||
using clanguml::common::model::diagram_filter;
|
||||
@@ -829,30 +827,23 @@ TEST_CASE("Test callee_types filter", "[unit-test]")
|
||||
///
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Catch::Session session;
|
||||
using namespace Catch::clara;
|
||||
doctest::Context context;
|
||||
|
||||
bool debug_log{false};
|
||||
auto cli = session.cli() |
|
||||
Opt(debug_log, "debug_log")["-u"]["--debug-log"]("Enable debug logs");
|
||||
|
||||
session.cli(cli);
|
||||
|
||||
int returnCode = session.applyCommandLine(argc, argv);
|
||||
if (returnCode != 0)
|
||||
return returnCode;
|
||||
context.applyCommandLine(argc, argv);
|
||||
|
||||
clanguml::cli::cli_handler clih;
|
||||
|
||||
std::vector<const char *> argvv = {
|
||||
"clang-uml", "--config", "./test_config_data/simple.yml"};
|
||||
|
||||
if (debug_log)
|
||||
argvv.push_back("-vvv");
|
||||
else
|
||||
argvv.push_back("-q");
|
||||
argvv.push_back("-q");
|
||||
|
||||
clih.handle_options(argvv.size(), argvv.data());
|
||||
|
||||
return session.run();
|
||||
int res = context.run();
|
||||
|
||||
if (context.shouldExit())
|
||||
return res;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -15,16 +15,16 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||
|
||||
#include "catch.h"
|
||||
#include "doctest/doctest.h"
|
||||
|
||||
#include "class_diagram/model/class.h"
|
||||
#include "common/model/namespace.h"
|
||||
#include "common/model/package.h"
|
||||
#include "common/model/template_parameter.h"
|
||||
|
||||
TEST_CASE("Test namespace_", "[unit-test]")
|
||||
TEST_CASE("Test namespace_")
|
||||
{
|
||||
using clanguml::common::model::namespace_;
|
||||
|
||||
@@ -74,7 +74,7 @@ TEST_CASE("Test namespace_", "[unit-test]")
|
||||
CHECK(ns8.relative(name) == "ccc<std::unique_ptr<ddd>>");
|
||||
}
|
||||
|
||||
TEST_CASE("Test class_::calculate_specialization_match", "[unit-test]")
|
||||
TEST_CASE("Test class_::calculate_specialization_match")
|
||||
{
|
||||
using clanguml::class_diagram::model::class_;
|
||||
using clanguml::common::model::template_parameter;
|
||||
@@ -116,8 +116,7 @@ TEST_CASE("Test class_::calculate_specialization_match", "[unit-test]")
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE(
|
||||
"Test template_parameter::calculate_specialization_match", "[unit-test]")
|
||||
TEST_CASE("Test template_parameter::calculate_specialization_match")
|
||||
{
|
||||
using clanguml::common::model::template_parameter;
|
||||
|
||||
@@ -409,7 +408,7 @@ TEST_CASE(
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Test common::model::package full_name", "[unit-test]")
|
||||
TEST_CASE("Test common::model::package full_name")
|
||||
{
|
||||
using clanguml::common::model::package;
|
||||
using clanguml::common::model::path;
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||
|
||||
#include "doctest/doctest.h"
|
||||
|
||||
#include "util/query_driver_output_extractor.h"
|
||||
|
||||
#include "catch.h"
|
||||
|
||||
TEST_CASE("Test extract system include paths", "[unit-test]")
|
||||
TEST_CASE("Test extract system include paths")
|
||||
{
|
||||
|
||||
std::string output = R"(###
|
||||
|
||||
Reference in New Issue
Block a user