]> granicus.if.org Git - curl/commitdiff
runtests.pl: verify specified test cases
authorDaniel Stenberg <daniel@haxx.se>
Wed, 19 Mar 2014 22:28:28 +0000 (23:28 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 19 Mar 2014 22:28:28 +0000 (23:28 +0100)
To better allow arguments like "1 to 9999" without flooding the terminal
with error messages, the given test cases range is now checked and only
test numbers with existing files are actually run.

tests/runtests.pl

index cbd40e7d96a48e0358b847ed977754810ccb9cb6..e9f5b9ab4690e1d49e576f27b6e68476627f81e9 100755 (executable)
@@ -4901,6 +4901,19 @@ if ( $TESTCASES eq "all") {
         $TESTCASES .= " $n";
     }
 }
+else {
+    my $verified="";
+    map {
+        if (-e "$TESTDIR/test$_") {
+            $verified.="$_ ";
+        }
+    } split(" ", $TESTCASES);
+    if($verified eq "") {
+        print "No existing test cases were specified\n";
+        exit;
+    }
+    $TESTCASES = $verified;
+}
 
 #######################################################################
 # Start the command line log