mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
Print error when running zig test/run without a source file
Closes #6498
This commit is contained in:
parent
e9434ff8f4
commit
539e90e26d
@ -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";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user