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
signaturebadge-check 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(
429429 const output_mode = try manifest.getConfigForKeyAssertSingle("output_mode", std.builtin.OutputMode);
430430 const pic = try manifest.getConfigForKeyAssertSingle("pic", ?bool);
431431 const pie = try manifest.getConfigForKeyAssertSingle("pie", ?bool);
432 const emit_bin = try manifest.getConfigForKeyAssertSingle("emit_bin", bool);
432433
433434 if (manifest.type == .translate_c) {
434435 for (c_frontends) |c_frontend| {
......@@ -489,6 +490,7 @@ fn addFromDirInner(
489490 .target = resolved_target,
490491 .backend = backend,
491492 .updates = std.ArrayList(Cases.Update).init(ctx.cases.allocator),
493 .emit_bin = emit_bin,
492494 .is_test = is_test,
493495 .output_mode = output_mode,
494496 .link_libc = link_libc,
......@@ -964,6 +966,8 @@ const TestManifestConfigDefaults = struct {
964966 .run_translated_c => "Obj",
965967 .cli => @panic("TODO test harness for CLI tests"),
966968 };
969 } else if (std.mem.eql(u8, key, "emit_bin")) {
970 return "true";
967971 } else if (std.mem.eql(u8, key, "is_test")) {
968972 return "false";
969973 } else if (std.mem.eql(u8, key, "link_libc")) {
......@@ -1001,6 +1005,7 @@ const TestManifest = struct {
10011005 trailing_bytes: []const u8 = "",
10021006
10031007 const valid_keys = std.StaticStringMap(void).initComptime(.{
1008 .{ "emit_bin", {} },
10041009 .{ "is_test", {} },
10051010 .{ "output_mode", {} },
10061011 .{ "target", {} },