aboutsummaryrefslogtreecommitdiff
path: root/test/tests.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/tests.zig')
-rw-r--r--test/tests.zig23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/tests.zig b/test/tests.zig
index 081136ccad..f8d9df990f 100644
--- a/test/tests.zig
+++ b/test/tests.zig
@@ -1604,6 +1604,16 @@ pub const TranslateCContext = struct {
self.addCase(tc);
}
+ pub fn addC(
+ self: *TranslateCContext,
+ name: []const u8,
+ source: []const u8,
+ expected_lines: []const []const u8,
+ ) void {
+ const tc = self.create(false, "source.c", name, source, expected_lines);
+ self.addCase(tc);
+ }
+
pub fn add_both(
self: *TranslateCContext,
name: []const u8,
@@ -1617,6 +1627,19 @@ pub const TranslateCContext = struct {
}
}
+ pub fn addC_both(
+ self: *TranslateCContext,
+ name: []const u8,
+ source: []const u8,
+ expected_lines: []const []const u8,
+ ) void {
+ for ([_]bool{ false, true }) |stage2| {
+ const tc = self.create(false, "source.c", name, source, expected_lines);
+ tc.stage2 = stage2;
+ self.addCase(tc);
+ }
+ }
+
pub fn add_2(
self: *TranslateCContext,
name: []const u8,