]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: support %DATE for YYYY-MM-DD of right now
authorDaniel Stenberg <daniel@haxx.se>
Wed, 26 Jun 2024 09:20:01 +0000 (11:20 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 26 Jun 2024 13:49:26 +0000 (15:49 +0200)
tests/FILEFORMAT.md
tests/globalconfig.pm
tests/runtests.pl
tests/servers.pm

index b5790e55cf071653979dca348f854a9850823ff3..bc5f42a086257dea90aad5a54d446ba3ae410c7e 100644 (file)
@@ -124,6 +124,7 @@ Available substitute variables include:
 - `%CLIENT6IP` - IPv6 address of the client running curl
 - `%CLIENTIP` - IPv4 address of the client running curl
 - `%CURL` - Path to the curl executable
+- `%DATE` - current YYYY-MM-DD date
 - `%FILE_PWD` - Current directory, on Windows prefixed with a slash
 - `%FTP6PORT` - IPv6 port number of the FTP server
 - `%FTPPORT` - Port number of the FTP server
index 14e8687424ac8b45a73cde600abbc932d3e86954..6d5e53237eaeab35e5f865b1c7ebc54160c6046e 100644 (file)
@@ -39,6 +39,7 @@ BEGIN {
         $CURL
         $CURLVERSION
         $CURLVERNUM
+        $DATE
         $has_shared
         $LIBDIR
         $listonly
index 886dc1aa28e8504e6e65537cfd9ed3c9b82e73c4..1c1d27b46f8f05aa885933e4bc42a7297c07d1dd 100755 (executable)
@@ -60,6 +60,7 @@ use strict;
 # Promote all warnings to fatal
 use warnings FATAL => 'all';
 use 5.006;
+use POSIX qw(strftime);
 
 # These should be the only variables that might be needed to get edited:
 
@@ -499,6 +500,8 @@ sub checksystemfeatures {
     $versretval = runclient($versioncmd);
     $versnoexec = $!;
 
+    $DATE = strftime "%Y-%m-%d", localtime;
+
     open(my $versout, "<", "$curlverout");
     @version = <$versout>;
     close($versout);
index 63a3f33b375b0faeccac26e4c8d0380d5f3d6a74..d2c60aa6c810f35d831591f908ae3c0b5c7652fb 100644 (file)
@@ -2971,6 +2971,7 @@ sub subvariables {
     $$thing =~ s/${prefix}POSIX_PWD/$posix_pwd/g;
     $$thing =~ s/${prefix}VERSION/$CURLVERSION/g;
     $$thing =~ s/${prefix}VERNUM/$CURLVERNUM/g;
+    $$thing =~ s/${prefix}DATE/$DATE/g;
     $$thing =~ s/${prefix}TESTNUMBER/$testnum/g;
 
     my $file_pwd = $pwd;