]> granicus.if.org Git - curl/commitdiff
unittests: a dedicated feature in tests
authorDaniel Stenberg <daniel@haxx.se>
Mon, 3 Jan 2011 21:42:46 +0000 (22:42 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 3 Jan 2011 21:42:46 +0000 (22:42 +0100)
The test runner script now knows if unittests can run and the unit test
setup file says it is one. I also made runtests.pl deal with no
<command> tag set, so that the description file can get even simpler.

tests/FILEFORMAT
tests/data/test1300
tests/runtests.pl

index 6a61dd0001ebc6cdc39c52fd1b0c8e42a9213421..f4565d32e952dcf4cc93fa97fe02f7b5699c2e79 100644 (file)
@@ -180,6 +180,7 @@ NTLM
 OpenSSL
 SSL
 socks
+unittest
 
 as well as each protocol that curl supports.  A protocol only needs to be
 specified if it is different from the server (useful when the server
@@ -208,7 +209,8 @@ to have failed. Variables are substituted as in the <command> section.
 
 <tool>
 Name of tool to use instead of "curl". This tool must be built and exist
-in the libtest/ directory.
+either in the libtest/ directory (if the tool starts with 'lib') or in the
+unit/ directory (if the tool starts with 'unit').
 </tool>
 
 <name>
index 8bbbecdef03e399dbedb0bb2fc656e233ac37398..1008885616ea3ca90c3c9598a3cdb890bf934175 100644 (file)
@@ -2,6 +2,7 @@
 <info>
 <keywords>
 unittest
+llist
 </keywords>
 </info>
 
@@ -11,20 +12,15 @@ unittest
 <server>
 none
 </server>
+<features>
+unittest
+</features>
  <name>
 llist unit tests
  </name>
 <tool>
 unit1300
 </tool>
-<command>
-unit1300
-</command>
 </client>
 
-#
-# Verify data after the test has been "shot"
-<verify>
-
-</verify>
 </testcase>
index 86bba844c623306a3e09b4135a100b80029f5c9d..9f44306940e648df009cdf0da305c196ce95d29f 100755 (executable)
@@ -2314,6 +2314,11 @@ sub singletest {
                 next;
             }
         }
+        elsif($f eq "unittest") {
+            if($debug_build) {
+                next;
+            }
+        }
         elsif($f eq "large_file") {
             if($large_file) {
                 next;
@@ -2562,6 +2567,10 @@ sub singletest {
         # substitute variables in the command line
         subVariables \$cmd;
     }
+    else {
+        # there was no command given, use something silly
+        $cmd="-";
+    }
     if($curl_debug) {
         unlink($memdump);
     }