1
Fork 0

preparing for aarch64 tests

nix
Motiejus Jakštys 2022-02-03 18:01:32 +02:00
parent 3e77c48662
commit 78a77ebbe5
1 changed files with 15 additions and 14 deletions

29
ci/test
View File

@ -8,22 +8,23 @@ _build_and_file() {
tee /dev/stderr
}
_test() {
_run() {
>&2 echo " $*"
"$@"
}
_build() {
local name=$1
local glob=$2
shift; shift;
>&2 echo "================================================================"
>&2 echo "Building everything under //test/... for $name"
>&2 echo
>&2 echo " bazel build --color=yes --curses=yes $* //test/..."
>&2 echo
bazel build --color=yes --curses=yes "$@" //test/...
_run bazel build --color=yes --curses=yes "$@" //test/...
>&2 echo
>&2 echo "Testing $name and looking for '$glob':"
>&2 echo
>&2 echo " bazel build $* //test/go:go"
>&2 echo
if _build_and_file "$@" //test/go:go | grep -q "$glob"; then
if _run _build_and_file "$@" //test/go:go | grep -q "$glob"; then
>&2 echo "OK $name"
return 0
else
@ -32,33 +33,33 @@ _test() {
fi
}
_test "Host" \
_build "Host" \
"ELF 64-bit.* x86-64.* dynamically linked"
_test "darwin_amd64" \
_build "darwin_amd64" \
"Mach-O 64-bit x86_64 executable" \
--platforms @zig_sdk//:darwin_amd64_platform
# hello world on darwin/arm64 requires OSX SDK via `zig cc --sysroot=<...>`.
# see https://github.com/ziglang/zig/issues/10299#issuecomment-989595215
#_test "darwin_arm64" \
#_build "darwin_arm64" \
# "Mach-O 64-bit arm64 executable" \
# --platforms @zig_sdk//:darwin_arm64_platform
_test "linux_amd64_gnu" \
_build "linux_amd64_gnu" \
"ELF 64-bit.* x86-64.* dynamically linked" \
--platforms @zig_sdk//:linux_amd64_platform
_test "linux_amd64_musl" \
_build "linux_amd64_musl" \
"ELF 64-bit.* x86-64.* statically linked" \
--platforms @zig_sdk//:linux_amd64_platform \
--extra_toolchains @zig_sdk//:linux_amd64_musl_toolchain
_test "linux_arm64_gnu" \
_build "linux_arm64_gnu" \
"ELF 64-bit.* ARM aarch64.* dynamically linked" \
--platforms @zig_sdk//:linux_arm64_platform
_test "linux_arm64_musl" \
_build "linux_arm64_musl" \
"ELF 64-bit.* ARM aarch64.* statically linked" \
--platforms @zig_sdk//:linux_arm64_platform \
--extra_toolchains @zig_sdk//:linux_arm64_musl_toolchain