authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-11-24 22:03:34+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-11-24 22:11:17+01:00
log2298108dafbdc54ad85a12f3e0c3f5a0a608be05
tree23854ecc1b73f5685d954ea02cfeaf884aa84028
parentc4cd3c0541d605141b80c5b65f4a5d09c02c0f96
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

test: Allow tests to set emit_bin=false.


1 files changed, 5 insertions(+), 0 deletions(-)

test/src/Cases.zig+5
...@@ -429,6 +429,7 @@ fn addFromDirInner(...@@ -429,6 +429,7 @@ fn addFromDirInner(
429 const output_mode = try manifest.getConfigForKeyAssertSingle("output_mode", std.builtin.OutputMode);429 const output_mode = try manifest.getConfigForKeyAssertSingle("output_mode", std.builtin.OutputMode);
430 const pic = try manifest.getConfigForKeyAssertSingle("pic", ?bool);430 const pic = try manifest.getConfigForKeyAssertSingle("pic", ?bool);
431 const pie = try manifest.getConfigForKeyAssertSingle("pie", ?bool);431 const pie = try manifest.getConfigForKeyAssertSingle("pie", ?bool);
432 const emit_bin = try manifest.getConfigForKeyAssertSingle("emit_bin", bool);
432433
433 if (manifest.type == .translate_c) {434 if (manifest.type == .translate_c) {
434 for (c_frontends) |c_frontend| {435 for (c_frontends) |c_frontend| {
...@@ -489,6 +490,7 @@ fn addFromDirInner(...@@ -489,6 +490,7 @@ fn addFromDirInner(
489 .target = resolved_target,490 .target = resolved_target,
490 .backend = backend,491 .backend = backend,
491 .updates = std.ArrayList(Cases.Update).init(ctx.cases.allocator),492 .updates = std.ArrayList(Cases.Update).init(ctx.cases.allocator),
493 .emit_bin = emit_bin,
492 .is_test = is_test,494 .is_test = is_test,
493 .output_mode = output_mode,495 .output_mode = output_mode,
494 .link_libc = link_libc,496 .link_libc = link_libc,
...@@ -964,6 +966,8 @@ const TestManifestConfigDefaults = struct {...@@ -964,6 +966,8 @@ const TestManifestConfigDefaults = struct {
964 .run_translated_c => "Obj",966 .run_translated_c => "Obj",
965 .cli => @panic("TODO test harness for CLI tests"),967 .cli => @panic("TODO test harness for CLI tests"),
966 };968 };
969 } else if (std.mem.eql(u8, key, "emit_bin")) {
970 return "true";
967 } else if (std.mem.eql(u8, key, "is_test")) {971 } else if (std.mem.eql(u8, key, "is_test")) {
968 return "false";972 return "false";
969 } else if (std.mem.eql(u8, key, "link_libc")) {973 } else if (std.mem.eql(u8, key, "link_libc")) {
...@@ -1001,6 +1005,7 @@ const TestManifest = struct {...@@ -1001,6 +1005,7 @@ const TestManifest = struct {
1001 trailing_bytes: []const u8 = "",1005 trailing_bytes: []const u8 = "",
10021006
1003 const valid_keys = std.StaticStringMap(void).initComptime(.{1007 const valid_keys = std.StaticStringMap(void).initComptime(.{
1008 .{ "emit_bin", {} },
1004 .{ "is_test", {} },1009 .{ "is_test", {} },
1005 .{ "output_mode", {} },1010 .{ "output_mode", {} },
1006 .{ "target", {} },1011 .{ "target", {} },