1

windows tests: move tests, get rid of wine-binfmt

This removes all other Bazel test commands, so all tests can be again
tested with `bazel test ...`.

Also, fixes linux-arm64 glibc tests. Until now they've worked only in
CI. Now they work everywhere I tried.
This commit is contained in:
Motiejus Jakštys
2022-06-02 08:46:16 +03:00
committed by Motiejus Jakštys
parent 86ae317685
commit 3ac217e2cc
8 changed files with 63 additions and 53 deletions

21
test/windows/BUILD Normal file
View File

@@ -0,0 +1,21 @@
load("@bazel-zig-cc//rules:platform.bzl", "platform_binary", "platform_test")
cc_binary(
name = "winver",
srcs = ["main.c"],
tags = ["manual"],
)
platform_test(
name = "winver_windows_amd64",
src = "winver",
platform = "//platform:windows_amd64",
run_under = "wine64-stable",
tags = ["no-sandbox"],
)
platform_binary(
name = "winver_windows_arm64",
src = "winver",
platform = "//platform:windows_arm64",
)

16
test/windows/main.c Normal file
View File

@@ -0,0 +1,16 @@
#include <stdio.h>
#include <windows.h>
int main() {
DWORD version = GetVersion();
DWORD majorVersion = (DWORD)(LOBYTE(LOWORD(version)));
DWORD minorVersion = (DWORD)(HIBYTE(LOWORD(version)));
DWORD build = 0;
if (version < 0x80000000) {
build = (DWORD)(HIWORD(version));
}
printf("Running Windows version %d.%d (%d).\n", majorVersion, minorVersion, build);
return 0;
}