Fixed the -l option of runtests.pl
Added support for skipping tests based on key words.
This commit is contained in:
5
CHANGES
5
CHANGES
@@ -6,6 +6,11 @@
|
|||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
|
Dan F (11 October 2007)
|
||||||
|
- Fixed the -l option of runtests.pl
|
||||||
|
|
||||||
|
- Added support for skipping tests based on key words.
|
||||||
|
|
||||||
Daniel S (9 October 2007)
|
Daniel S (9 October 2007)
|
||||||
- Michal Marek removed the no longer existing return codes from the curl.1
|
- Michal Marek removed the no longer existing return codes from the curl.1
|
||||||
man page.
|
man page.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
.\" * | (__| |_| | _ <| |___
|
.\" * | (__| |_| | _ <| |___
|
||||||
.\" * \___|\___/|_| \_\_____|
|
.\" * \___|\___/|_| \_\_____|
|
||||||
.\" *
|
.\" *
|
||||||
.\" * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
|
.\" * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
.\" *
|
.\" *
|
||||||
.\" * This software is licensed as described in the file COPYING, which
|
.\" * This software is licensed as described in the file COPYING, which
|
||||||
.\" * you should have received as part of this distribution. The terms
|
.\" * you should have received as part of this distribution. The terms
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
.\" * $Id$
|
.\" * $Id$
|
||||||
.\" **************************************************************************
|
.\" **************************************************************************
|
||||||
.\"
|
.\"
|
||||||
.TH runtests.pl 1 "17 Mar 2005" "Curl 7.13.2" "runtests"
|
.TH runtests.pl 1 "11 Oct 2007" "Curl 7.17.1" "runtests"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
runtests.pl \- run one or more test cases
|
runtests.pl \- run one or more test cases
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -34,11 +34,18 @@ test suite. It is often called from the root Makefile of the curl package with
|
|||||||
If no test case number is given, all existing tests that the script can find
|
If no test case number is given, all existing tests that the script can find
|
||||||
will be considered for running. You can specify single test cases to run,
|
will be considered for running. You can specify single test cases to run,
|
||||||
space-separated, like "1 3 5 7 11", and you can specify a range like "45 to
|
space-separated, like "1 3 5 7 11", and you can specify a range like "45 to
|
||||||
67".
|
67". You can also specify only the tests you don't want to run by listing
|
||||||
|
the numbers with a leading exclamation point, like "!66".
|
||||||
|
.P
|
||||||
|
It is also possible to specify tests to skip based on a key word describing
|
||||||
|
the test. These are specified with a leading exclamation point and the
|
||||||
|
key word or phrase, like "!HTTP NTLM auth".
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.IP "-a"
|
.IP "-a"
|
||||||
Continue running the rest of the test cases even if one test fails. By
|
Continue running the rest of the test cases even if one test fails. By
|
||||||
default, the test script stops as soon as an error is detected.
|
default, the test script stops as soon as an error is detected.
|
||||||
|
.IP "-bN"
|
||||||
|
Use N as the base TCP/UDP port number on which to start the test servers.
|
||||||
.IP "-c <curl>"
|
.IP "-c <curl>"
|
||||||
Provide a custom curl binary to run the tests with. Default is the curl
|
Provide a custom curl binary to run the tests with. Default is the curl
|
||||||
executable in the build tree.
|
executable in the build tree.
|
||||||
@@ -78,7 +85,7 @@ Enable verbose output. Speaks more than default.
|
|||||||
.SH "RUNNING TESTS"
|
.SH "RUNNING TESTS"
|
||||||
Many tests have conditions that must be met before the test case can run
|
Many tests have conditions that must be met before the test case can run
|
||||||
fine. They could depend on built-in features in libcurl or features present in
|
fine. They could depend on built-in features in libcurl or features present in
|
||||||
the operating system or even in 3rd party libraries that curl may or may not
|
the operating system or even in third-party libraries that curl may or may not
|
||||||
use.
|
use.
|
||||||
|
|
||||||
The test script checks this by itself, why it is safe to attempt to run all
|
The test script checks this by itself, why it is safe to attempt to run all
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ my @protocols; # array of supported protocols
|
|||||||
my $skipped=0; # number of tests skipped; reported in main loop
|
my $skipped=0; # number of tests skipped; reported in main loop
|
||||||
my %skipped; # skipped{reason}=counter, reasons for skip
|
my %skipped; # skipped{reason}=counter, reasons for skip
|
||||||
my @teststat; # teststat[testnum]=reason, reasons for skip
|
my @teststat; # teststat[testnum]=reason, reasons for skip
|
||||||
|
my %disabled_keywords; # key words of tests to skip
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# variables the command line options may set
|
# variables the command line options may set
|
||||||
@@ -1543,6 +1544,17 @@ sub singletest {
|
|||||||
$why = serverfortest($testnum);
|
$why = serverfortest($testnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!$why) {
|
||||||
|
my @keywords = getpart("info", "keywords");
|
||||||
|
my $k;
|
||||||
|
for $k (@keywords) {
|
||||||
|
chomp $k;
|
||||||
|
if ($disabled_keywords{$k}) {
|
||||||
|
$why = "disabled by keyword";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!$why) {
|
if(!$why) {
|
||||||
my @precheck = getpart("client", "precheck");
|
my @precheck = getpart("client", "precheck");
|
||||||
$cmd = $precheck[0];
|
$cmd = $precheck[0];
|
||||||
@@ -1558,7 +1570,7 @@ sub singletest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($why) {
|
if($why && !$listonly) {
|
||||||
# there's a problem, count it as "skipped"
|
# there's a problem, count it as "skipped"
|
||||||
$skipped++;
|
$skipped++;
|
||||||
$skipped{$why}++;
|
$skipped{$why}++;
|
||||||
@@ -2358,15 +2370,6 @@ sub startservers {
|
|||||||
sub serverfortest {
|
sub serverfortest {
|
||||||
my ($testnum)=@_;
|
my ($testnum)=@_;
|
||||||
|
|
||||||
# load the test case file definition
|
|
||||||
if(loadtest("${TESTDIR}/test${testnum}")) {
|
|
||||||
if($verbose) {
|
|
||||||
# this is not a test
|
|
||||||
logmsg "$testnum doesn't look like a test case\n";
|
|
||||||
}
|
|
||||||
return "no test";
|
|
||||||
}
|
|
||||||
|
|
||||||
my @what = getpart("client", "server");
|
my @what = getpart("client", "server");
|
||||||
|
|
||||||
if(!$what[0]) {
|
if(!$what[0]) {
|
||||||
@@ -2393,7 +2396,7 @@ my $number=0;
|
|||||||
my $fromnum=-1;
|
my $fromnum=-1;
|
||||||
my @testthis;
|
my @testthis;
|
||||||
my %disabled;
|
my %disabled;
|
||||||
do {
|
while(@ARGV) {
|
||||||
if ($ARGV[0] eq "-v") {
|
if ($ARGV[0] eq "-v") {
|
||||||
# verbose output
|
# verbose output
|
||||||
$verbose=1;
|
$verbose=1;
|
||||||
@@ -2476,6 +2479,7 @@ Usage: runtests.pl [options] [test number(s)]
|
|||||||
-v verbose output
|
-v verbose output
|
||||||
[num] like "5 6 9" or " 5 to 22 " to run those tests only
|
[num] like "5 6 9" or " 5 to 22 " to run those tests only
|
||||||
[!num] like "!5 !6 !9" to disable those tests
|
[!num] like "!5 !6 !9" to disable those tests
|
||||||
|
[!keyword] like "!cookies !IPv6" to disable tests with those key words
|
||||||
EOHELP
|
EOHELP
|
||||||
;
|
;
|
||||||
exit;
|
exit;
|
||||||
@@ -2499,7 +2503,15 @@ EOHELP
|
|||||||
$fromnum = -1;
|
$fromnum = -1;
|
||||||
$disabled{$1}=$1;
|
$disabled{$1}=$1;
|
||||||
}
|
}
|
||||||
} while(shift @ARGV);
|
elsif($ARGV[0] =~ /^!(.+)/) {
|
||||||
|
$disabled_keywords{$1}=$1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print "Unknown option: $ARGV[0]\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
shift @ARGV;
|
||||||
|
}
|
||||||
|
|
||||||
if($testthis[0] ne "") {
|
if($testthis[0] ne "") {
|
||||||
$TESTCASES=join(" ", @testthis);
|
$TESTCASES=join(" ", @testthis);
|
||||||
|
|||||||
Reference in New Issue
Block a user