diff options
Diffstat (limited to 'src/cli.zig')
-rw-r--r-- | src/cli.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cli.zig b/src/cli.zig index 9b04a3588..1418d1b2e 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -217,6 +217,7 @@ pub const Arguments = struct { // TODO: update test completions const test_only_params = [_]ParamType{ clap.parseParam("--update-snapshots Update snapshot files") catch unreachable, + clap.parseParam("--rerun-each <NUMBER> Re-run each test file <NUMBER> times, helps catch certain bugs") catch unreachable, }; const build_params_public = public_params ++ build_only_params; @@ -376,6 +377,14 @@ pub const Arguments = struct { if (cmd == .TestCommand) { ctx.test_options.update_snapshots = args.flag("--update-snapshots"); + if (args.option("--rerun-each")) |repeat_count| { + if (repeat_count.len > 0) { + ctx.test_options.repeat_count = std.fmt.parseInt(u32, repeat_count, 10) catch |e| { + Output.prettyErrorln("--rerun-each expects a number: {s}", .{@errorName(e)}); + Global.exit(1); + }; + } + } } ctx.args.absolute_working_dir = cwd; @@ -871,6 +880,7 @@ pub const Command = struct { pub const TestOptions = struct { update_snapshots: bool = false, + repeat_count: u32 = 0, }; pub const Context = struct { |