Fix Windows diagnostic paths and schema fixture timeout

This commit is contained in:
Emil
2026-09-24 02:19:09 +03:00
parent 4a434f7855
commit 77c145fa02
3 changed files with 14 additions and 4 deletions
+8 -1
View File
@@ -23,5 +23,12 @@ if(BUILD_TESTING)
target_link_libraries(faset_build_schema_tests PRIVATE faset_build_service faset_authoring faset_editor_commands)
add_dependencies(faset_build_schema_tests faset_build_schema_tool)
add_test(NAME build_schema_publication COMMAND faset_build_schema_tests $<TARGET_FILE:faset_build_schema_tool> ${PROJECT_SOURCE_DIR})
set_tests_properties(build_schema_publication PROPERTIES TIMEOUT 60)
# This fixture performs many full cache invalidations and process launches.
# Windows runner startup and antivirus overhead exceed 60 seconds even when
# individual native fixture commands finish normally.
if(WIN32)
set_tests_properties(build_schema_publication PROPERTIES TIMEOUT 240)
else()
set_tests_properties(build_schema_publication PROPERTIES TIMEOUT 60)
endif()
endif()
+4 -2
View File
@@ -28,7 +28,9 @@ std::string strip_ansi(std::string_view text) {
}
std::string normalize_path(std::string path) {
std::replace(path.begin(), path.end(), '\\', '/');
path = std::filesystem::path(path).lexically_normal().generic_string();
// Compiler output is UTF-8. Constructing a path from a narrow string on
// Windows can decode it through the process code page and lose Unicode.
path = generic_path_to_utf8(path_from_utf8(path).lexically_normal());
while (path.size() > 1 && path.back() == '/')
path.pop_back();
return path;
@@ -46,7 +48,7 @@ std::string project_source(std::string raw, const std::filesystem::path& project
if (raw.starts_with("lua: "))
raw.erase(0, 5);
std::replace(raw.begin(), raw.end(), '\\', '/');
for (const auto& component : std::filesystem::path(raw))
for (const auto& component : path_from_utf8(raw))
if (component == "..")
return {};
const auto path = normalize_path(std::move(raw));
+2 -1
View File
@@ -1,4 +1,5 @@
#include <faset/editor/build_diagnostics.hpp>
#include <faset/core/io.hpp>
#include <iostream>
#include <stdexcept>
@@ -25,7 +26,7 @@ void contracts() {
rows[0].at("line") == 6 && rows[0].at("severity") == "error" &&
rows[0].at("message") == "unexpected symbol near '='",
"Lua syntax error and ANSI stripping work");
const auto windows = fs::path(R"(C:\Café)");
const auto windows = path_from_utf8(R"(C:\Café)");
rows = editor::parse_build_diagnostics(
R"(C:\Café\Scripts\Game.cpp(17,4): error C2143: syntax error)" "\n"
R"(C:\Café\Scripts\Game.cpp:19:2: warning: suspicious conversion)" "\n",