authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-26 13:28:46-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-26 13:28:46-07:00
logf50c98a75a7d263cf74ade18f1ad76292d37598a
treec6782193f2c67fa6c363c4dab49333557c25cebf
parent7a09bce2328e79a5f24ca207974287a4fba546bd

test-cases harness: test all updates

even if some are "run" on foreign hosts. closes #12193

1 files changed, 10 insertions(+), 10 deletions(-)

src/test.zig+10-10
......@@ -1595,7 +1595,7 @@ pub const TestContext = struct {
15951595 });
15961596 defer comp.destroy();
15971597
1598 for (case.updates.items) |update, update_index| {
1598 update: for (case.updates.items) |update, update_index| {
15991599 var update_node = root_node.start(update.name, 3);
16001600 update_node.activate();
16011601 defer update_node.end();
......@@ -1803,7 +1803,7 @@ pub const TestContext = struct {
18031803 .Execution => |expected_stdout| {
18041804 if (!std.process.can_spawn) {
18051805 print("Unable to spawn child processes on {s}, skipping test.\n", .{@tagName(builtin.os.tag)});
1806 return; // Pass test.
1806 continue :update; // Pass test.
18071807 }
18081808
18091809 update_node.setEstimatedTotalItems(4);
......@@ -1829,7 +1829,7 @@ pub const TestContext = struct {
18291829 if (case.object_format != null and case.object_format.? == .c) {
18301830 if (host.getExternalExecutor(target_info, .{ .link_libc = true }) != .native) {
18311831 // We wouldn't be able to run the compiled C code.
1832 return; // Pass test.
1832 continue :update; // Pass test.
18331833 }
18341834 try argv.appendSlice(&[_][]const u8{
18351835 std.testing.zig_exe_path,
......@@ -1845,18 +1845,18 @@ pub const TestContext = struct {
18451845 });
18461846 } else switch (host.getExternalExecutor(target_info, .{ .link_libc = case.link_libc })) {
18471847 .native => try argv.append(exe_path),
1848 .bad_dl, .bad_os_or_cpu => return, // Pass test.
1848 .bad_dl, .bad_os_or_cpu => continue :update, // Pass test.
18491849
18501850 .rosetta => if (enable_rosetta) {
18511851 try argv.append(exe_path);
18521852 } else {
1853 return; // Rosetta not available, pass test.
1853 continue :update; // Rosetta not available, pass test.
18541854 },
18551855
18561856 .qemu => |qemu_bin_name| if (enable_qemu) {
18571857 const need_cross_glibc = target.isGnuLibC() and case.link_libc;
18581858 const glibc_dir_arg = if (need_cross_glibc)
1859 glibc_runtimes_dir orelse return // glibc dir not available; pass test
1859 glibc_runtimes_dir orelse continue :update // glibc dir not available; pass test
18601860 else
18611861 null;
18621862 try argv.append(qemu_bin_name);
......@@ -1872,14 +1872,14 @@ pub const TestContext = struct {
18721872 }
18731873 try argv.append(exe_path);
18741874 } else {
1875 return; // QEMU not available; pass test.
1875 continue :update; // QEMU not available; pass test.
18761876 },
18771877
18781878 .wine => |wine_bin_name| if (enable_wine) {
18791879 try argv.append(wine_bin_name);
18801880 try argv.append(exe_path);
18811881 } else {
1882 return; // Wine not available; pass test.
1882 continue :update; // Wine not available; pass test.
18831883 },
18841884
18851885 .wasmtime => |wasmtime_bin_name| if (enable_wasmtime) {
......@@ -1887,7 +1887,7 @@ pub const TestContext = struct {
18871887 try argv.append("--dir=.");
18881888 try argv.append(exe_path);
18891889 } else {
1890 return; // wasmtime not available; pass test.
1890 continue :update; // wasmtime not available; pass test.
18911891 },
18921892
18931893 .darling => |darling_bin_name| if (enable_darling) {
......@@ -1897,7 +1897,7 @@ pub const TestContext = struct {
18971897 try argv.append("shell");
18981898 try argv.append(exe_path);
18991899 } else {
1900 return; // Darling not available; pass test.
1900 continue :update; // Darling not available; pass test.
19011901 },
19021902 }
19031903