]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: support %VERNUM
authorDaniel Stenberg <daniel@haxx.se>
Wed, 26 Jun 2024 09:13:54 +0000 (11:13 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 26 Jun 2024 13:49:26 +0000 (15:49 +0200)
For the plain version number of the built curl without -DEV etc. Only
digits and dots.

tests/FILEFORMAT.md
tests/globalconfig.pm
tests/runtests.pl
tests/servers.pm

index ec7f3c4f0c9ce268448c14d1b43933339925aa45..b5790e55cf071653979dca348f854a9850823ff3 100644 (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>`
index 5aad483eb563e3cc5940aecd9a0e441bd9d9e14f..14e8687424ac8b45a73cde600abbc932d3e86954 100644 (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
index 03358da0017cc9be7cc8083a4d977404b701ccdd..886dc1aa28e8504e6e65537cfd9ed3c9b82e73c4 100755 (executable)
@@ -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;
index d4472d509bd9b2f248896d8f257633358960eb73..63a3f33b375b0faeccac26e4c8d0380d5f3d6a74 100644 (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;