test: make the Windows-hosted suite portable
VoidBuildSystem CI / 1 · Requirements (push) Successful in 8s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 2m30s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 1m51s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 3m21s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 3m38s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 5m4s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Failing after 30s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Failing after 33s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 1m2s
VoidBuildSystem CI / 4B · Windows package (debug) (push) Successful in 24s
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Successful in 39s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Successful in 5m42s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Successful in 5m30s
VoidBuildSystem CI / 4A · Linux package (debug) (push) Successful in 1m7s
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Successful in 1m10s
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Successful in 1m14s
VoidBuildSystem CI / 5 · Release (push) Skipped

- locate the vbs binary as vbs.exe on Windows (the .exe suffix was
  missing, so every test that spawns the CLI failed immediately);
- skip the POSIX permission-bit assertion on Windows (ACLs);
- skip the symlink checks when the host cannot create symlinks;
- skip compiler-spawning tests under Wine, which cannot execute the
  Linux-hosted compiler from a Windows process.
This commit is contained in:
faumaray committed 2026-12-06 08:09:38 +03:00
1 parent bd486c802c
commit adb7b4effe
4 files changed
+63 -9

No files matched your search

+34 -1
View File
@@ -20,6 +20,7 @@
#include <chrono>
#include <cstdint>
#include <cstdio>
#include <format>
#include <filesystem>
#include <stop_token>
@@ -27,8 +28,29 @@
#include <thread>
#include <unistd.h>
#if defined(_WIN32)
#include <cstdlib>
#include <windows.h>
#endif
using namespace Void::Build;
namespace {
// Compiler-spawning tests need a native host: under Wine a Windows process
// cannot execute the Linux-hosted MinGW compiler.
bool host_can_exec_compiler() {
#if defined(_WIN32)
if (std::getenv("WINEPREFIX") != nullptr) {
return false;
}
const HMODULE ntdll = ::GetModuleHandleW(L"ntdll.dll");
return ntdll == nullptr || ::GetProcAddress(ntdll, "wine_get_version") == nullptr;
#else
return true;
#endif
}
} // namespace
namespace {
void write_text_file(const std::filesystem::path &path, std::string_view content) {
@@ -234,7 +256,14 @@ VOID_TEST(CoreEngineTests, snapshot_content_mutations_symlinks_shadowing_and_iso
Void::Testing::expect(fresh3.has_value() && !*fresh3);
// 4. Symlink escape outside project root must be rejected.
std::filesystem::create_symlink(outside, proj / "src" / "escape.hpp");
// Symlink creation needs a filesystem/host that supports it (Wine does not).
std::error_code link_ec;
std::filesystem::create_symlink(outside, proj / "src" / "escape.hpp", link_ec);
if (link_ec) {
std::printf("snapshot: symlinks unavailable (%s); skipping symlink checks\n",
link_ec.message().c_str());
return;
}
auto esc_snap = Snapshot::capture_snapshot(opts, {proj / "src" / "escape.hpp"}, {});
Void::Testing::expect(!esc_snap.has_value());
@@ -311,6 +340,10 @@ VOID_TEST(CoreEngineTests, state_store_cas_corruption_recovery_and_gc) {
}
VOID_TEST(CoreEngineTests, end_to_end_native_frontend_graph_execution_and_archive_member_removal) {
if (!host_can_exec_compiler()) {
std::printf("end-to-end compile skipped: the host cannot execute a native compiler\n");
return;
}
Void::FileSystem::TempDir tmp{"vbs_e2e_"};
const auto proj = tmp / "app_proj";
const auto build_dir = tmp / "build";