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 {
3636 const docs_step = b.step("docs", "Build documentation");
3737 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
4141 var test_stage2 = b.addTest("src/test.zig");
4242 test_stage2.setBuildMode(mode);
......@@ -90,7 +90,7 @@ pub fn build(b: *Builder) !void {
9090 exe.install();
9191 exe.setBuildMode(mode);
9292 exe.setTarget(target);
93 test_step.dependOn(&exe.step);
93 toolchain_step.dependOn(&exe.step);
9494 b.default_step.dependOn(&exe.step);
9595
9696 exe.addBuildOption(bool, "skip_non_native", skip_non_native);
......@@ -233,7 +233,7 @@ pub fn build(b: *Builder) !void {
233233 const test_stage2_step = b.step("test-stage2", "Run the stage2 compiler tests");
234234 test_stage2_step.dependOn(&test_stage2.step);
235235 if (!skip_stage2_tests) {
236 test_step.dependOn(test_stage2_step);
236 toolchain_step.dependOn(test_stage2_step);
237237 }
238238
239239 var chosen_modes: [4]builtin.Mode = undefined;
......@@ -257,33 +257,37 @@ pub fn build(b: *Builder) !void {
257257 const modes = chosen_modes[0..chosen_mode_index];
258258
259259 // 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);
261261 const fmt_step = b.step("test-fmt", "Run zig fmt against build.zig to make sure it works");
262262 fmt_step.dependOn(&fmt_build_zig.step);
263263
264264 // 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));
266
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));
268
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));
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));
271
272 test_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes));
273 test_step.dependOn(tests.addStandaloneTests(b, test_filter, modes));
274 test_step.dependOn(tests.addStackTraceTests(b, test_filter, modes));
275 test_step.dependOn(tests.addCliTests(b, test_filter, modes));
276 test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes));
277 test_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes));
278 test_step.dependOn(tests.addTranslateCTests(b, test_filter));
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));
266
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));
268 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
270 toolchain_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes));
271 toolchain_step.dependOn(tests.addStandaloneTests(b, test_filter, modes));
272 toolchain_step.dependOn(tests.addStackTraceTests(b, test_filter, modes));
273 toolchain_step.dependOn(tests.addCliTests(b, test_filter, modes));
274 toolchain_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes));
275 toolchain_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes));
276 toolchain_step.dependOn(tests.addTranslateCTests(b, test_filter));
279277 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));
281279 }
282280 // 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));
284282 if (!skip_compile_errors) {
285 test_step.dependOn(tests.addCompileErrorTests(b, test_filter, modes));
283 toolchain_step.dependOn(tests.addCompileErrorTests(b, test_filter, modes));
286284 }
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);
287291 test_step.dependOn(docs_step);
288292}
289293
ci/azure/linux_script+3-1
......@@ -65,7 +65,9 @@ make $JOBS install
6565cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig"
6666make $JOBS install
6767
68release/bin/zig build test -Denable-qemu -Denable-wasmtime
68for step in test-toolchain test-std docs; do
69 release/bin/zig build $step -Denable-qemu -Denable-wasmtime
70done
6971
7072# Look for HTML errors.
7173tidy -qe ../zig-cache/langref.html
ci/azure/macos_script+4-2
......@@ -18,7 +18,7 @@ tar xf "$CACHE_BASENAME.tar.xz"
1818
1919ZIG="$PREFIX/bin/zig"
2020NATIVE_LIBC_TXT="$HOME/native_libc.txt"
21$ZIG libc > "$NATIVE_LIBC_TXT"
21$ZIG libc >"$NATIVE_LIBC_TXT"
2222export ZIG_LIBC="$NATIVE_LIBC_TXT"
2323export CC="$ZIG cc"
2424export CXX="$ZIG c++"
......@@ -55,7 +55,9 @@ make $JOBS install
5555cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" -DZIG_TARGET_MCPU="x86_64_v2"
5656make $JOBS install
5757
58release/bin/zig build test
58for step in test-toolchain test-std docs; do
59 release/bin/zig build $step
60done
5961
6062if [ "${BUILD_REASON}" != "PullRequest" ]; then
6163 mv ../LICENSE release/
ci/azure/windows_msvc_script.bat+1-13
......@@ -26,20 +26,8 @@ cd %ZIGBUILDDIR%
2626cmake.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
2727msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b
2828
29"%ZIGINSTALLDIR%\bin\zig.exe" build test-behavior -Dskip-non-native || 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
29"%ZIGINSTALLDIR%\bin\zig.exe" build test-toolchain -Dskip-non-native -Dskip-stage2-tests || exit /b
3330"%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
4331"%ZIGINSTALLDIR%\bin\zig.exe" build docs || exit /b
4432
4533set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"