Merge pull request #6506 from FireFox317/stage2-cli

Print error when running `zig test/run` without a source file
This commit is contained in:
Alexandros Naskos 2020-10-03 12:47:49 +03:00 committed by GitHub
commit b5034bd776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1210,6 +1210,10 @@ fn buildOutputType(
fatal("translate-c expects exactly 1 source file (found {})", .{c_source_files.items.len});
}
if (root_src_file == null and (arg_mode == .zig_test or arg_mode == .run)) {
fatal("one zig source file is required to run this command", .{});
}
const root_name = if (provided_name) |n| n else blk: {
if (arg_mode == .zig_test) {
break :blk "test";