Restructured test cases into categories
This commit is contained in:
@@ -1,22 +1,22 @@
|
|||||||
compilation_database_dir: ..
|
compilation_database_dir: ..
|
||||||
output_directory: puml
|
output_directory: puml
|
||||||
diagrams:
|
diagrams:
|
||||||
t00001_sequence:
|
t20001_sequence:
|
||||||
type: sequence
|
type: sequence
|
||||||
glob:
|
glob:
|
||||||
- ../../tests/t00001/t00001.cc
|
- ../../tests/t20001/t20001.cc
|
||||||
include:
|
include:
|
||||||
namespaces:
|
namespaces:
|
||||||
- clanguml::t00001
|
- clanguml::t20001
|
||||||
exclude:
|
exclude:
|
||||||
namespaces:
|
namespaces:
|
||||||
- clanguml::t00001::detail
|
- clanguml::t20001::detail
|
||||||
using_namespace:
|
using_namespace:
|
||||||
- clanguml::t00001
|
- clanguml::t20001
|
||||||
start_from:
|
start_from:
|
||||||
- usr: "c:@N@clanguml@N@t00001@F@tmain#"
|
- usr: "c:@N@clanguml@N@t20001@F@tmain#"
|
||||||
plantuml:
|
plantuml:
|
||||||
before:
|
before:
|
||||||
- "' t00001 test sequence diagram"
|
- "' t20001 test sequence diagram"
|
||||||
after:
|
after:
|
||||||
- 'note over "tmain()": Main test function'
|
- 'note over "tmain()": Main test function'
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace clanguml {
|
namespace clanguml {
|
||||||
namespace t00001 {
|
namespace t20001 {
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
struct C {
|
struct C {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* tests/t00001/test_case.cc
|
* tests/t20001/test_case.cc
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021 Bartek Kryza <bkryza@gmail.com>
|
* Copyright (c) 2021 Bartek Kryza <bkryza@gmail.com>
|
||||||
*
|
*
|
||||||
@@ -16,31 +16,31 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
TEST_CASE("Test t00001", "[unit-test]")
|
TEST_CASE("Test t20001", "[unit-test]")
|
||||||
{
|
{
|
||||||
spdlog::set_level(spdlog::level::debug);
|
spdlog::set_level(spdlog::level::debug);
|
||||||
|
|
||||||
auto [config, db] = load_config("t00001");
|
auto [config, db] = load_config("t20001");
|
||||||
|
|
||||||
auto diagram = config.diagrams["t00001_sequence"];
|
auto diagram = config.diagrams["t20001_sequence"];
|
||||||
|
|
||||||
REQUIRE(diagram->include.namespaces.size() == 1);
|
REQUIRE(diagram->include.namespaces.size() == 1);
|
||||||
REQUIRE_THAT(diagram->include.namespaces,
|
REQUIRE_THAT(diagram->include.namespaces,
|
||||||
VectorContains(std::string{"clanguml::t00001"}));
|
VectorContains(std::string{"clanguml::t20001"}));
|
||||||
|
|
||||||
REQUIRE(diagram->exclude.namespaces.size() == 1);
|
REQUIRE(diagram->exclude.namespaces.size() == 1);
|
||||||
REQUIRE_THAT(diagram->exclude.namespaces,
|
REQUIRE_THAT(diagram->exclude.namespaces,
|
||||||
VectorContains(std::string{"clanguml::t00001::detail"}));
|
VectorContains(std::string{"clanguml::t20001::detail"}));
|
||||||
|
|
||||||
REQUIRE(diagram->should_include("clanguml::t00001::A"));
|
REQUIRE(diagram->should_include("clanguml::t20001::A"));
|
||||||
REQUIRE(!diagram->should_include("clanguml::t00001::detail::C"));
|
REQUIRE(!diagram->should_include("clanguml::t20001::detail::C"));
|
||||||
REQUIRE(!diagram->should_include("std::vector"));
|
REQUIRE(!diagram->should_include("std::vector"));
|
||||||
|
|
||||||
REQUIRE(diagram->name == "t00001_sequence");
|
REQUIRE(diagram->name == "t20001_sequence");
|
||||||
|
|
||||||
auto model = generate_sequence_diagram(db, diagram);
|
auto model = generate_sequence_diagram(db, diagram);
|
||||||
|
|
||||||
REQUIRE(model.name == "t00001_sequence");
|
REQUIRE(model.name == "t20001_sequence");
|
||||||
|
|
||||||
auto puml = generate_sequence_puml(diagram, model);
|
auto puml = generate_sequence_puml(diagram, model);
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
compilation_database_dir: ..
|
compilation_database_dir: ..
|
||||||
output_directory: puml
|
output_directory: puml
|
||||||
diagrams:
|
diagrams:
|
||||||
t00000_class:
|
t90000_class:
|
||||||
type: class
|
type: class
|
||||||
plantuml:
|
plantuml:
|
||||||
before:
|
before:
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* tests/t00000/test_case.cc
|
* tests/t90000/test_case.cc
|
||||||
*
|
*
|
||||||
* Copyright (c) 2021 Bartek Kryza <bkryza@gmail.com>
|
* Copyright (c) 2021 Bartek Kryza <bkryza@gmail.com>
|
||||||
*
|
*
|
||||||
@@ -16,17 +16,17 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
TEST_CASE("Test t00000", "[unit-test]")
|
TEST_CASE("Test t90000", "[unit-test]")
|
||||||
{
|
{
|
||||||
spdlog::set_level(spdlog::level::debug);
|
spdlog::set_level(spdlog::level::debug);
|
||||||
|
|
||||||
auto [config, db] = load_config("t00000");
|
auto [config, db] = load_config("t90000");
|
||||||
|
|
||||||
auto diagram = config.diagrams["t00000_class"];
|
auto diagram = config.diagrams["t90000_class"];
|
||||||
|
|
||||||
auto model = generate_class_diagram(db, diagram);
|
auto model = generate_class_diagram(db, diagram);
|
||||||
|
|
||||||
REQUIRE(model.name == "t00000_class");
|
REQUIRE(model.name == "t90000_class");
|
||||||
|
|
||||||
auto puml = generate_class_puml(diagram, model);
|
auto puml = generate_class_puml(diagram, model);
|
||||||
AliasMatcher _A(puml);
|
AliasMatcher _A(puml);
|
||||||
@@ -113,8 +113,9 @@ using clanguml::test::matchers::Protected;
|
|||||||
using clanguml::test::matchers::Public;
|
using clanguml::test::matchers::Public;
|
||||||
using clanguml::test::matchers::Static;
|
using clanguml::test::matchers::Static;
|
||||||
|
|
||||||
#include "t00000/test_case.h"
|
//
|
||||||
#include "t00001/test_case.h"
|
// Class diagram tests
|
||||||
|
//
|
||||||
#include "t00002/test_case.h"
|
#include "t00002/test_case.h"
|
||||||
#include "t00003/test_case.h"
|
#include "t00003/test_case.h"
|
||||||
#include "t00004/test_case.h"
|
#include "t00004/test_case.h"
|
||||||
@@ -125,3 +126,13 @@ using clanguml::test::matchers::Static;
|
|||||||
#include "t00009/test_case.h"
|
#include "t00009/test_case.h"
|
||||||
#include "t00010/test_case.h"
|
#include "t00010/test_case.h"
|
||||||
#include "t00011/test_case.h"
|
#include "t00011/test_case.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// Sequence diagram tests
|
||||||
|
//
|
||||||
|
#include "t20001/test_case.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// Other tests (e.g. configuration file)
|
||||||
|
//
|
||||||
|
#include "t90000/test_case.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user