runtests: support %VERNUM

For the plain version number of the built curl without -DEV etc. Only
digits and dots.
This commit is contained in:
Daniel Stenberg 2024-06-26 11:13:54 +02:00
parent c4187ea5fa
commit 348882ee79
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
4 changed files with 10 additions and 4 deletions

View File

@ -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
# `<testcase>`

View File

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

View File

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

View File

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