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