This commit is contained in:
Bartek Kryza
2024-05-13 15:51:45 +02:00
parent 235533d9fa
commit eeae5caef5
57 changed files with 2240 additions and 2480 deletions

View File

@@ -387,7 +387,7 @@ void try_run_test_case(const diagram_source_storage &diagrams, TC &&tc)
std::cout << "-----------------------------------------------------"
"--------------------------\n";
std::cout << "Test case failed for diagram type "
<< T::diagram_type_name << ": " << "\n";
<< T::diagram_type_name << ": " << "\n\n";
std::cout << diagrams.get<T>().to_string() << "\n";
throw e;
@@ -1044,9 +1044,6 @@ template <> bool IsClass(json_t d, std::string name)
#include "t00028/test_case.h"
#include "t00029/test_case.h"
#include "t00030/test_case.h"
/*
#include "t00031/test_case.h"
#include "t00032/test_case.h"
#include "t00033/test_case.h"
@@ -1085,6 +1082,10 @@ template <> bool IsClass(json_t d, std::string name)
#include "t00062/test_case.h"
#include "t00063/test_case.h"
#include "t00064/test_case.h"
/*
#if defined(ENABLE_CXX_STD_20_TEST_CASES)
#include "t00065/test_case.h"
#endif
@@ -1215,43 +1216,24 @@ int main(int argc, char *argv[])
{
doctest::Context context;
// defaults
// context.addFilter("test-case-exclude",
// "*math*"); // exclude test cases with "math" in their name
context.setOption(
"abort-after", 5); // stop test execution after 5 failed assertions
context.setOption("order-by", "name"); // sort the test cases by their name
context.applyCommandLine(argc, argv);
// overrides
context.setOption(
"no-breaks", false); // don't break in the debugger when assertions fail
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("-vvv");
clih.handle_options(argvv.size(), argvv.data());
int res = context.run(); // run
int res = context.run();
if (context.shouldExit()) // important - query flags (and --exit) rely on
// the user doing this
return res; // propagate the result of the tests
if (context.shouldExit())
return res;
int client_stuff_return_code = 0;
// your program - if the testing framework is integrated in your production
// code
return res;
return res + client_stuff_return_code; // the result from doctest is
// propagated here as well
/*
Catch::Session session;
using namespace Catch::clara;