From 257054a1467b2612725bd66852d84496024cf66c Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Thu, 16 Jan 2025 20:01:58 -0500 Subject: [PATCH] Revert "disable flaky incremental compilation tests" This reverts commit 133abdeda2994886c3476a3faf53f8a911513b32 but keeps the tests disabled for the wasm target, which is the only configuration that seems to fail, even though the error looks like a frontend error. --- test/incremental/add_decl | 62 ++++++++++++++++++++++++++++ test/incremental/add_decl_namespaced | 62 ++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 test/incremental/add_decl create mode 100644 test/incremental/add_decl_namespaced diff --git a/test/incremental/add_decl b/test/incremental/add_decl new file mode 100644 index 0000000000..b842593056 --- /dev/null +++ b/test/incremental/add_decl @@ -0,0 +1,62 @@ +#target=x86_64-linux-selfhosted +#target=x86_64-linux-cbe +#target=x86_64-windows-cbe +//#target=wasm32-wasi-selfhosted +#update=initial version +#file=main.zig +const std = @import("std"); +pub fn main() !void { + try std.io.getStdOut().writeAll(foo); +} +const foo = "good morning\n"; +#expect_stdout="good morning\n" + +#update=add new declaration +#file=main.zig +const std = @import("std"); +pub fn main() !void { + try std.io.getStdOut().writeAll(foo); +} +const foo = "good morning\n"; +const bar = "good evening\n"; +#expect_stdout="good morning\n" + +#update=reference new declaration +#file=main.zig +const std = @import("std"); +pub fn main() !void { + try std.io.getStdOut().writeAll(bar); +} +const foo = "good morning\n"; +const bar = "good evening\n"; +#expect_stdout="good evening\n" + +#update=reference missing declaration +#file=main.zig +const std = @import("std"); +pub fn main() !void { + try std.io.getStdOut().writeAll(qux); +} +const foo = "good morning\n"; +const bar = "good evening\n"; +#expect_error=ignored + +#update=add missing declaration +#file=main.zig +const std = @import("std"); +pub fn main() !void { + try std.io.getStdOut().writeAll(qux); +} +const foo = "good morning\n"; +const bar = "good evening\n"; +const qux = "good night\n"; +#expect_stdout="good night\n" + +#update=remove unused declarations +#file=main.zig +const std = @import("std"); +pub fn main() !void { + try std.io.getStdOut().writeAll(qux); +} +const qux = "good night\n"; +#expect_stdout="good night\n" diff --git a/test/incremental/add_decl_namespaced b/test/incremental/add_decl_namespaced new file mode 100644 index 0000000000..a42e5600bc --- /dev/null +++ b/test/incremental/add_decl_namespaced @@ -0,0 +1,62 @@ +#target=x86_64-linux-selfhosted +#target=x86_64-linux-cbe +#target=x86_64-windows-cbe +//#target=wasm32-wasi-selfhosted +#update=initial version +#file=main.zig +const std = @import("std"); +pub fn main() !void { + try std.io.getStdOut().writeAll(@This().foo); +} +const foo = "good morning\n"; +#expect_stdout="good morning\n" + +#update=add new declaration +#file=main.zig +const std = @import("std"); +pub fn main() !void { + try std.io.getStdOut().writeAll(@This().foo); +} +const foo = "good morning\n"; +const bar = "good evening\n"; +#expect_stdout="good morning\n" + +#update=reference new declaration +#file=main.zig +const std = @import("std"); +pub fn main() !void { + try std.io.getStdOut().writeAll(@This().bar); +} +const foo = "good morning\n"; +const bar = "good evening\n"; +#expect_stdout="good evening\n" + +#update=reference missing declaration +#file=main.zig +const std = @import("std"); +pub fn main() !void { + try std.io.getStdOut().writeAll(@This().qux); +} +const foo = "good morning\n"; +const bar = "good evening\n"; +#expect_error=ignored + +#update=add missing declaration +#file=main.zig +const std = @import("std"); +pub fn main() !void { + try std.io.getStdOut().writeAll(@This().qux); +} +const foo = "good morning\n"; +const bar = "good evening\n"; +const qux = "good night\n"; +#expect_stdout="good night\n" + +#update=remove unused declarations +#file=main.zig +const std = @import("std"); +pub fn main() !void { + try std.io.getStdOut().writeAll(@This().qux); +} +const qux = "good night\n"; +#expect_stdout="good night\n"