| author | |
| committer | |
| log | 58c8ad8ea8698807934cdd05df821d39499a9ab6 |
| tree | 9a1b9561e1abd109fdda2ab4fcfcab77855fefc9 |
| parent | 24cbf1c70679ee81d45fb7a8ba5c48fdb77cbd5c |
3 files changed, 9 insertions(+), 2 deletions(-)
build.zig+1-1| ... | ... | @@ -335,7 +335,7 @@ pub fn build(b: *Builder) !void { |
| 335 | 335 | test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes)); |
| 336 | 336 | test_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes)); |
| 337 | 337 | test_step.dependOn(tests.addTranslateCTests(b, test_filter)); |
| 338 | test_step.dependOn(tests.addRunTranslatedCTests(b, test_filter)); | |
| 338 | test_step.dependOn(tests.addRunTranslatedCTests(b, test_filter, target)); | |
| 339 | 339 | // tests for this feature are disabled until we have the self-hosted compiler available |
| 340 | 340 | // test_step.dependOn(tests.addGenHTests(b, test_filter)); |
| 341 | 341 | if (!skip_compile_errors) { |
test/src/run_translated_c.zig+2| ... | ... | @@ -13,6 +13,7 @@ pub const RunTranslatedCContext = struct { |
| 13 | 13 | step: *build.Step, |
| 14 | 14 | test_index: usize, |
| 15 | 15 | test_filter: ?[]const u8, |
| 16 | target: std.zig.CrossTarget, | |
| 16 | 17 | |
| 17 | 18 | const TestCase = struct { |
| 18 | 19 | name: []const u8, |
| ... | ... | @@ -93,6 +94,7 @@ pub const RunTranslatedCContext = struct { |
| 93 | 94 | }); |
| 94 | 95 | translate_c.step.name = b.fmt("{} translate-c", .{annotated_case_name}); |
| 95 | 96 | const exe = translate_c.addExecutable(); |
| 97 | exe.setTarget(self.target); | |
| 96 | 98 | exe.step.name = b.fmt("{} build-exe", .{annotated_case_name}); |
| 97 | 99 | exe.linkLibC(); |
| 98 | 100 | const run = exe.run(); |
test/tests.zig+6-1| ... | ... | @@ -434,13 +434,18 @@ pub fn addTranslateCTests(b: *build.Builder, test_filter: ?[]const u8) *build.St |
| 434 | 434 | return cases.step; |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | pub fn addRunTranslatedCTests(b: *build.Builder, test_filter: ?[]const u8) *build.Step { | |
| 437 | pub fn addRunTranslatedCTests( | |
| 438 | b: *build.Builder, | |
| 439 | test_filter: ?[]const u8, | |
| 440 | target: std.zig.CrossTarget, | |
| 441 | ) *build.Step { | |
| 438 | 442 | const cases = b.allocator.create(RunTranslatedCContext) catch unreachable; |
| 439 | 443 | cases.* = .{ |
| 440 | 444 | .b = b, |
| 441 | 445 | .step = b.step("test-run-translated-c", "Run the Run-Translated-C tests"), |
| 442 | 446 | .test_index = 0, |
| 443 | 447 | .test_filter = test_filter, |
| 448 | .target = target, | |
| 444 | 449 | }; |
| 445 | 450 | |
| 446 | 451 | run_translated_c.addCases(cases); |