Added handling of query-driver target and using default driver for '.'
This commit is contained in:
@@ -39,6 +39,7 @@ TEST_CASE("Test compilation_database should work", "[unit-test]")
|
||||
using clanguml::common::model::access_t;
|
||||
using clanguml::common::model::relationship_t;
|
||||
using clanguml::util::contains;
|
||||
using std::filesystem::path;
|
||||
|
||||
auto cfg =
|
||||
clanguml::config::load("./test_compilation_database_data/config.yml");
|
||||
@@ -51,12 +52,19 @@ TEST_CASE("Test compilation_database should work", "[unit-test]")
|
||||
auto all_files = db->getAllFiles();
|
||||
|
||||
REQUIRE(all_files.size() == 3);
|
||||
REQUIRE(all_files.at(0) ==
|
||||
"src/class_diagram/generators/json/class_diagram_generator.cc");
|
||||
REQUIRE(all_files.at(1) ==
|
||||
"src/class_diagram/generators/plantuml/"
|
||||
"class_diagram_generator.cc");
|
||||
REQUIRE(all_files.at(2) == "src/class_diagram/model/class.cc");
|
||||
REQUIRE(contains(all_files,
|
||||
path("src/class_diagram/generators/json/class_diagram_generator.cc")
|
||||
.make_preferred()
|
||||
.string()));
|
||||
REQUIRE(contains(all_files,
|
||||
path("src/class_diagram/generators/plantuml/"
|
||||
"class_diagram_generator.cc")
|
||||
.make_preferred()
|
||||
.string()));
|
||||
REQUIRE(contains(all_files,
|
||||
path("src/class_diagram/model/class.cc")
|
||||
.make_preferred()
|
||||
.string()));
|
||||
|
||||
auto ccs = db->getAllCompileCommands();
|
||||
|
||||
|
||||
@@ -61,9 +61,13 @@ COLLECT_GCC_OPTIONS='-E' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
|
||||
|
||||
extractor.extract_system_include_paths(output);
|
||||
|
||||
extractor.extract_target(output);
|
||||
|
||||
std::vector<std::string> expected = {
|
||||
"/usr/lib/gcc/x86_64-linux-gnu/11/include", "/usr/local/include",
|
||||
"/usr/include/x86_64-linux-gnu", "/usr/include"};
|
||||
|
||||
REQUIRE(extractor.system_include_paths() == expected);
|
||||
|
||||
REQUIRE(extractor.target() == "x86_64-linux-gnu");
|
||||
}
|
||||
Reference in New Issue
Block a user