mirror of
https://github.com/moparisthebest/curl
synced 2025-03-03 02:41:59 -05:00
runtests.pl: add %TESTNUMBER variable to make copying tests more convenient
This commit is contained in:
parent
8ad31a8c6e
commit
203dc00718
@ -149,6 +149,7 @@ Available substitute variables include:
|
|||||||
- `%SSHPORT` - Port number of the SCP/SFTP server
|
- `%SSHPORT` - Port number of the SCP/SFTP server
|
||||||
- `%SSHSRVMD5` - MD5 of SSH server's public key
|
- `%SSHSRVMD5` - MD5 of SSH server's public key
|
||||||
- `%SSH_PWD` - Current directory friendly for the SSH server
|
- `%SSH_PWD` - Current directory friendly for the SSH server
|
||||||
|
- `%TESTNUMBER` - Number of the test case
|
||||||
- `%TFTP6PORT` - IPv6 port number of the TFTP server
|
- `%TFTP6PORT` - IPv6 port number of the TFTP server
|
||||||
- `%TFTPPORT` - Port number of the TFTP server
|
- `%TFTPPORT` - Port number of the TFTP server
|
||||||
- `%USER` - Login ID of the user running the test
|
- `%USER` - Login ID of the user running the test
|
||||||
|
@ -137,7 +137,7 @@ test1144 test1145 test1146 test1147 test1148 test1149 test1150 test1151 \
|
|||||||
test1152 test1153 test1154 test1155 test1156 test1157 test1158 test1159 \
|
test1152 test1153 test1154 test1155 test1156 test1157 test1158 test1159 \
|
||||||
test1160 test1161 test1162 test1163 test1164 test1165 test1166 test1167 \
|
test1160 test1161 test1162 test1163 test1164 test1165 test1166 test1167 \
|
||||||
test1168 test1169 test1170 test1171 test1172 test1173 test1174 test1175 \
|
test1168 test1169 test1170 test1171 test1172 test1173 test1174 test1175 \
|
||||||
test1176 test1177 test1178 test1179 test1180 test1181 test1182 \
|
test1176 test1177 test1178 test1179 test1180 test1181 test1182 test1183 \
|
||||||
\
|
\
|
||||||
test1188 \
|
test1188 \
|
||||||
\
|
\
|
||||||
|
48
tests/data/test1183
Normal file
48
tests/data/test1183
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
HTTP
|
||||||
|
HTTP GET
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data>
|
||||||
|
HTTP/1.1 200 OK
|
||||||
|
Server: Blafasel/5.0
|
||||||
|
Date: Sat, 16 Jan 2021 14:48:30 GMT
|
||||||
|
Content-Length: 12
|
||||||
|
|
||||||
|
Bla bla bla
|
||||||
|
</data>
|
||||||
|
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
http
|
||||||
|
</server>
|
||||||
|
<features>
|
||||||
|
proxy
|
||||||
|
</features>
|
||||||
|
<name>
|
||||||
|
%TESTNUMBER used instead of actual test number
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
http://%HOSTIP:%HTTPPORT/%TESTNUMBER
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
# Verify that the %TESTNUMBER has been resolved to 1183
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
GET /1183 HTTP/1.1
|
||||||
|
Host: %HOSTIP:%HTTPPORT
|
||||||
|
User-Agent: curl/%VERSION
|
||||||
|
Accept: */*
|
||||||
|
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
@ -3248,7 +3248,7 @@ sub checksystem {
|
|||||||
# a command, in either case passed by reference
|
# a command, in either case passed by reference
|
||||||
#
|
#
|
||||||
sub subVariables {
|
sub subVariables {
|
||||||
my ($thing, $prefix) = @_;
|
my ($thing, $testnum, $prefix) = @_;
|
||||||
|
|
||||||
if(!$prefix) {
|
if(!$prefix) {
|
||||||
$prefix = "%";
|
$prefix = "%";
|
||||||
@ -3304,6 +3304,7 @@ sub subVariables {
|
|||||||
$$thing =~ s/${prefix}PWD/$pwd/g;
|
$$thing =~ s/${prefix}PWD/$pwd/g;
|
||||||
$$thing =~ s/${prefix}POSIX_PWD/$posix_pwd/g;
|
$$thing =~ s/${prefix}POSIX_PWD/$posix_pwd/g;
|
||||||
$$thing =~ s/${prefix}VERSION/$VERSION/g;
|
$$thing =~ s/${prefix}VERSION/$VERSION/g;
|
||||||
|
$$thing =~ s/${prefix}TESTNUMBER/$testnum/g;
|
||||||
|
|
||||||
my $file_pwd = $pwd;
|
my $file_pwd = $pwd;
|
||||||
if($file_pwd !~ /^\//) {
|
if($file_pwd !~ /^\//) {
|
||||||
@ -3447,6 +3448,7 @@ sub timestampskippedevents {
|
|||||||
# etc. Returns the processed version of the array
|
# etc. Returns the processed version of the array
|
||||||
|
|
||||||
sub prepro {
|
sub prepro {
|
||||||
|
my $testnum = shift;
|
||||||
my (@entiretest) = @_;
|
my (@entiretest) = @_;
|
||||||
my $show = 1;
|
my $show = 1;
|
||||||
my @out;
|
my @out;
|
||||||
@ -3473,7 +3475,7 @@ sub prepro {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if($show) {
|
if($show) {
|
||||||
subVariables(\$s, "%");
|
subVariables(\$s, $testnum, "%");
|
||||||
subBase64(\$s);
|
subBase64(\$s);
|
||||||
subNewlines(\$s) if($has_hyper);
|
subNewlines(\$s) if($has_hyper);
|
||||||
push @out, $s;
|
push @out, $s;
|
||||||
@ -3666,7 +3668,7 @@ sub singletest {
|
|||||||
my @entiretest = fulltest();
|
my @entiretest = fulltest();
|
||||||
my $otest = "log/test$testnum";
|
my $otest = "log/test$testnum";
|
||||||
|
|
||||||
@entiretest = prepro(@entiretest);
|
@entiretest = prepro($testnum, @entiretest);
|
||||||
|
|
||||||
# save the new version
|
# save the new version
|
||||||
open(D, ">$otest");
|
open(D, ">$otest");
|
||||||
@ -5691,7 +5693,7 @@ sub disabledtests {
|
|||||||
|
|
||||||
# preprocess the input to make conditionally disabled tests depending
|
# preprocess the input to make conditionally disabled tests depending
|
||||||
# on variables
|
# on variables
|
||||||
my @pp = prepro(@input);
|
my @pp = prepro(0, @input);
|
||||||
for my $t (@pp) {
|
for my $t (@pp) {
|
||||||
if($t =~ /(\d+)/) {
|
if($t =~ /(\d+)/) {
|
||||||
my ($n) = $1;
|
my ($n) = $1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user