From 348882ee79cf6fe319c33833a9066027de7b5d51 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 26 Jun 2024 11:13:54 +0200 Subject: [PATCH] runtests: support %VERNUM For the plain version number of the built curl without -DEV etc. Only digits and dots. --- tests/FILEFORMAT.md | 9 +++++---- tests/globalconfig.pm | 2 ++ tests/runtests.pl | 2 ++ tests/servers.pm | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/FILEFORMAT.md b/tests/FILEFORMAT.md index ec7f3c4f0c..b5790e55cf 100644 --- a/tests/FILEFORMAT.md +++ b/tests/FILEFORMAT.md @@ -136,20 +136,18 @@ Available substitute variables include: - `%GOPHERSPORT` - Port number of the Gophers server - `%HOST6IP` - IPv6 address of the host running this test - `%HOSTIP` - IPv4 address of the host running this test +- `%HTTP2PORT` - Port number of the HTTP/2 server - `%HTTP6PORT` - IPv6 port number of the HTTP server - `%HTTPPORT` - Port number of the HTTP server -- `%HTTP2PORT` - Port number of the HTTP/2 server - `%HTTPSPORT` - Port number of the HTTPS server - `%HTTPSPROXYPORT` - Port number of the HTTPS-proxy - `%HTTPTLS6PORT` - IPv6 port number of the HTTP TLS server - `%HTTPTLSPORT` - Port number of the HTTP TLS server - `%HTTPUNIXPATH` - Path to the Unix socket of the HTTP server -- `%SOCKSUNIXPATH` - Path to the Unix socket of the SOCKS server - `%IMAP6PORT` - IPv6 port number of the IMAP server - `%IMAPPORT` - Port number of the IMAP server - `%LOGDIR` - Log directory relative to %PWD - `%MQTTPORT` - Port number of the MQTT server -- `%TELNETPORT` - Port number of the telnet server - `%NOLISTENPORT` - Port number where no service is listening - `%POP36PORT` - IPv6 port number of the POP3 server - `%POP3PORT` - Port number of the POP3 server @@ -163,15 +161,18 @@ Available substitute variables include: - `%SMTP6PORT` - IPv6 port number of the SMTP server - `%SMTPPORT` - Port number of the SMTP server - `%SOCKSPORT` - Port number of the SOCKS4/5 server +- `%SOCKSUNIXPATH` - Path to the Unix socket of the SOCKS server - `%SRCDIR` - Full path to the source dir +- `%SSH_PWD` - Current directory friendly for the SSH server - `%SSHPORT` - Port number of the SCP/SFTP server - `%SSHSRVMD5` - MD5 of SSH server's public key - `%SSHSRVSHA256` - SHA256 of SSH server's public key -- `%SSH_PWD` - Current directory friendly for the SSH server +- `%TELNETPORT` - Port number of the telnet server - `%TESTNUMBER` - Number of the test case - `%TFTP6PORT` - IPv6 port number of the TFTP server - `%TFTPPORT` - Port number of the TFTP server - `%USER` - Login ID of the user running the test +- `%VERNUM` - the version number of the tested curl (without -DEV) - `%VERSION` - the full version number of the tested curl # `` diff --git a/tests/globalconfig.pm b/tests/globalconfig.pm index 5aad483eb5..14e8687424 100644 --- a/tests/globalconfig.pm +++ b/tests/globalconfig.pm @@ -38,6 +38,7 @@ BEGIN { $automakestyle $CURL $CURLVERSION + $CURLVERNUM $has_shared $LIBDIR $listonly @@ -82,6 +83,7 @@ our $run_event_based; # run curl with --test-event to test the event API our $automakestyle; # use automake-like test status output format our $anyway; # continue anyway, even if a test fail our $CURLVERSION=""; # curl's reported version number +our $CURLVERNUM=""; # curl's reported version number (without -DEV) our $randseed = 0; # random number seed # paths diff --git a/tests/runtests.pl b/tests/runtests.pl index 03358da001..886dc1aa28 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -519,6 +519,8 @@ sub checksystemfeatures { if($_ =~ /^curl ([^ ]*)/) { $curl = $_; $CURLVERSION = $1; + $CURLVERNUM = $CURLVERSION; + $CURLVERNUM =~ s/[^0-9.]//g; # dots and numbers only $curl =~ s/^(.*)(libcurl.*)/$1/g || die "Failure determining curl binary version"; $libcurl = $2; diff --git a/tests/servers.pm b/tests/servers.pm index d4472d509b..63a3f33b37 100644 --- a/tests/servers.pm +++ b/tests/servers.pm @@ -2970,6 +2970,7 @@ sub subvariables { $$thing =~ s/${prefix}PWD/$pwd/g; $$thing =~ s/${prefix}POSIX_PWD/$posix_pwd/g; $$thing =~ s/${prefix}VERSION/$CURLVERSION/g; + $$thing =~ s/${prefix}VERNUM/$CURLVERNUM/g; $$thing =~ s/${prefix}TESTNUMBER/$testnum/g; my $file_pwd = $pwd;