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 <johannes.schindelin@gmx.de>
This commit is contained in:
parent
55953c77c0
commit
7530a6287e
@ -67,11 +67,12 @@ static int quote_stress_test(int argc, const char **argv)
|
|||||||
* were passed in.
|
* were passed in.
|
||||||
*/
|
*/
|
||||||
char special[] = ".?*\\^_\"'`{}()[]<>@~&+:;$%"; // \t\r\n\a";
|
char special[] = ".?*\\^_\"'`{}()[]<>@~&+:;$%"; // \t\r\n\a";
|
||||||
int i, j, k, trials = 100;
|
int i, j, k, trials = 100, skip = 0;
|
||||||
struct strbuf out = STRBUF_INIT;
|
struct strbuf out = STRBUF_INIT;
|
||||||
struct argv_array args = ARGV_ARRAY_INIT;
|
struct argv_array args = ARGV_ARRAY_INIT;
|
||||||
struct option options[] = {
|
struct option options[] = {
|
||||||
OPT_INTEGER('n', "trials", &trials, "Number of trials"),
|
OPT_INTEGER('n', "trials", &trials, "Number of trials"),
|
||||||
|
OPT_INTEGER('s', "skip", &skip, "Skip <n> trials"),
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
const char * const usage[] = {
|
const char * const usage[] = {
|
||||||
@ -113,6 +114,9 @@ static int quote_stress_test(int argc, const char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i < skip)
|
||||||
|
continue;
|
||||||
|
|
||||||
cp.argv = args.argv;
|
cp.argv = args.argv;
|
||||||
strbuf_reset(&out);
|
strbuf_reset(&out);
|
||||||
if (pipe_command(&cp, NULL, 0, &out, 0, NULL, 0) < 0)
|
if (pipe_command(&cp, NULL, 0, &out, 0, NULL, 0) < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user