Skip to content

Commit 7530a62

Browse files
committed
quote-stress-test: allow skipping some trials
When the, say, 93rd trial run fails, it is a good idea to have a way to skip the first 92 trials and dig directly into the 93rd in a debugger. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 55953c7 commit 7530a62

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

t/helper/test-run-command.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ static int quote_stress_test(int argc, const char **argv)
6767
* were passed in.
6868
*/
6969
char special[] = ".?*\\^_\"'`{}()[]<>@~&+:;$%"; // \t\r\n\a";
70-
int i, j, k, trials = 100;
70+
int i, j, k, trials = 100, skip = 0;
7171
struct strbuf out = STRBUF_INIT;
7272
struct argv_array args = ARGV_ARRAY_INIT;
7373
struct option options[] = {
7474
OPT_INTEGER('n', "trials", &trials, "Number of trials"),
75+
OPT_INTEGER('s', "skip", &skip, "Skip <n> trials"),
7576
OPT_END()
7677
};
7778
const char * const usage[] = {
@@ -113,6 +114,9 @@ static int quote_stress_test(int argc, const char **argv)
113114
}
114115
}
115116

117+
if (i < skip)
118+
continue;
119+
116120
cp.argv = args.argv;
117121
strbuf_reset(&out);
118122
if (pipe_command(&cp, NULL, 0, &out, 0, NULL, 0) < 0)

0 commit comments

Comments
 (0)