]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: simplify value returned regarding use of valgrind
authorDan Fandrich <dan@coneharvesters.com>
Tue, 18 Apr 2023 20:53:30 +0000 (13:53 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Sat, 22 Apr 2023 19:58:03 +0000 (12:58 -0700)
As a side effect this will now also show in verbose mode that valgrind
is being skipped on tests that explicitly disable it, such as 600.

Ref: #10818

tests/runner.pm
tests/runtests.pl

index c788a514e884bf8887e4f425048851b06ccfe91b..5542714b7be93063b63318f12edb7ff80c726c2d 100644 (file)
@@ -37,7 +37,6 @@ BEGIN {
         restore_test_env
         runner_test_preprocess
         runner_test_run
-        use_valgrind
         checktestcmd
         $DBGCURL
         $gdbthis
@@ -762,7 +761,7 @@ sub singletest_run {
     # timestamp finishing of test command
     $timetoolend{$testnum} = Time::HiRes::time();
 
-    return (0, $cmdres, $dumped_core, $CURLOUT, $tool, $disablevalgrind);
+    return (0, $cmdres, $dumped_core, $CURLOUT, $tool, use_valgrind() && !$disablevalgrind);
 }
 
 
@@ -933,8 +932,8 @@ sub runner_test_run {
     my $dumped_core;
     my $CURLOUT;
     my $tool;
-    my $disablevalgrind;
-    ($error, $cmdres, $dumped_core, $CURLOUT, $tool, $disablevalgrind) = singletest_run($testnum);
+    my $usedvalgrind;
+    ($error, $cmdres, $dumped_core, $CURLOUT, $tool, $usedvalgrind) = singletest_run($testnum);
     if($error) {
         return -2;
     }
@@ -957,7 +956,7 @@ sub runner_test_run {
     # restore environment variables that were modified
     restore_test_env(0);
 
-    return (0, $cmdres, $CURLOUT, $tool, $disablevalgrind);
+    return (0, $cmdres, $CURLOUT, $tool, $usedvalgrind);
 }
 
 1;
index e652b968ef31aae6094daa01b74d501f403c7dac..5106957474a9928fe27efd6f03d8b42574a4985c 100755 (executable)
@@ -1014,7 +1014,7 @@ sub singletest_count {
 #######################################################################
 # Verify test succeeded
 sub singletest_check {
-    my ($testnum, $cmdres, $CURLOUT, $tool, $disablevalgrind)=@_;
+    my ($testnum, $cmdres, $CURLOUT, $tool, $usedvalgrind)=@_;
 
     # Skip all the verification on torture tests
     if ($torture) {
@@ -1462,7 +1462,7 @@ sub singletest_check {
     }
 
     if($valgrind) {
-        if(use_valgrind() && !$disablevalgrind) {
+        if($usedvalgrind) {
             if(!opendir(DIR, "$LOGDIR")) {
                 logmsg "ERROR: unable to read $LOGDIR\n";
                 # timestamp test result verification end
@@ -1500,7 +1500,7 @@ sub singletest_check {
             $ok .= "v";
         }
         else {
-            if($verbose && !$disablevalgrind) {
+            if($verbose) {
                 logmsg " valgrind SKIPPED\n";
             }
             $ok .= "-"; # skipped
@@ -1594,8 +1594,8 @@ sub singletest {
     my $cmdres;
     my $CURLOUT;
     my $tool;
-    my $disablevalgrind;
-    ($error, $cmdres, $CURLOUT, $tool, $disablevalgrind) = runner_test_run($testnum);
+    my $usedvalgrind;
+    ($error, $cmdres, $CURLOUT, $tool, $usedvalgrind) = runner_test_run($testnum);
     if($error == -1) {
       # return a test failure, either to be reported or to be ignored
       return $errorreturncode;
@@ -1610,7 +1610,7 @@ sub singletest {
 
     #######################################################################
     # Verify that the test succeeded
-    $error = singletest_check($testnum, $cmdres, $CURLOUT, $tool, $disablevalgrind);
+    $error = singletest_check($testnum, $cmdres, $CURLOUT, $tool, $usedvalgrind);
     if($error == -1) {
       # return a test failure, either to be reported or to be ignored
       return $errorreturncode;