diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2022-05-28 11:44:53 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2022-06-20 17:59:17 +0200 |
| commit | 38edef35bfcba5789ea50adc7c76dec504079812 (patch) | |
| tree | 66d7f7279a005a36c201cadd474b66035f5c1a44 /test/tests.zig | |
| parent | 74ed7c1f0998e9dd89aa3f3480fff845afd6b422 (diff) | |
| download | zig-38edef35bfcba5789ea50adc7c76dec504079812.tar.gz zig-38edef35bfcba5789ea50adc7c76dec504079812.zip | |
test: introduce link(er) tests - builds on standalone tests
Diffstat (limited to 'test/tests.zig')
| -rw-r--r-- | test/tests.zig | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/tests.zig b/test/tests.zig index 3666ef1028..8bc415d28b 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -21,6 +21,7 @@ const assemble_and_link = @import("assemble_and_link.zig"); const translate_c = @import("translate_c.zig"); const run_translated_c = @import("run_translated_c.zig"); const gen_h = @import("gen_h.zig"); +const link = @import("link.zig"); // Implementations pub const TranslateCContext = @import("src/translate_c.zig").TranslateCContext; @@ -479,6 +480,27 @@ pub fn addStandaloneTests( return cases.step; } +pub fn addLinkTests( + b: *build.Builder, + test_filter: ?[]const u8, + modes: []const Mode, + enable_macos_sdk: bool, +) *build.Step { + const cases = b.allocator.create(StandaloneContext) catch unreachable; + cases.* = StandaloneContext{ + .b = b, + .step = b.step("test-link", "Run the linker tests"), + .test_index = 0, + .test_filter = test_filter, + .modes = modes, + .skip_non_native = true, + .enable_macos_sdk = enable_macos_sdk, + .target = .{}, + }; + link.addCases(cases); + return cases.step; +} + pub fn addCliTests(b: *build.Builder, test_filter: ?[]const u8, modes: []const Mode) *build.Step { _ = test_filter; _ = modes; |
