]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Fixed the -l option of runtests.pl
authorDan Fandrich <dan@coneharvesters.com>
Thu, 11 Oct 2007 21:15:09 +0000 (21:15 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Thu, 11 Oct 2007 21:15:09 +0000 (21:15 +0000)
Added support for skipping tests based on key words.

CHANGES
tests/runtests.1
tests/runtests.pl

diff --git a/CHANGES b/CHANGES
index 49fac02cd1b51e7b56bb2da7a6093ec79dc762d2..1fe68b576ca02d4eb8386f71a8e420eeac6114e9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,11 @@
 
                                   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)
 - Michal Marek removed the no longer existing return codes from the curl.1
   man page.
index a3871c0ece1978955f09630e8e40f3c49722b53b..f272ac241d0e136007e566f3bece8c45c45cd9e6 100644 (file)
@@ -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
 .\" * you should have received as part of this distribution. The terms
@@ -21,7 +21,7 @@
 .\" * $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
 runtests.pl \- run one or more test cases
 .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
 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
-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
 .IP "-a"
 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.
+.IP "-bN"
+Use N as the base TCP/UDP port number on which to start the test servers.
 .IP "-c <curl>"
 Provide a custom curl binary to run the tests with. Default is the curl
 executable in the build tree.
@@ -78,7 +85,7 @@ Enable verbose output. Speaks more than default.
 .SH "RUNNING TESTS"
 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
-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.
 
 The test script checks this by itself, why it is safe to attempt to run all
index ef73dad97a58ba8592a320091ac3cc6a3c7b5b6d..71a02c9f6124dad3ff6c0eb6a6ce50449f49868a 100755 (executable)
@@ -171,6 +171,7 @@ my @protocols;   # array of supported protocols
 my $skipped=0;  # number of tests skipped; reported in main loop
 my %skipped;    # skipped{reason}=counter, 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
@@ -1543,6 +1544,17 @@ sub singletest {
         $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) {
         my @precheck = getpart("client", "precheck");
         $cmd = $precheck[0];
@@ -1558,7 +1570,7 @@ sub singletest {
         }
     }
 
-    if($why) {
+    if($why && !$listonly) {
         # there's a problem, count it as "skipped"
         $skipped++;
         $skipped{$why}++;
@@ -2358,15 +2370,6 @@ sub startservers {
 sub serverfortest {
     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");
 
     if(!$what[0]) {
@@ -2393,7 +2396,7 @@ my $number=0;
 my $fromnum=-1;
 my @testthis;
 my %disabled;
-do {
+while(@ARGV) {
     if ($ARGV[0] eq "-v") {
         # verbose output
         $verbose=1;
@@ -2476,6 +2479,7 @@ Usage: runtests.pl [options] [test number(s)]
   -v       verbose output
   [num]    like "5 6 9" or " 5 to 22 " to run those tests only
   [!num]   like "!5 !6 !9" to disable those tests
+  [!keyword] like "!cookies !IPv6" to disable tests with those key words
 EOHELP
     ;
         exit;
@@ -2499,7 +2503,15 @@ EOHELP
         $fromnum = -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 "") {
     $TESTCASES=join(" ", @testthis);