]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: check and report if `diff` tool is missing
authorViktor Szakats <commit@vsz.me>
Wed, 5 Mar 2025 17:38:57 +0000 (18:38 +0100)
committerViktor Szakats <commit@vsz.me>
Wed, 5 Mar 2025 19:28:15 +0000 (20:28 +0100)
To make it apparent which CI jobs are missing this tool, so we can
install it to improve the runtests log.

Correction to the followed-up commit: `diff` is not installed via the
`gcc` package but via `automake`. Meaning it needs be installed manually
for MSYS cmake jobs.

Follow-up to e6c78e18dac1da2027eac6dd3829a0fdbfa55501 #16571
Closes #16578

tests/runtests.pl

index a45d12f084cb18bc52dfe0a9175763a8ef81844e..33b801fb62ad2a28021c12aaa25778e37249bb74 100755 (executable)
@@ -416,6 +416,9 @@ sub showdiff {
 
     if(!$out[0]) {
         @out = `diff -c $file2 $file1 2>$dev_null`;
+        if(!$out[0]) {
+            logmsg "Failed to show diff. The diff tool may be missing.\n";
+        }
     }
 
     return @out;
@@ -852,6 +855,14 @@ sub checksystemfeatures {
     chomp $hosttype;
     my $hostos=$^O;
 
+    my $havediff;
+    if(system("diff $TESTDIR/DISABLED $TESTDIR/DISABLED 2>$dev_null") == 0) {
+      $havediff = 'available';
+    }
+    else {
+      $havediff = 'missing';
+    }
+
     # display summary information about curl and the test host
     logmsg ("********* System characteristics ******** \n",
             "* $curl\n",
@@ -863,6 +874,7 @@ sub checksystemfeatures {
             "* System: $hosttype\n",
             "* OS: $hostos\n",
             "* Perl: $^V ($^X)\n",
+            "* diff: $havediff\n",
             "* Args: $args\n");
 
     if($jobs) {