authorgravatar for timonkruiper@gmail.comTimon Kruiper <timonkruiper@gmail.com> 2020-10-02 19:59:00+02:00
committergravatar for timonkruiper@gmail.comTimon Kruiper <timonkruiper@gmail.com> 2020-10-02 19:59:00+02:00
log539e90e26d86b7e8fbc81f069a062beb7a43edb3
tree054e9775ae3e45c4da13499dbada554a72af6b46
parente9434ff8f46ec27a863d0b071c0a99b4f01588dc

Print error when running `zig test/run` without a source file

Closes #6498

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

src/main.zig+4
......@@ -1210,6 +1210,10 @@ fn buildOutputType(
12101210 fatal("translate-c expects exactly 1 source file (found {})", .{c_source_files.items.len});
12111211 }
12121212
1213 if (root_src_file == null and (arg_mode == .zig_test or arg_mode == .run)) {
1214 fatal("one zig source file is required to run this command", .{});
1215 }
1216
12131217 const root_name = if (provided_name) |n| n else blk: {
12141218 if (arg_mode == .zig_test) {
12151219 break :blk "test";