From c47b46fc8dcb24a9af8e28d169d93170fce0e061 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 27 Jul 2021 17:16:26 -0700 Subject: [PATCH] CI: enable stage2 behavior test coverage --- ci/azure/linux_script | 8 +++++--- ci/azure/macos_script | 9 ++++++--- ci/azure/windows_msvc_script.bat | 4 ++++ ci/srht/freebsd_script | 5 +++++ ci/srht/netbsd_script | 5 +++++ 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/ci/azure/linux_script b/ci/azure/linux_script index 33ad349044..dac7bac614 100755 --- a/ci/azure/linux_script +++ b/ci/azure/linux_script @@ -69,9 +69,11 @@ release/bin/zig fmt --check .. cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" make $JOBS install -for step in test-toolchain test-std docs; do - release/bin/zig build $step -Denable-qemu -Denable-wasmtime -done +release/bin/zig test ../test/behavior.zig -fno-stage1 -fLLVM -I ../test + +release/bin/zig build test-toolchain -Denable-qemu -Denable-wasmtime +release/bin/zig build test-std -Denable-qemu -Denable-wasmtime +release/bin/zig build docs -Denable-qemu -Denable-wasmtime # Look for HTML errors. tidy -qe ../zig-cache/langref.html diff --git a/ci/azure/macos_script b/ci/azure/macos_script index 4afaedfa12..01ac3f5838 100755 --- a/ci/azure/macos_script +++ b/ci/azure/macos_script @@ -54,9 +54,12 @@ make $JOBS install cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" make $JOBS install -for step in test-toolchain test-std docs; do - release/bin/zig build $step -done +# TODO figure out why this causes a segmentation fault +# release/bin/zig test ../test/behavior.zig -fno-stage1 -fLLVM -I ../test + +release/bin/zig build test-toolchain +release/bin/zig build test-std +release/bin/zig build docs if [ "${BUILD_REASON}" != "PullRequest" ]; then mv ../LICENSE release/ diff --git a/ci/azure/windows_msvc_script.bat b/ci/azure/windows_msvc_script.bat index df1b63b485..a073650717 100644 --- a/ci/azure/windows_msvc_script.bat +++ b/ci/azure/windows_msvc_script.bat @@ -26,6 +26,10 @@ cd %ZIGBUILDDIR% cmake.exe .. -Thost=x64 -G"Visual Studio 16 2019" -A x64 "-DCMAKE_INSTALL_PREFIX=%ZIGINSTALLDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release -DZIG_OMIT_STAGE2=ON || exit /b msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b +REM Sadly, stage2 is omitted from this build to save memory on the CI server. Once self-hosted is +REM built with itself and does not gobble as much memory, we can enable these tests. +REM "%ZIGINSTALLDIR%\bin\zig.exe" test "..\test\behavior.zig" -fno-stage1 -fLLVM -I "..\test" || exit /b + "%ZIGINSTALLDIR%\bin\zig.exe" build test-toolchain -Dskip-non-native -Dskip-stage2-tests || exit /b "%ZIGINSTALLDIR%\bin\zig.exe" build test-std -Dskip-non-native || exit /b "%ZIGINSTALLDIR%\bin\zig.exe" build docs || exit /b diff --git a/ci/srht/freebsd_script b/ci/srht/freebsd_script index 44b0330542..27c7df4933 100755 --- a/ci/srht/freebsd_script +++ b/ci/srht/freebsd_script @@ -38,6 +38,11 @@ cmake .. \ -GNinja samu install +# TODO ld.lld: error: undefined symbol: main +# >>> referenced by crt1_c.c:75 (/usr/src/lib/csu/amd64/crt1_c.c:75) +# >>> /usr/lib/crt1.o:(_start) +#release/bin/zig test ../test/behavior.zig -fno-stage1 -fLLVM -I ../test + # Here we skip some tests to save time. release/bin/zig build test -Dskip-compile-errors -Dskip-non-native diff --git a/ci/srht/netbsd_script b/ci/srht/netbsd_script index 508da4b324..f2d2f09467 100755 --- a/ci/srht/netbsd_script +++ b/ci/srht/netbsd_script @@ -51,6 +51,11 @@ samu install unset CC unset CXX +# TODO ld.lld: error: undefined symbol: main +#>>> referenced by crt0-common.c +#>>> /usr/lib/crt0.o:(___start) +#release/bin/zig test ../test/behavior.zig -fno-stage1 -fLLVM -I ../test + # Here we skip some tests to save time. release/bin/zig build test -Dskip-compile-errors -Dskip-non-native