Skip to content

Commit

Permalink
runtests: use a DISABLED.local file too
Browse files Browse the repository at this point in the history
... 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.
  • Loading branch information
bagder committed Apr 26, 2015
1 parent 92e754d commit c0700e3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
4 changes: 3 additions & 1 deletion tests/README
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/data/.gitignore
@@ -0,0 +1 @@
DISABLED.local
28 changes: 19 additions & 9 deletions tests/runtests.pl
Expand Up @@ -5002,19 +5002,29 @@ sub runtimestats {
# 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
#
Expand Down

0 comments on commit c0700e3

Please sign in to comment.