]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: --repeat=[num] to repeat tests
authorDaniel Stenberg <daniel@haxx.se>
Fri, 13 Dec 2019 16:27:12 +0000 (17:27 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 15 Dec 2019 10:54:45 +0000 (11:54 +0100)
Closes #4715

tests/runtests.1
tests/runtests.pl

index bb36a8b44c129011910ee9594752e9eccd6813d3..69aafe57910d280f9d050e0c99a4ec2362425d27 100644 (file)
@@ -82,6 +82,13 @@ Run the tests in a scrambled, or randomized, order instead of sequentially.
 Display run time statistics. (Requires Perl Time::HiRes module)
 .IP "-rf"
 Display full run time statistics. (Requires Perl Time::HiRes module)
+.IP "--repeat=[num]"
+This will repeat the given set of test numbers this many times. If no test
+numbers are given, it will repeat ALL tests this many times. It iteratively
+adds the new sequence at the end of the initially given one.
+
+If \fB-R\fP is also used, the scrambling is done after the repeats have
+extended the test sequence.
 .IP "-s"
 Shorter output. Speaks less than default.
 .IP "--shallow=[num](,seed)"
index 6ee2cca20d48739a3d7eb829dca502950c89d69b..27f62edd5a2449fd073f99c738917699ad51d42f 100755 (executable)
@@ -186,6 +186,7 @@ my $server_response_maxtime=13;
 my $debug_build=0;          # built debug enabled (--enable-debug)
 my $has_memory_tracking=0;  # built with memory tracking (--enable-curldebug)
 my $libtool;
+my $repeat = 0;
 
 # name of the file that the memory debugging creates:
 my $memdump="$LOGDIR/memdump";
@@ -5053,6 +5054,10 @@ while(@ARGV) {
         $shallowseed=$seed?$seed:1234; # get a real seed later
         srand($shallowseed); # make it predictable
     }
+    elsif($ARGV[0] =~ /--repeat=(\d+)/) {
+        # Repeat-run the given tests this many times
+        $repeat = $1;
+    }
     elsif($ARGV[0] eq "-a") {
         # continue anyway, even if a test fail
         $anyway=1;
@@ -5342,6 +5347,13 @@ else {
     }
     $TESTCASES = $verified;
 }
+if($repeat) {
+    my $s;
+    for(1 .. $repeat) {
+        $s .= $TESTCASES;
+    }
+    $TESTCASES = $s;
+}
 
 if($scrambleorder) {
     # scramble the order of the test cases