authorgravatar for paul.verigo@gmail.comPavel Verigo <paul.verigo@gmail.com> 2026-08-16 19:01:56+02:00
committergravatar for paul.verigo@gmail.comPavel Verigo <paul.verigo@gmail.com> 2026-08-16 19:01:56+02:00
log23541774d6b01b1b614cc5aa3514295ce88917a5
tree0b7d80e49c600ad593e04baf2728ce339c4db7a8
parent99e540dc39ba45365eaa82db0459a0d7acc251eb

wasm: enable incremental tests for selfhosted

Closes #31810

3 files changed, 14 insertions(+), 7 deletions(-)

build.zig+1-1
......@@ -772,7 +772,7 @@ pub fn build(b: *std.Build) !void {
772772 }
773773
774774 const test_incremental_step = b.step("test-incremental", "Run the incremental compilation test cases");
775 try tests.addIncrementalTests(b, test_incremental_step, test_filters);
775 try tests.addIncrementalTests(b, test_incremental_step, test_filters, test_target_filters);
776776 if (!skip_test_incremental) test_step.dependOn(test_incremental_step);
777777
778778 if (tests.addLibcTestNszTests(b, .{
src/link/Wasm.zig-3
......@@ -3754,9 +3754,6 @@ pub fn updateExports(
37543754 const ip = &zcu.intern_pool;
37553755 const is_obj = wasm.base.comp.config.output_mode == .Obj;
37563756
3757 wasm.nav_exports.clearRetainingCapacity();
3758 wasm.uav_exports.clearRetainingCapacity();
3759
37603757 for (export_indices) |export_idx| {
37613758 const exp = export_idx.ptr(zcu);
37623759 const name_slice = exp.opts.name.toSlice(ip);
test/tests.zig+13-3
......@@ -2237,8 +2237,7 @@ const incremental_targets: []const []const u8 = &.{
22372237 "x86_64-linux-selfhosted",
22382238 // https://codeberg.org/ziglang/zig/issues/31773
22392239 //"x86_64-windows-selfhosted",
2240 // https://codeberg.org/ziglang/zig/issues/31810
2241 //"wasm32-wasi-selfhosted",
2240 "wasm32-wasi-selfhosted",
22422241};
22432242
22442243fn compatible32bitArch(host: *const std.Target) ?std.Target.Cpu.Arch {
......@@ -3248,7 +3247,12 @@ pub fn addDebuggerTests(b: *std.Build, options: DebuggerContext.Options) ?*Step
32483247 return step;
32493248}
32503249
3251pub fn addIncrementalTests(b: *std.Build, test_step: *Step, test_filters: []const []const u8) !void {
3250pub fn addIncrementalTests(
3251 b: *std.Build,
3252 test_step: *Step,
3253 test_filters: []const []const u8,
3254 test_target_filters: []const []const u8,
3255) !void {
32523256 const io = b.graph.io;
32533257
32543258 const incr_check = b.addExecutable(.{
......@@ -3283,6 +3287,12 @@ pub fn addIncrementalTests(b: *std.Build, test_step: *Step, test_filters: []cons
32833287 b.dependOnFileContents(b.path(b.pathJoin(&.{ "test", "incremental", entry.path })));
32843288
32853289 for (incremental_targets) |target_str| {
3290 if (test_target_filters.len > 0) {
3291 for (test_target_filters) |filter| {
3292 if (std.mem.find(u8, target_str, filter) != null) break;
3293 } else continue;
3294 }
3295
32863296 const run = b.addRunArtifact(incr_check);
32873297 run.setName(b.fmt("incr-check {s} '{s}'", .{ target_str, entry.basename }));
32883298