| author | |
| committer | |
| log | 5c13a4e54a3ce814be02b75ef2029ceda6192bab |
| tree | 15ab62b5b0f9c615c188194ce981dc1c40106a39 |
| parent | c2de3bdc12885a456e4c616aa8043ab01ffecb11 |
3 files changed, 9 insertions(+), 2 deletions(-)
build.zig+1-1| ... | @@ -215,7 +215,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -215,7 +215,7 @@ pub fn build(b: *Builder) !void { |
| 215 | test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes)); | 215 | test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes)); |
| 216 | test_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes)); | 216 | test_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes)); |
| 217 | test_step.dependOn(tests.addTranslateCTests(b, test_filter)); | 217 | test_step.dependOn(tests.addTranslateCTests(b, test_filter)); |
| 218 | test_step.dependOn(tests.addRunTranslatedCTests(b, test_filter)); | 218 | test_step.dependOn(tests.addRunTranslatedCTests(b, test_filter, target)); |
| 219 | // tests for this feature are disabled until we have the self-hosted compiler available | 219 | // tests for this feature are disabled until we have the self-hosted compiler available |
| 220 | // test_step.dependOn(tests.addGenHTests(b, test_filter)); | 220 | // test_step.dependOn(tests.addGenHTests(b, test_filter)); |
| 221 | if (!skip_compile_errors) { | 221 | 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); |