]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: use more consistent failure lines
authorDan Fandrich <dan@coneharvesters.com>
Wed, 21 Jun 2023 19:43:48 +0000 (12:43 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Wed, 21 Jun 2023 21:42:37 +0000 (14:42 -0700)
After a test failure log a consistent log message to make it easier to
parse the log file.  Also, log a consistent message with "ignored" for
failures that cause the test to be not considered at all. These should
perhaps be counted in the skipped category, but this commit does not
change that behaviour.

tests/runner.pm
tests/runtests.pl

index 813c66989070f6f64b76da152b50b80f8d7f89a2..abab866543887357e2c9ddd962d51e9be8504c34 100644 (file)
@@ -515,7 +515,7 @@ sub torture {
             }
         }
         if($fail) {
-            logmsg " Failed on function number $limit in test.\n",
+            logmsg " $testnum: torture FAILED: function number $limit in test.\n",
             " invoke with \"-t$limit\" to repeat this single case.\n";
             stopservers($verbose);
             return 1;
@@ -712,7 +712,7 @@ sub singletest_prepare {
         my $filename=$fileattr{'name'};
         if(@inputfile || $filename) {
             if(!$filename) {
-                logmsg "ERROR: section client=>file has no name attribute\n";
+                logmsg " $testnum: IGNORED: section client=>file has no name attribute\n";
                 return -1;
             }
             my $fileContent = join('', @inputfile);
@@ -846,14 +846,14 @@ sub singletest_run {
         }
 
         if(! -f $CMDLINE) {
-            logmsg "The tool set in the test case for this: '$tool' does not exist\n";
+            logmsg " $testnum: IGNORED: The tool set in the test case for this: '$tool' does not exist\n";
             return (-1, 0, 0, "", "", 0);
         }
         $DBGCURL=$CMDLINE;
     }
 
     if($fail_due_event_based) {
-        logmsg "This test cannot run event based\n";
+        logmsg " $testnum: IGNORED: This test cannot run event based\n";
         return (-1, 0, 0, "", "", 0);
     }
 
@@ -1026,7 +1026,7 @@ sub singletest_clean {
         foreach my $server (@killtestservers) {
             chomp $server;
             if(stopserver($server)) {
-                logmsg " killserver FAILED\n";
+                logmsg " $testnum: killserver FAILED\n";
                 return 1; # normal error if asked to fail on unexpected alive
             }
         }
@@ -1050,7 +1050,7 @@ sub singletest_postcheck {
             # Must run the postcheck command in torture mode in order
             # to clean up, but the result can't be relied upon.
             if($rc != 0 && !$torture) {
-                logmsg " postcheck FAILED\n";
+                logmsg " $testnum: postcheck FAILED\n";
                 return -1;
             }
         }
index 31483890f13e3317cb624eb5d6cd1865365bb5d5..7626912a54a87dad27dd54ea75072ef27be3aaaa 100755 (executable)
@@ -1504,13 +1504,16 @@ sub singletest_check {
 
             my $filename=$hash{'name'};
             if(!$filename) {
-                logmsg "ERROR: section verify=>file$partsuffix ".
+                logmsg " $testnum: IGNORED: section verify=>file$partsuffix ".
                        "has no name attribute\n";
                 if (runnerac_stopservers($runnerid)) {
                     logmsg "ERROR: runner $runnerid seems to have died\n";
                 } else {
 
                     # TODO: this is a blocking call that will stall the controller,
+                    if($verbose) {
+                        logmsg "WARNING: blocking call in async function\n";
+                    }
                     # but this error condition should never happen except during
                     # development.
                     my ($rid, $unexpected, $logs) = runnerar($runnerid);
@@ -1596,7 +1599,7 @@ sub singletest_check {
             logmsg sprintf("\n%s returned $cmdres, when expecting %s\n",
                            (!$tool)?"curl":$tool, $errorcode);
         }
-        logmsg " exit FAILED\n";
+        logmsg " $testnum: exit FAILED\n";
         # timestamp test result verification end
         $timevrfyend{$testnum} = Time::HiRes::time();
         return -1;