First passing test cases using libtooling visitor
This commit is contained in:
@@ -30,18 +30,25 @@ void inject_diagram_options(std::shared_ptr<clanguml::config::diagram> diagram)
|
||||
diagram->generate_links.set(links_config);
|
||||
}
|
||||
|
||||
std::pair<clanguml::config::config, cppast::libclang_compilation_database>
|
||||
std::pair<clanguml::config::config,
|
||||
std::unique_ptr<clang::tooling::CompilationDatabase>>
|
||||
load_config(const std::string &test_name)
|
||||
{
|
||||
auto config = clanguml::config::load(test_name + "/.clang-uml");
|
||||
|
||||
cppast::libclang_compilation_database db(config.compilation_database_dir());
|
||||
std::string err{};
|
||||
auto compilation_database =
|
||||
clang::tooling::CompilationDatabase::autoDetectFromDirectory(
|
||||
config.compilation_database_dir(), err);
|
||||
|
||||
return std::make_pair(std::move(config), std::move(db));
|
||||
if(!err.empty())
|
||||
throw std::runtime_error{err};
|
||||
|
||||
return std::make_pair(std::move(config), std::move(compilation_database));
|
||||
}
|
||||
|
||||
std::unique_ptr<clanguml::sequence_diagram::model::diagram>
|
||||
generate_sequence_diagram(cppast::libclang_compilation_database &db,
|
||||
generate_sequence_diagram(clang::tooling::CompilationDatabase &db,
|
||||
std::shared_ptr<clanguml::config::diagram> diagram)
|
||||
{
|
||||
using diagram_config = clanguml::config::sequence_diagram;
|
||||
@@ -59,7 +66,7 @@ generate_sequence_diagram(cppast::libclang_compilation_database &db,
|
||||
}
|
||||
|
||||
std::unique_ptr<clanguml::class_diagram::model::diagram> generate_class_diagram(
|
||||
cppast::libclang_compilation_database &db,
|
||||
clang::tooling::CompilationDatabase &db,
|
||||
std::shared_ptr<clanguml::config::diagram> diagram)
|
||||
{
|
||||
using diagram_config = clanguml::config::class_diagram;
|
||||
@@ -77,7 +84,7 @@ std::unique_ptr<clanguml::class_diagram::model::diagram> generate_class_diagram(
|
||||
}
|
||||
|
||||
std::unique_ptr<clanguml::package_diagram::model::diagram>
|
||||
generate_package_diagram(cppast::libclang_compilation_database &db,
|
||||
generate_package_diagram(clang::tooling::CompilationDatabase &db,
|
||||
std::shared_ptr<clanguml::config::diagram> diagram)
|
||||
{
|
||||
using diagram_config = clanguml::config::package_diagram;
|
||||
@@ -93,7 +100,7 @@ generate_package_diagram(cppast::libclang_compilation_database &db,
|
||||
}
|
||||
|
||||
std::unique_ptr<clanguml::include_diagram::model::diagram>
|
||||
generate_include_diagram(cppast::libclang_compilation_database &db,
|
||||
generate_include_diagram(clang::tooling::CompilationDatabase &db,
|
||||
std::shared_ptr<clanguml::config::diagram> diagram)
|
||||
{
|
||||
using diagram_config = clanguml::config::include_diagram;
|
||||
@@ -188,76 +195,76 @@ using namespace clanguml::test::matchers;
|
||||
#include "t00004/test_case.h"
|
||||
#include "t00005/test_case.h"
|
||||
#include "t00006/test_case.h"
|
||||
#include "t00007/test_case.h"
|
||||
#include "t00008/test_case.h"
|
||||
#include "t00009/test_case.h"
|
||||
#include "t00010/test_case.h"
|
||||
#include "t00011/test_case.h"
|
||||
#include "t00012/test_case.h"
|
||||
#include "t00013/test_case.h"
|
||||
#include "t00014/test_case.h"
|
||||
#include "t00015/test_case.h"
|
||||
#include "t00016/test_case.h"
|
||||
#include "t00017/test_case.h"
|
||||
#include "t00018/test_case.h"
|
||||
#include "t00019/test_case.h"
|
||||
#include "t00020/test_case.h"
|
||||
#include "t00021/test_case.h"
|
||||
#include "t00022/test_case.h"
|
||||
#include "t00023/test_case.h"
|
||||
#include "t00024/test_case.h"
|
||||
#include "t00025/test_case.h"
|
||||
#include "t00026/test_case.h"
|
||||
#include "t00027/test_case.h"
|
||||
#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"
|
||||
#include "t00034/test_case.h"
|
||||
#include "t00035/test_case.h"
|
||||
#include "t00036/test_case.h"
|
||||
#include "t00037/test_case.h"
|
||||
#include "t00038/test_case.h"
|
||||
#include "t00039/test_case.h"
|
||||
#include "t00040/test_case.h"
|
||||
#include "t00041/test_case.h"
|
||||
#include "t00042/test_case.h"
|
||||
#include "t00043/test_case.h"
|
||||
#include "t00044/test_case.h"
|
||||
#include "t00045/test_case.h"
|
||||
#include "t00046/test_case.h"
|
||||
|
||||
//#include "t00007/test_case.h"
|
||||
//#include "t00008/test_case.h"
|
||||
//#include "t00009/test_case.h"
|
||||
//#include "t00010/test_case.h"
|
||||
//#include "t00011/test_case.h"
|
||||
//#include "t00012/test_case.h"
|
||||
//#include "t00013/test_case.h"
|
||||
//#include "t00014/test_case.h"
|
||||
//#include "t00015/test_case.h"
|
||||
//#include "t00016/test_case.h"
|
||||
//#include "t00017/test_case.h"
|
||||
//#include "t00018/test_case.h"
|
||||
//#include "t00019/test_case.h"
|
||||
//#include "t00020/test_case.h"
|
||||
//#include "t00021/test_case.h"
|
||||
//#include "t00022/test_case.h"
|
||||
//#include "t00023/test_case.h"
|
||||
//#include "t00024/test_case.h"
|
||||
//#include "t00025/test_case.h"
|
||||
//#include "t00026/test_case.h"
|
||||
//#include "t00027/test_case.h"
|
||||
//#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"
|
||||
//#include "t00034/test_case.h"
|
||||
//#include "t00035/test_case.h"
|
||||
//#include "t00036/test_case.h"
|
||||
//#include "t00037/test_case.h"
|
||||
//#include "t00038/test_case.h"
|
||||
//#include "t00039/test_case.h"
|
||||
//#include "t00040/test_case.h"
|
||||
//#include "t00041/test_case.h"
|
||||
//#include "t00042/test_case.h"
|
||||
//#include "t00043/test_case.h"
|
||||
//#include "t00044/test_case.h"
|
||||
//#include "t00045/test_case.h"
|
||||
//#include "t00046/test_case.h"
|
||||
//
|
||||
// Sequence diagram tests
|
||||
////
|
||||
//// Sequence diagram tests
|
||||
////
|
||||
//#include "t20001/test_case.h"
|
||||
//#include "t20002/test_case.h"
|
||||
//
|
||||
#include "t20001/test_case.h"
|
||||
#include "t20002/test_case.h"
|
||||
|
||||
////
|
||||
//// Package diagram tests
|
||||
////
|
||||
//#include "t30001/test_case.h"
|
||||
//#include "t30002/test_case.h"
|
||||
//#include "t30003/test_case.h"
|
||||
//#include "t30004/test_case.h"
|
||||
//#include "t30005/test_case.h"
|
||||
//#include "t30006/test_case.h"
|
||||
//#include "t30007/test_case.h"
|
||||
//#include "t30008/test_case.h"
|
||||
//
|
||||
// Package diagram tests
|
||||
////
|
||||
//// Include diagram tests
|
||||
////
|
||||
//#include "t40001/test_case.h"
|
||||
//#include "t40002/test_case.h"
|
||||
//#include "t40003/test_case.h"
|
||||
//
|
||||
#include "t30001/test_case.h"
|
||||
#include "t30002/test_case.h"
|
||||
#include "t30003/test_case.h"
|
||||
#include "t30004/test_case.h"
|
||||
#include "t30005/test_case.h"
|
||||
#include "t30006/test_case.h"
|
||||
#include "t30007/test_case.h"
|
||||
#include "t30008/test_case.h"
|
||||
|
||||
//
|
||||
// Include diagram tests
|
||||
//
|
||||
#include "t40001/test_case.h"
|
||||
#include "t40002/test_case.h"
|
||||
#include "t40003/test_case.h"
|
||||
|
||||
//
|
||||
// Other tests (e.g. configuration file)
|
||||
//
|
||||
#include "t90000/test_case.h"
|
||||
////
|
||||
//// Other tests (e.g. configuration file)
|
||||
////
|
||||
//#include "t90000/test_case.h"
|
||||
|
||||
//
|
||||
// Main test function
|
||||
|
||||
Reference in New Issue
Block a user