summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-01-18 09:35:29 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-01-18 09:35:29 +0100
commit8872721fa39154b948ca8be283ef6ba3a4ffd2de (patch)
tree57c88a48a7babc0bab993ebaad94da8b420aab58
parent4e3a70b3e6757ac0cb186a554201995793431bef (diff)
downloadcurl-bagder/prepro.tar.gz
runtests: preprocess DISABLED to allow conditionalsbagder/prepro
... with this function provided, we can disable tests for specific environments and setups directly within this file.
-rwxr-xr-xtests/runtests.pl28
1 files changed, 19 insertions, 9 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index c35da5324..4971a6492 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -5257,12 +5257,6 @@ sub runtimestats {
logmsg "\n";
}
-# globally disabled tests
-disabledtests("$TESTDIR/DISABLED");
-
-# locally disabled tests, ignored by git etc
-disabledtests("$TESTDIR/DISABLED.local");
-
#######################################################################
# Check options to this test program
#
@@ -5574,12 +5568,16 @@ if(!$listonly) {
checksystem();
}
+# globally disabled tests
+disabledtests("$TESTDIR/DISABLED");
+
#######################################################################
# Fetch all disabled tests, if there are any
#
sub disabledtests {
my ($file) = @_;
+ my @input;
if(open(D, "<$file")) {
while(<D>) {
@@ -5587,17 +5585,29 @@ sub disabledtests {
# allow comments
next;
}
- if($_ =~ /(\d+)/) {
+ push @input, $_;
+ }
+ close(D);
+
+ # preprocess the input to make conditionally disabled tests depending
+ # on variables
+ my @pp = prepro(@input);
+ for my $t (@pp) {
+ if($t =~ /(\d+)/) {
my ($n) = $1;
$disabled{$n}=$n; # disable this test number
if(! -f "$srcdir/data/test$n") {
- print STDERR "WARNING! Non-existing test $n in DISABLED!\n";
+ print STDERR "WARNING! Non-existing test $n in $file!\n";
# fail hard to make user notice
exit 1;
}
+ logmsg "DISABLED: test $n\n" if ($verbose);
+ }
+ else {
+ print STDERR "$file: rubbish content: $t\n";
+ exit 2;
}
}
- close(D);
}
}