diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-03-07 00:44:10 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-03-15 10:48:14 -0700 |
| commit | 4efeeaac881c5583321e8b385e90f004e99bc3d1 (patch) | |
| tree | 8b2abe47efb8fa7d68d44764f366543030b1118a /test/link/static_lib_as_system_lib | |
| parent | e122cd6312606068eb14987ed4d7527341484d26 (diff) | |
| download | zig-4efeeaac881c5583321e8b385e90f004e99bc3d1.tar.gz zig-4efeeaac881c5583321e8b385e90f004e99bc3d1.zip | |
delete link test "static_lib_as_system_lib"
I disagree with this behavior and will be reverting the changes
corresponding to this test case.
Also this test case unnecessarily uses a .c file when a .zig file would
be preferred, and has a problematic dependency on the install step,
preventing this test case from playing nicely with the cache.
Diffstat (limited to 'test/link/static_lib_as_system_lib')
| -rw-r--r-- | test/link/static_lib_as_system_lib/a.c | 4 | ||||
| -rw-r--r-- | test/link/static_lib_as_system_lib/a.h | 2 | ||||
| -rw-r--r-- | test/link/static_lib_as_system_lib/build.zig | 34 | ||||
| -rw-r--r-- | test/link/static_lib_as_system_lib/main.zig | 8 |
4 files changed, 0 insertions, 48 deletions
diff --git a/test/link/static_lib_as_system_lib/a.c b/test/link/static_lib_as_system_lib/a.c deleted file mode 100644 index ee9da97a3a..0000000000 --- a/test/link/static_lib_as_system_lib/a.c +++ /dev/null @@ -1,4 +0,0 @@ -#include "a.h" -int32_t add(int32_t a, int32_t b) { - return a + b; -} diff --git a/test/link/static_lib_as_system_lib/a.h b/test/link/static_lib_as_system_lib/a.h deleted file mode 100644 index 7b45d54d56..0000000000 --- a/test/link/static_lib_as_system_lib/a.h +++ /dev/null @@ -1,2 +0,0 @@ -#include <stdint.h> -int32_t add(int32_t a, int32_t b); diff --git a/test/link/static_lib_as_system_lib/build.zig b/test/link/static_lib_as_system_lib/build.zig deleted file mode 100644 index 1957d2e134..0000000000 --- a/test/link/static_lib_as_system_lib/build.zig +++ /dev/null @@ -1,34 +0,0 @@ -const std = @import("std"); - -pub fn build(b: *std.Build) void { - const test_step = b.step("test", "Test it"); - b.default_step = test_step; - - add(b, test_step, .Debug); - add(b, test_step, .ReleaseFast); - add(b, test_step, .ReleaseSmall); - add(b, test_step, .ReleaseSafe); -} - -fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void { - const lib_a = b.addStaticLibrary(.{ - .name = "a", - .optimize = optimize, - .target = .{}, - }); - lib_a.addCSourceFile("a.c", &[_][]const u8{}); - lib_a.addIncludePath("."); - lib_a.install(); - - const test_exe = b.addTest(.{ - .root_source_file = .{ .path = "main.zig" }, - .optimize = optimize, - .target = .{}, - }); - test_exe.linkSystemLibrary("a"); // force linking liba.a as -la - test_exe.addSystemIncludePath("."); - const search_path = std.fs.path.join(b.allocator, &[_][]const u8{ b.install_path, "lib" }) catch @panic("OOM"); - test_exe.addLibraryPath(search_path); - - test_step.dependOn(&test_exe.step); -} diff --git a/test/link/static_lib_as_system_lib/main.zig b/test/link/static_lib_as_system_lib/main.zig deleted file mode 100644 index 0b9c46217f..0000000000 --- a/test/link/static_lib_as_system_lib/main.zig +++ /dev/null @@ -1,8 +0,0 @@ -const std = @import("std"); -const expect = std.testing.expect; -const c = @cImport(@cInclude("a.h")); - -test "import C add" { - const result = c.add(2, 1); - try expect(result == 3); -} |
