]> git.ipfire.org Git - thirdparty/git.git/commitdiff
quote-stress-test: allow skipping some trials
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 19 Sep 2019 21:46:31 +0000 (23:46 +0200)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 5 Dec 2019 14:37:06 +0000 (15:37 +0100)
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>
t/helper/test-run-command.c

index bdbc5ec56a3f3a90fdc6b5dfbe5d9b5d0ead010b..07989f78ec0f560c42622db16abc98438ce45cc9 100644 (file)
@@ -67,11 +67,12 @@ static int quote_stress_test(int argc, const char **argv)
         * were passed in.
         */
        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 argv_array args = ARGV_ARRAY_INIT;
        struct option options[] = {
                OPT_INTEGER('n', "trials", &trials, "Number of trials"),
+               OPT_INTEGER('s', "skip", &skip, "Skip <n> trials"),
                OPT_END()
        };
        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;
                strbuf_reset(&out);
                if (pipe_command(&cp, NULL, 0, &out, 0, NULL, 0) < 0)