runtests: support %DATE for YYYY-MM-DD of right now

This commit is contained in:
Daniel Stenberg 2024-06-26 11:20:01 +02:00
parent 348882ee79
commit 0e73b69b3d
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
4 changed files with 6 additions and 0 deletions

View 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

View File

@ -39,6 +39,7 @@ BEGIN {
$CURL
$CURLVERSION
$CURLVERNUM
$DATE
$has_shared
$LIBDIR
$listonly

View File

@ -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);

View 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;