authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-03 17:36:51-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2021-05-03 17:36:51-04:00
log5622f9382c4f54d6d2cc267590dda5352718ef60
tree9be333f36c30b7fdc3fd0a15bd09d61c0f5f62f4
parent97779442d0a551d96f2a0b1799e96944918af32e
parent9a637f81e021cacd8e38be6793a86b01ef735704
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #8657 from jedisct1/ci-split

Azure CI: Test std.* and the rest separately

4 files changed, 33 insertions(+), 37 deletions(-)

build.zig+25-21
...@@ -36,7 +36,7 @@ pub fn build(b: *Builder) !void {...@@ -36,7 +36,7 @@ pub fn build(b: *Builder) !void {
36 const docs_step = b.step("docs", "Build documentation");36 const docs_step = b.step("docs", "Build documentation");
37 docs_step.dependOn(&docgen_cmd.step);37 docs_step.dependOn(&docgen_cmd.step);
3838
39 const test_step = b.step("test", "Run all the tests");39 const toolchain_step = b.step("test-toolchain", "Run the tests for the toolchain");
4040
41 var test_stage2 = b.addTest("src/test.zig");41 var test_stage2 = b.addTest("src/test.zig");
42 test_stage2.setBuildMode(mode);42 test_stage2.setBuildMode(mode);
...@@ -90,7 +90,7 @@ pub fn build(b: *Builder) !void {...@@ -90,7 +90,7 @@ pub fn build(b: *Builder) !void {
90 exe.install();90 exe.install();
91 exe.setBuildMode(mode);91 exe.setBuildMode(mode);
92 exe.setTarget(target);92 exe.setTarget(target);
93 test_step.dependOn(&exe.step);93 toolchain_step.dependOn(&exe.step);
94 b.default_step.dependOn(&exe.step);94 b.default_step.dependOn(&exe.step);
9595
96 exe.addBuildOption(bool, "skip_non_native", skip_non_native);96 exe.addBuildOption(bool, "skip_non_native", skip_non_native);
...@@ -233,7 +233,7 @@ pub fn build(b: *Builder) !void {...@@ -233,7 +233,7 @@ pub fn build(b: *Builder) !void {
233 const test_stage2_step = b.step("test-stage2", "Run the stage2 compiler tests");233 const test_stage2_step = b.step("test-stage2", "Run the stage2 compiler tests");
234 test_stage2_step.dependOn(&test_stage2.step);234 test_stage2_step.dependOn(&test_stage2.step);
235 if (!skip_stage2_tests) {235 if (!skip_stage2_tests) {
236 test_step.dependOn(test_stage2_step);236 toolchain_step.dependOn(test_stage2_step);
237 }237 }
238238
239 var chosen_modes: [4]builtin.Mode = undefined;239 var chosen_modes: [4]builtin.Mode = undefined;
...@@ -257,33 +257,37 @@ pub fn build(b: *Builder) !void {...@@ -257,33 +257,37 @@ pub fn build(b: *Builder) !void {
257 const modes = chosen_modes[0..chosen_mode_index];257 const modes = chosen_modes[0..chosen_mode_index];
258258
259 // run stage1 `zig fmt` on this build.zig file just to make sure it works259 // run stage1 `zig fmt` on this build.zig file just to make sure it works
260 test_step.dependOn(&fmt_build_zig.step);260 toolchain_step.dependOn(&fmt_build_zig.step);
261 const fmt_step = b.step("test-fmt", "Run zig fmt against build.zig to make sure it works");261 const fmt_step = b.step("test-fmt", "Run zig fmt against build.zig to make sure it works");
262 fmt_step.dependOn(&fmt_build_zig.step);262 fmt_step.dependOn(&fmt_build_zig.step);
263263
264 // TODO for the moment, skip wasm32-wasi until bugs are sorted out.264 // TODO for the moment, skip wasm32-wasi until bugs are sorted out.
265 test_step.dependOn(tests.addPkgTests(b, test_filter, "test/stage1/behavior.zig", "behavior", "Run the behavior tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));265 toolchain_step.dependOn(tests.addPkgTests(b, test_filter, "test/stage1/behavior.zig", "behavior", "Run the behavior tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));
266266
267 test_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/std.zig", "std", "Run the standard library tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));267 toolchain_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/special/compiler_rt.zig", "compiler-rt", "Run the compiler_rt tests", modes, true, skip_non_native, true, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));
268268 toolchain_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/special/c.zig", "minilibc", "Run the mini libc tests", modes, true, skip_non_native, true, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));
269 test_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/special/compiler_rt.zig", "compiler-rt", "Run the compiler_rt tests", modes, true, skip_non_native, true, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));269
270 test_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/special/c.zig", "minilibc", "Run the mini libc tests", modes, true, skip_non_native, true, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));270 toolchain_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes));
271271 toolchain_step.dependOn(tests.addStandaloneTests(b, test_filter, modes));
272 test_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes));272 toolchain_step.dependOn(tests.addStackTraceTests(b, test_filter, modes));
273 test_step.dependOn(tests.addStandaloneTests(b, test_filter, modes));273 toolchain_step.dependOn(tests.addCliTests(b, test_filter, modes));
274 test_step.dependOn(tests.addStackTraceTests(b, test_filter, modes));274 toolchain_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes));
275 test_step.dependOn(tests.addCliTests(b, test_filter, modes));275 toolchain_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes));
276 test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes));276 toolchain_step.dependOn(tests.addTranslateCTests(b, test_filter));
277 test_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes));
278 test_step.dependOn(tests.addTranslateCTests(b, test_filter));
279 if (!skip_run_translated_c) {277 if (!skip_run_translated_c) {
280 test_step.dependOn(tests.addRunTranslatedCTests(b, test_filter, target));278 toolchain_step.dependOn(tests.addRunTranslatedCTests(b, test_filter, target));
281 }279 }
282 // tests for this feature are disabled until we have the self-hosted compiler available280 // tests for this feature are disabled until we have the self-hosted compiler available
283 // test_step.dependOn(tests.addGenHTests(b, test_filter));281 // toolchain_step.dependOn(tests.addGenHTests(b, test_filter));
284 if (!skip_compile_errors) {282 if (!skip_compile_errors) {
285 test_step.dependOn(tests.addCompileErrorTests(b, test_filter, modes));283 toolchain_step.dependOn(tests.addCompileErrorTests(b, test_filter, modes));
286 }284 }
285
286 const std_step = tests.addPkgTests(b, test_filter, "lib/std/std.zig", "std", "Run the standard library tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir);
287
288 const test_step = b.step("test", "Run all the tests");
289 test_step.dependOn(toolchain_step);
290 test_step.dependOn(std_step);
287 test_step.dependOn(docs_step);291 test_step.dependOn(docs_step);
288}292}
289293
ci/azure/linux_script+3-1
...@@ -65,7 +65,9 @@ make $JOBS install...@@ -65,7 +65,9 @@ make $JOBS install
65cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig"65cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig"
66make $JOBS install66make $JOBS install
6767
68release/bin/zig build test -Denable-qemu -Denable-wasmtime68for step in test-toolchain test-std docs; do
69 release/bin/zig build $step -Denable-qemu -Denable-wasmtime
70done
6971
70# Look for HTML errors.72# Look for HTML errors.
71tidy -qe ../zig-cache/langref.html73tidy -qe ../zig-cache/langref.html
ci/azure/macos_script+4-2
...@@ -18,7 +18,7 @@ tar xf "$CACHE_BASENAME.tar.xz"...@@ -18,7 +18,7 @@ tar xf "$CACHE_BASENAME.tar.xz"
1818
19ZIG="$PREFIX/bin/zig"19ZIG="$PREFIX/bin/zig"
20NATIVE_LIBC_TXT="$HOME/native_libc.txt"20NATIVE_LIBC_TXT="$HOME/native_libc.txt"
21$ZIG libc > "$NATIVE_LIBC_TXT"21$ZIG libc >"$NATIVE_LIBC_TXT"
22export ZIG_LIBC="$NATIVE_LIBC_TXT"22export ZIG_LIBC="$NATIVE_LIBC_TXT"
23export CC="$ZIG cc"23export CC="$ZIG cc"
24export CXX="$ZIG c++"24export CXX="$ZIG c++"
...@@ -55,7 +55,9 @@ make $JOBS install...@@ -55,7 +55,9 @@ make $JOBS install
55cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" -DZIG_TARGET_MCPU="x86_64_v2"55cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" -DZIG_TARGET_MCPU="x86_64_v2"
56make $JOBS install56make $JOBS install
5757
58release/bin/zig build test58for step in test-toolchain test-std docs; do
59 release/bin/zig build $step
60done
5961
60if [ "${BUILD_REASON}" != "PullRequest" ]; then62if [ "${BUILD_REASON}" != "PullRequest" ]; then
61 mv ../LICENSE release/63 mv ../LICENSE release/
ci/azure/windows_msvc_script.bat+1-13
...@@ -26,20 +26,8 @@ cd %ZIGBUILDDIR%...@@ -26,20 +26,8 @@ cd %ZIGBUILDDIR%
26cmake.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 /b26cmake.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
27msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b27msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b
2828
29"%ZIGINSTALLDIR%\bin\zig.exe" build test-behavior -Dskip-non-native || exit /b29"%ZIGINSTALLDIR%\bin\zig.exe" build test-toolchain -Dskip-non-native -Dskip-stage2-tests || exit /b
30REM Disabled to prevent OOM
31REM "%ZIGINSTALLDIR%\bin\zig.exe" build test-stage2 -Dskip-non-native || exit /b
32"%ZIGINSTALLDIR%\bin\zig.exe" build test-fmt -Dskip-non-native || exit /b
33"%ZIGINSTALLDIR%\bin\zig.exe" build test-std -Dskip-non-native || exit /b30"%ZIGINSTALLDIR%\bin\zig.exe" build test-std -Dskip-non-native || exit /b
34"%ZIGINSTALLDIR%\bin\zig.exe" build test-compiler-rt -Dskip-non-native || exit /b
35"%ZIGINSTALLDIR%\bin\zig.exe" build test-compare-output -Dskip-non-native || exit /b
36"%ZIGINSTALLDIR%\bin\zig.exe" build test-standalone -Dskip-non-native || exit /b
37"%ZIGINSTALLDIR%\bin\zig.exe" build test-stack-traces -Dskip-non-native || exit /b
38"%ZIGINSTALLDIR%\bin\zig.exe" build test-cli -Dskip-non-native || exit /b
39"%ZIGINSTALLDIR%\bin\zig.exe" build test-asm-link -Dskip-non-native || exit /b
40"%ZIGINSTALLDIR%\bin\zig.exe" build test-runtime-safety -Dskip-non-native || exit /b
41"%ZIGINSTALLDIR%\bin\zig.exe" build test-translate-c -Dskip-non-native || exit /b
42"%ZIGINSTALLDIR%\bin\zig.exe" build test-run-translated-c -Dskip-non-native || exit /b
43"%ZIGINSTALLDIR%\bin\zig.exe" build docs || exit /b31"%ZIGINSTALLDIR%\bin\zig.exe" build docs || exit /b
4432
45set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"33set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"