]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests.pl: Don't expect $TESTDIR/DISABLED to exist
authorFabian Keil <fk@fabiankeil.de>
Thu, 19 Jun 2014 14:40:06 +0000 (16:40 +0200)
committerDan Fandrich <dan@coneharvesters.com>
Sat, 26 Jul 2014 21:01:31 +0000 (23:01 +0200)
If a non-standard $TESTDIR is used the file may not be necessary.

Previously a "missing" file resulted in the warning:
readline() on closed filehandle D at ./runtests.pl line 4940.

tests/runtests.pl

index da71414f88c2fa8ab4a0799be6ea3c13bd2d5176..a20af2c7b3b4cc31c2c6f114b43fd438a04e41bc 100755 (executable)
@@ -4865,20 +4865,21 @@ if(!$listonly) {
 }
 
 #######################################################################
-# Fetch all disabled tests
+# Fetch all disabled tests, if there are any
 #
 
-open(D, "<$TESTDIR/DISABLED");
-while(<D>) {
-    if(/^ *\#/) {
-        # allow comments
-        next;
-    }
-    if($_ =~ /(\d+)/) {
-        $disabled{$1}=$1; # disable this test number
+if(open(D, "<$TESTDIR/DISABLED")) {
+    while(<D>) {
+        if(/^ *\#/) {
+            # allow comments
+            next;
+        }
+        if($_ =~ /(\d+)/) {
+            $disabled{$1}=$1; # disable this test number
+        }
     }
+    close(D);
 }
-close(D);
 
 #######################################################################
 # If 'all' tests are requested, find out all test numbers