]> granicus.if.org Git - curl/commitdiff
runtests: use a DISABLED.local file too
authorDaniel Stenberg <daniel@haxx.se>
Sun, 26 Apr 2015 16:22:46 +0000 (18:22 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 26 Apr 2015 17:59:13 +0000 (19:59 +0200)
... and have git ignore that. Allows for a dev to add tests to ignore in
local tests and yet don't obstruct a normal git work flow.

tests/README
tests/data/.gitignore [new file with mode: 0644]
tests/runtests.pl

index 14ac6eedb4709b9b4df48b4dc6701e061dda35d7..ae8ff25cc4358294d1c0ce0f85595713fe252aa1 100644 (file)
@@ -100,7 +100,9 @@ The cURL Test Suite
   (like "./runtests.pl 3 4" to test 3 and 4 only). It also supports test case
   ranges with 'to', as in "./runtests 3 to 9" which runs the seven tests from
   3 to 9. Any test numbers starting with ! are disabled, as are any test
-  numbers found in the file data/DISABLED (one per line).
+  numbers found in the files data/DISABLED or data/DISABLED.local (one per
+  line). The latter is meant for local temporary disables and will be ignored
+  by git.
 
   When -s is not present, each successful test will display on one line the
   test number and description and on the next line a set of flags, the test
diff --git a/tests/data/.gitignore b/tests/data/.gitignore
new file mode 100644 (file)
index 0000000..124ebf9
--- /dev/null
@@ -0,0 +1 @@
+DISABLED.local
index 65c093c338c57a10c540672c9848f5288be93ef5..33d841231b5e6f5f7f2c54c0127350eab401a1f9 100755 (executable)
@@ -5002,19 +5002,29 @@ if(!$listonly) {
 # Fetch all disabled tests, if there are any
 #
 
-if(open(D, "<$TESTDIR/DISABLED")) {
-    while(<D>) {
-        if(/^ *\#/) {
-            # allow comments
-            next;
-        }
-        if($_ =~ /(\d+)/) {
-            $disabled{$1}=$1; # disable this test number
+sub disabledtests {
+    my ($file) = @_;
+
+    if(open(D, "<$file")) {
+        while(<D>) {
+            if(/^ *\#/) {
+                # allow comments
+                next;
+            }
+            if($_ =~ /(\d+)/) {
+                $disabled{$1}=$1; # disable this test number
+            }
         }
+        close(D);
     }
-    close(D);
 }
 
+# globally disabled tests
+disabledtests("$TESTDIR/DISABLED");
+
+# locally disabled tests, ignored by git etc
+disabledtests("$TESTDIR/DISABLED.local");
+
 #######################################################################
 # If 'all' tests are requested, find out all test numbers
 #