authorgravatar for alex_naskos@hotmail.comAlexandros Naskos <alex_naskos@hotmail.com> 2020-10-03 12:47:49+03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-10-03 12:47:49+03:00
logb5034bd7765565f838466d8b212140097a1eefba
tree054e9775ae3e45c4da13499dbada554a72af6b46
parente9434ff8f46ec27a863d0b071c0a99b4f01588dc
parent539e90e26d86b7e8fbc81f069a062beb7a43edb3
signature Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #6506 from FireFox317/stage2-cli

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

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

src/main.zig+4
...@@ -1210,6 +1210,10 @@ fn buildOutputType(...@@ -1210,6 +1210,10 @@ fn buildOutputType(
1210 fatal("translate-c expects exactly 1 source file (found {})", .{c_source_files.items.len});1210 fatal("translate-c expects exactly 1 source file (found {})", .{c_source_files.items.len});
1211 }1211 }
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
1213 const root_name = if (provided_name) |n| n else blk: {1217 const root_name = if (provided_name) |n| n else blk: {
1214 if (arg_mode == .zig_test) {1218 if (arg_mode == .zig_test) {
1215 break :blk "test";1219 break :blk "test";