diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-01-02 22:45:48 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-01-03 00:26:12 -0500 |
| commit | 695c8f756b7ef12c4e8993720503b9c6d2242689 (patch) | |
| tree | 477bd6c3482558abbd26a4844500067af9b3d317 /test/tests.zig | |
| parent | f83411b0b1b857c7f8679e3b90d2093ba60621d4 (diff) | |
| download | zig-695c8f756b7ef12c4e8993720503b9c6d2242689.tar.gz zig-695c8f756b7ef12c4e8993720503b9c6d2242689.zip | |
add test harness for "run translated C" tests
Diffstat (limited to 'test/tests.zig')
| -rw-r--r-- | test/tests.zig | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/tests.zig b/test/tests.zig index 4672359802..4636eb8132 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -14,6 +14,7 @@ const builtin = @import("builtin"); const Mode = builtin.Mode; const LibExeObjStep = build.LibExeObjStep; +// Cases const compare_output = @import("compare_output.zig"); const standalone = @import("standalone.zig"); const stack_traces = @import("stack_traces.zig"); @@ -21,8 +22,12 @@ const compile_errors = @import("compile_errors.zig"); const assemble_and_link = @import("assemble_and_link.zig"); const runtime_safety = @import("runtime_safety.zig"); const translate_c = @import("translate_c.zig"); +const run_translated_c = @import("run_translated_c.zig"); const gen_h = @import("gen_h.zig"); +// Implementations +pub const RunTranslatedCContext = @import("src/run_translated_c.zig").RunTranslatedCContext; + const TestTarget = struct { target: Target = .Native, mode: builtin.Mode = .Debug, @@ -383,6 +388,20 @@ pub fn addTranslateCTests(b: *build.Builder, test_filter: ?[]const u8) *build.St return cases.step; } +pub fn addRunTranslatedCTests(b: *build.Builder, test_filter: ?[]const u8) *build.Step { + const cases = b.allocator.create(RunTranslatedCContext) catch unreachable; + cases.* = .{ + .b = b, + .step = b.step("test-run-translated-c", "Run the Run-Translated-C tests"), + .test_index = 0, + .test_filter = test_filter, + }; + + run_translated_c.addCases(cases); + + return cases.step; +} + pub fn addGenHTests(b: *build.Builder, test_filter: ?[]const u8) *build.Step { const cases = b.allocator.create(GenHContext) catch unreachable; cases.* = GenHContext{ |
