Improved test coverage (#287)

This commit is contained in:
Bartek Kryza
2024-06-09 21:10:09 +02:00
parent 82846dcc27
commit 94f5f445ee
21 changed files with 252 additions and 83 deletions
+9
View File
@@ -68,12 +68,21 @@ TEST_CASE("Test compilation_database should work")
.make_preferred()
.string()));
REQUIRE_EQ(db->guess_language_from_filename("file.cpp"), "c++");
REQUIRE_EQ(db->guess_language_from_filename("file.cc"), "c++");
REQUIRE_EQ(db->guess_language_from_filename("file.c"), "c");
auto ccs = db->getAllCompileCommands();
REQUIRE(contains(ccs.at(0).CommandLine, "-Wno-error"));
REQUIRE(contains(ccs.at(0).CommandLine, "-Wno-unknown-warning-option"));
REQUIRE(
!contains(ccs.at(0).CommandLine, "-Wno-deprecated-declarations"));
REQUIRE_EQ(
db->count_matching_commands({"./src/class_diagram/model/class.cc"}),
1);
}
catch (clanguml::error::compilation_database_error &e) {
REQUIRE(false);