summaryrefslogtreecommitdiff
path: root/build/tests.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build/tests.zig')
-rw-r--r--build/tests.zig8
1 files changed, 5 insertions, 3 deletions
diff --git a/build/tests.zig b/build/tests.zig
index c35857f7..05bdc2b6 100644
--- a/build/tests.zig
+++ b/build/tests.zig
@@ -111,18 +111,20 @@ pub fn add(b: *std.Build, c: struct {
const session_options = b.addOptions();
session_options.addOptionPath("lspmock", c.lspmock.getEmittedBin());
var fake_addon_lib: ?*std.Build.Step.Compile = null;
- // The fake addon (addons/fake/fake.c) and three copies of it built
- // wrong, which the loader must refuse (test/behaviour/addons.zig).
+ // The fake addon (addons/fake/fake.c), copies of it built wrong, which
+ // the loader must refuse, and one whose head says ABI 3.3, which it
+ // takes (test/behaviour/addons.zig).
for ([_]struct { []const u8, []const u8 }{
.{ "fake_addon", "-DFAKE_PLAIN" },
.{ "fake_addon_abi", "-DFAKE_ABI=0x20002" },
.{ "fake_addon_no_export", "-DFAKE_NO_EXPORT" },
.{ "fake_addon_core_word", "-DFAKE_WORD=\"Save\"" },
.{ "fake_addon_no_dump", "-DFAKE_NO_DUMP" },
+ .{ "fake_addon_old", "-DFAKE_ABI=0x30003" },
}) |variant| {
const lib = b.addLibrary(.{ .name = variant[0], .linkage = .dynamic, .root_module = b.createModule(.{ .target = c.target, .optimize = c.optimize, .link_libc = true }) });
lib.root_module.addIncludePath(b.path("abi"));
- const name_flag = if (std.mem.eql(u8, variant[0], "fake_addon_abi")) "-DFAKE_NAME=\"fakeabi\"" else if (std.mem.eql(u8, variant[0], "fake_addon_core_word")) "-DFAKE_NAME=\"fakeword\"" else "-DFAKE_PLAIN";
+ const name_flag = if (std.mem.eql(u8, variant[0], "fake_addon_abi")) "-DFAKE_NAME=\"fakeabi\"" else if (std.mem.eql(u8, variant[0], "fake_addon_core_word")) "-DFAKE_NAME=\"fakeword\"" else if (std.mem.eql(u8, variant[0], "fake_addon_old")) "-DFAKE_NAME=\"fakeold\"" else "-DFAKE_PLAIN";
// The header is the whole contract: it compiles clean under every warning.
lib.root_module.addCSourceFile(.{ .file = b.path("addons/fake/fake.c"), .flags = &.{ "-std=c11", "-Wall", "-Wextra", "-Werror", "-Wno-override-init", variant[1], name_flag } });
session_options.addOptionPath(variant[0], lib.getEmittedBin());