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 {...@@ -1595,7 +1595,7 @@ pub const TestContext = struct {
1595 });1595 });
1596 defer comp.destroy();1596 defer comp.destroy();
15971597
1598 for (case.updates.items) |update, update_index| {1598 update: for (case.updates.items) |update, update_index| {
1599 var update_node = root_node.start(update.name, 3);1599 var update_node = root_node.start(update.name, 3);
1600 update_node.activate();1600 update_node.activate();
1601 defer update_node.end();1601 defer update_node.end();
...@@ -1803,7 +1803,7 @@ pub const TestContext = struct {...@@ -1803,7 +1803,7 @@ pub const TestContext = struct {
1803 .Execution => |expected_stdout| {1803 .Execution => |expected_stdout| {
1804 if (!std.process.can_spawn) {1804 if (!std.process.can_spawn) {
1805 print("Unable to spawn child processes on {s}, skipping test.\n", .{@tagName(builtin.os.tag)});1805 print("Unable to spawn child processes on {s}, skipping test.\n", .{@tagName(builtin.os.tag)});
1806 return; // Pass test.1806 continue :update; // Pass test.
1807 }1807 }
18081808
1809 update_node.setEstimatedTotalItems(4);1809 update_node.setEstimatedTotalItems(4);
...@@ -1829,7 +1829,7 @@ pub const TestContext = struct {...@@ -1829,7 +1829,7 @@ pub const TestContext = struct {
1829 if (case.object_format != null and case.object_format.? == .c) {1829 if (case.object_format != null and case.object_format.? == .c) {
1830 if (host.getExternalExecutor(target_info, .{ .link_libc = true }) != .native) {1830 if (host.getExternalExecutor(target_info, .{ .link_libc = true }) != .native) {
1831 // We wouldn't be able to run the compiled C code.1831 // We wouldn't be able to run the compiled C code.
1832 return; // Pass test.1832 continue :update; // Pass test.
1833 }1833 }
1834 try argv.appendSlice(&[_][]const u8{1834 try argv.appendSlice(&[_][]const u8{
1835 std.testing.zig_exe_path,1835 std.testing.zig_exe_path,
...@@ -1845,18 +1845,18 @@ pub const TestContext = struct {...@@ -1845,18 +1845,18 @@ pub const TestContext = struct {
1845 });1845 });
1846 } else switch (host.getExternalExecutor(target_info, .{ .link_libc = case.link_libc })) {1846 } else switch (host.getExternalExecutor(target_info, .{ .link_libc = case.link_libc })) {
1847 .native => try argv.append(exe_path),1847 .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
1850 .rosetta => if (enable_rosetta) {1850 .rosetta => if (enable_rosetta) {
1851 try argv.append(exe_path);1851 try argv.append(exe_path);
1852 } else {1852 } else {
1853 return; // Rosetta not available, pass test.1853 continue :update; // Rosetta not available, pass test.
1854 },1854 },
18551855
1856 .qemu => |qemu_bin_name| if (enable_qemu) {1856 .qemu => |qemu_bin_name| if (enable_qemu) {
1857 const need_cross_glibc = target.isGnuLibC() and case.link_libc;1857 const need_cross_glibc = target.isGnuLibC() and case.link_libc;
1858 const glibc_dir_arg = if (need_cross_glibc)1858 const glibc_dir_arg = if (need_cross_glibc)
1859 glibc_runtimes_dir orelse return // glibc dir not available; pass test1859 glibc_runtimes_dir orelse continue :update // glibc dir not available; pass test
1860 else1860 else
1861 null;1861 null;
1862 try argv.append(qemu_bin_name);1862 try argv.append(qemu_bin_name);
...@@ -1872,14 +1872,14 @@ pub const TestContext = struct {...@@ -1872,14 +1872,14 @@ pub const TestContext = struct {
1872 }1872 }
1873 try argv.append(exe_path);1873 try argv.append(exe_path);
1874 } else {1874 } else {
1875 return; // QEMU not available; pass test.1875 continue :update; // QEMU not available; pass test.
1876 },1876 },
18771877
1878 .wine => |wine_bin_name| if (enable_wine) {1878 .wine => |wine_bin_name| if (enable_wine) {
1879 try argv.append(wine_bin_name);1879 try argv.append(wine_bin_name);
1880 try argv.append(exe_path);1880 try argv.append(exe_path);
1881 } else {1881 } else {
1882 return; // Wine not available; pass test.1882 continue :update; // Wine not available; pass test.
1883 },1883 },
18841884
1885 .wasmtime => |wasmtime_bin_name| if (enable_wasmtime) {1885 .wasmtime => |wasmtime_bin_name| if (enable_wasmtime) {
...@@ -1887,7 +1887,7 @@ pub const TestContext = struct {...@@ -1887,7 +1887,7 @@ pub const TestContext = struct {
1887 try argv.append("--dir=.");1887 try argv.append("--dir=.");
1888 try argv.append(exe_path);1888 try argv.append(exe_path);
1889 } else {1889 } else {
1890 return; // wasmtime not available; pass test.1890 continue :update; // wasmtime not available; pass test.
1891 },1891 },
18921892
1893 .darling => |darling_bin_name| if (enable_darling) {1893 .darling => |darling_bin_name| if (enable_darling) {
...@@ -1897,7 +1897,7 @@ pub const TestContext = struct {...@@ -1897,7 +1897,7 @@ pub const TestContext = struct {
1897 try argv.append("shell");1897 try argv.append("shell");
1898 try argv.append(exe_path);1898 try argv.append(exe_path);
1899 } else {1899 } else {
1900 return; // Darling not available; pass test.1900 continue :update; // Darling not available; pass test.
1901 },1901 },
1902 }1902 }
19031903