From: Daniel Stenberg Date: Wed, 26 Jun 2024 09:20:01 +0000 (+0200) Subject: runtests: support %DATE for YYYY-MM-DD of right now X-Git-Tag: curl-8_9_0~181 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e73b69b3dd6d174226c60406d3c4266754d70f8;p=thirdparty%2Fcurl.git runtests: support %DATE for YYYY-MM-DD of right now --- diff --git a/tests/FILEFORMAT.md b/tests/FILEFORMAT.md index b5790e55cf..bc5f42a086 100644 --- a/tests/FILEFORMAT.md +++ b/tests/FILEFORMAT.md @@ -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 diff --git a/tests/globalconfig.pm b/tests/globalconfig.pm index 14e8687424..6d5e53237e 100644 --- a/tests/globalconfig.pm +++ b/tests/globalconfig.pm @@ -39,6 +39,7 @@ BEGIN { $CURL $CURLVERSION $CURLVERNUM + $DATE $has_shared $LIBDIR $listonly diff --git a/tests/runtests.pl b/tests/runtests.pl index 886dc1aa28..1c1d27b46f 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -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); diff --git a/tests/servers.pm b/tests/servers.pm index 63a3f33b37..d2c60aa6c8 100644 --- a/tests/servers.pm +++ b/tests/servers.pm @@ -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;