Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
43e1e1cd
Commit
43e1e1cd
authored
24 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
upload check, better ability to specify test cases on the command line
parent
55b7c1c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/runtests.pl
+38
-13
38 additions, 13 deletions
tests/runtests.pl
with
38 additions
and
13 deletions
tests/runtests.pl
+
38
−
13
View file @
43e1e1cd
...
...
@@ -186,7 +186,7 @@ sub comparefiles {
# silly win-crap
binmode
S
;
binmode
D
;
my
$m
=
20
;
my
(
$snum
,
$dnum
,
$s
,
$d
);
do
{
...
...
@@ -196,7 +196,7 @@ sub comparefiles {
(
$s
ne
$d
))
{
print
"
$source
and
$dest
differ
\n
";
$res
=
1
;
last
;
$snum
=
0
;
}
}
while
(
$snum
);
close
(
S
);
...
...
@@ -330,6 +330,21 @@ sub singletest {
# this is the valid protocol file we should generate
my
$PROT
=
"
$TESTDIR
/prot
$NUMBER
.txt
";
# redirected stdout/stderr here
$STDOUT
=
"
$LOGDIR
/stdout
$NUMBER
";
$STDERR
=
"
$LOGDIR
/stderr
$NUMBER
";
# if this file exists, we verify that the stdout contained this:
my
$VALIDOUT
=
"
$TESTDIR
/stdout
$NUMBER
.txt
";
# if this file exists, we verify upload
my
$UPLOAD
=
"
$TESTDIR
/upload
$NUMBER
.txt
";
if
(
!
-
r
$CURLCMD
)
{
# this is not a test
next
;
}
# name of the test
open
(
N
,
"
<
$TESTDIR
/name
$NUMBER
.txt
")
||
print
"
** Couldn't read name on test
$NUMBER
\n
";
...
...
@@ -337,13 +352,6 @@ sub singletest {
close
(
N
);
$DESC
=~
s/[\r\n]//g
;
# redirected stdout/stderr here
$STDOUT
=
"
$LOGDIR
/stdout
$NUMBER
";
$STDERR
=
"
$LOGDIR
/stderr
$NUMBER
";
# if this file exist, we verify that the stdout contained this:
my
$VALIDOUT
=
"
$TESTDIR
/stdout
$NUMBER
.txt
";
print
"
test
$NUMBER
...
";
if
(
!
$short
)
{
print
"
[
$DESC
]
\n
";
...
...
@@ -432,19 +440,30 @@ sub singletest {
}
}
else
{
if
(
!
-
r
$REPLY
)
{
if
(
!
-
r
$REPLY
&&
-
r
$CURLOUT
)
{
print
"
** Missing reply data file for test
$NUMBER
",
"
, should be similar to
$CURLOUT
\n
";
return
1
;
}
# verify the received data
$res
=
compare
(
$CURLOUT
,
$REPLY
,
"
data
");
if
(
-
r
$CURLOUT
)
{
# verify the received data
$res
=
compare
(
$CURLOUT
,
$REPLY
,
"
data
");
if
(
$res
)
{
return
1
;
}
}
}
if
(
-
r
$UPLOAD
)
{
# verify uploaded data
$res
=
compare
("
$LOGDIR
/upload.
$NUMBER
",
$UPLOAD
,
"
upload
");
if
(
$res
)
{
return
1
;
}
}
if
(
!
-
r
$PROT
)
{
print
"
** Missing protocol file for test
$NUMBER
",
"
, should be similar to
$SERVERIN
\n
";
...
...
@@ -507,6 +526,7 @@ sub singletest {
# Check options to this test program
#
my
@testthis
;
do
{
if
(
$ARGV
[
0
]
eq
"
-v
")
{
# verbose output
...
...
@@ -534,10 +554,15 @@ EOHELP
exit
;
}
elsif
(
$ARGV
[
0
]
=~
/^(\d+)/
)
{
$TESTCASES
=
$ARGV
[
0
];
# run these tests
push
@testthis
,
$
1
;
}
}
while
(
shift
@ARGV
);
if
(
$testthis
[
0
]
ne
"")
{
$TESTCASES
=
join
("
",
@testthis
);
}
#######################################################################
# Output curl version and host info being tested
#
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment