diff --git a/packaging/make_installer.ps1 b/packaging/make_installer.ps1 index 6e364cfe..0ce4c409 100644 --- a/packaging/make_installer.ps1 +++ b/packaging/make_installer.ps1 @@ -1,6 +1,6 @@ # This script assumes that all clang-uml dependencies are instaled in C:\clang-uml -param ($Prefix="C:\clang-uml-llvm17", $BuildType="Release") +param ($Prefix="C:\clang-uml-llvm18", $BuildType="Release") mkdir _BUILD diff --git a/src/include_diagram/visitor/translation_unit_visitor.cc b/src/include_diagram/visitor/translation_unit_visitor.cc index 3e83df8e..53483b18 100644 --- a/src/include_diagram/visitor/translation_unit_visitor.cc +++ b/src/include_diagram/visitor/translation_unit_visitor.cc @@ -83,8 +83,12 @@ void translation_unit_visitor::include_visitor::InclusionDirective( assert(diagram().get(current_file_id.value())); #if LLVM_VERSION_MAJOR > 14 + if (!file.has_value()) + return; auto include_path = std::filesystem::path(file->getDir().getName().str()); #else + if (file == nullptr) + return; auto include_path = std::filesystem::path(file->getDir()->getName().str()); #endif include_path = include_path / file->getName().str(); diff --git a/tests/t00037/t00037.cc b/tests/t00037/t00037.cc index 69333109..390f4904 100644 --- a/tests/t00037/t00037.cc +++ b/tests/t00037/t00037.cc @@ -20,7 +20,11 @@ public: struct { int len; int flags; - } __attribute__((packed)) bars[LENGTH]; + } +#ifndef _MSC_VER + __attribute__((packed)) +#endif + bars[LENGTH]; private: struct { diff --git a/tests/test_progress_indicator.cc b/tests/test_progress_indicator.cc index f2078dcb..6b23750a 100644 --- a/tests/test_progress_indicator.cc +++ b/tests/test_progress_indicator.cc @@ -26,6 +26,7 @@ TEST_CASE("Test progress indicator") { using namespace clanguml::common::generators; using namespace std::string_literals; + using clanguml::util::contains; std::stringstream sstr; @@ -46,7 +47,19 @@ TEST_CASE("Test progress indicator") output_lines.emplace_back(std::move(line)); REQUIRE_EQ(output_lines[0], ""); +#ifdef _MSC_VER + REQUIRE(contains(output_lines[1], + "One [>----------------------------------] " + "[00:00s] 0/100"s)); + REQUIRE(contains(output_lines[2], + "One [>----------------------------------] " + "[00m:00s] 1/100"s)); + + REQUIRE(contains(output_lines[3], + "One [===================================] " + "[00m:00s] 100/100 OK"s)); +#else REQUIRE_EQ(output_lines[1], "One [█----------------------------------] " "[00:00s] 0/100"); @@ -58,12 +71,14 @@ TEST_CASE("Test progress indicator") REQUIRE_EQ(output_lines[3], "One [███████████████████████████████████] " "[00m:00s] 100/100 ✔"); +#endif } TEST_CASE("Test progress indicator fail") { using namespace clanguml::common::generators; using namespace std::string_literals; + using clanguml::util::contains; std::stringstream sstr; @@ -91,6 +106,19 @@ TEST_CASE("Test progress indicator fail") REQUIRE_EQ(output_lines[0], ""); +#ifdef _MSC_VER + REQUIRE(contains(output_lines[1], + "One [>----------------------------------] " + "[00:00s] 0/100"s)); + + REQUIRE(contains(output_lines[2], + "One [>----------------------------------] " + "[00m:00s] 1/100"s)); + + REQUIRE(contains(output_lines[3], + "One [>----------------------------------] " + "[00m:00s] 1/100 FAILED"s)); +#else REQUIRE_EQ(output_lines[1], "One [█----------------------------------] " "[00:00s] 0/100"); @@ -102,4 +130,5 @@ TEST_CASE("Test progress indicator fail") REQUIRE_EQ(output_lines[3], "One [█----------------------------------] " "[00m:00s] 1/100 ✗"); +#endif } \ No newline at end of file