@matheusbsbs / matheus-bagliano / commits / 7530a6287e
Fork 0

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>

Johannes Schindelin committed Sep 19, 2019 at 23:46 UTC 7530a6287e20a74b9fe6d4ca3a66df0f0f5cc52c
1 file changed +5 -1
t/helper/test-run-command.c
+5 -1
@@ -67,11 +67,12 @@ static int quote_stress_test(int argc, const char **argv)
67 * were passed in.
68 */
69 char special[] = ".?*\\^_\"'`{}()[]<>@~&+:;$%"; // \t\r\n\a";
70 - int i, j, k, trials = 100;
70 + int i, j, k, trials = 100, skip = 0;
71 struct strbuf out = STRBUF_INIT;
72 struct argv_array args = ARGV_ARRAY_INIT;
73 struct option options[] = {
74 OPT_INTEGER('n', "trials", &trials, "Number of trials"),
75 + OPT_INTEGER('s', "skip", &skip, "Skip <n> trials"),
76 OPT_END()
77 };
78 const char * const usage[] = {
@@ -113,6 +114,9 @@ static int quote_stress_test(int argc, const char **argv)
114 }
115 }
116
117 + if (i < skip)
118 + continue;
119 +
120 cp.argv = args.argv;
121 strbuf_reset(&out);
122 if (pipe_command(&cp, NULL, 0, &out, 0, NULL, 0) < 0)