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
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:
1 parent
bd486c802c
commit
adb7b4effe
4 files changed
+63
-9
No files matched your search
@@ -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";
|
||||
|
||||
+13
-4
@@ -94,14 +94,23 @@ void write_raw_tar(const std::filesystem::path &tar_path,
|
||||
|
||||
std::filesystem::path locate_vbs_binary() {
|
||||
std::error_code ec;
|
||||
// Windows executables carry the .exe suffix.
|
||||
const auto find_in = [&ec](const std::filesystem::path &dir) -> std::filesystem::path {
|
||||
for (const auto *name : {"vbs", "vbs.exe"}) {
|
||||
const auto candidate = dir / name;
|
||||
if (std::filesystem::exists(candidate, ec)) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
};
|
||||
if (const auto self_exe = Platform::current_executable_path(); self_exe) {
|
||||
const auto sibling = self_exe->parent_path() / "vbs";
|
||||
if (std::filesystem::exists(sibling, ec)) {
|
||||
return sibling;
|
||||
if (auto found = find_in(self_exe->parent_path()); !found.empty()) {
|
||||
return found;
|
||||
}
|
||||
}
|
||||
if (!Bootstrap::binary_dir.empty()) {
|
||||
return std::filesystem::path{Bootstrap::binary_dir} / "bin" / "vbs";
|
||||
return find_in(std::filesystem::path{Bootstrap::binary_dir} / "bin");
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
+13
-4
@@ -43,14 +43,23 @@ std::filesystem::path locate_void_source_dir() {
|
||||
|
||||
std::filesystem::path locate_vbs_binary() {
|
||||
std::error_code ec;
|
||||
// Windows executables carry the .exe suffix.
|
||||
const auto find_in = [&ec](const std::filesystem::path &dir) -> std::filesystem::path {
|
||||
for (const auto *name : {"vbs", "vbs.exe"}) {
|
||||
const auto candidate = dir / name;
|
||||
if (std::filesystem::exists(candidate, ec)) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
};
|
||||
if (const auto self_exe = Platform::current_executable_path(); self_exe) {
|
||||
const auto sibling = self_exe->parent_path() / "vbs";
|
||||
if (std::filesystem::exists(sibling, ec)) {
|
||||
return sibling;
|
||||
if (auto found = find_in(self_exe->parent_path()); !found.empty()) {
|
||||
return found;
|
||||
}
|
||||
}
|
||||
if (!Bootstrap::binary_dir.empty()) {
|
||||
return std::filesystem::path{Bootstrap::binary_dir} / "bin" / "vbs";
|
||||
return find_in(std::filesystem::path{Bootstrap::binary_dir} / "bin");
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -84,7 +84,10 @@ VOID_TEST(Signing, seed_roundtrip_sign_verify_and_rejections) {
|
||||
const auto permissions = std::filesystem::status(seed_path).permissions();
|
||||
Void::Testing::expect((permissions & Perms::owner_read) != Perms::none);
|
||||
Void::Testing::expect((permissions & Perms::owner_write) != Perms::none);
|
||||
#if !defined(_WIN32)
|
||||
// Windows filesystem permissions are ACL-based and not exposed as POSIX bits.
|
||||
Void::Testing::expect((permissions & (Perms::group_all | Perms::others_all)) == Perms::none);
|
||||
#endif
|
||||
|
||||
auto public_key = Provenance::public_key_from_seed(seed_path);
|
||||
Void::Testing::require(public_key.has_value());
|
||||
|
||||
Reference in new issue
Block a user