Newer
Older
#######################################################################
# compare test results with the expected output, we might filter off
# some pattern that is allowed to differ, output test results
#
# filter off patterns _before_ this comparison!
my ($subject, $firstref, $secondref)=@_;
my $result = compareparts($firstref, $secondref);
if($result) {
if(!$short) {
logmsg "\n $subject FAILED:\n";
logmsg showdiff($LOGDIR, $firstref, $secondref);
}
else {
logmsg "FAILED\n";
#######################################################################
# display information about curl and the host the test suite runs on
#
sub checksystem {
unlink($memdump); # remove this if there was one left
my $curl;
my $libcurl;
my $versretval;
my $versnoexec;
my @version=();
my $curlverout="$LOGDIR/curlverout.log";
my $curlvererr="$LOGDIR/curlvererr.log";
my $versioncmd="$CURL --version 1>$curlverout 2>$curlvererr";
unlink($curlverout);
unlink($curlvererr);
$versretval = system($versioncmd);
$versnoexec = $!;
open(VERSOUT, $curlverout);
@version = <VERSOUT>;
close(VERSOUT);
for(@version) {
chomp;
if($_ =~ /^curl/) {
$curl = $_;
$curl =~ s/^(.*)(libcurl.*)/$1/g;
$libcurl = $2;
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
if($curl =~ /mingw32/) {
# This is a windows minw32 build, we need to translate the
# given path to the "actual" windows path.
my @m = `mount`;
my $matchlen;
my $bestmatch;
my $mount;
# example mount output:
# C:\DOCUME~1\Temp on /tmp type user (binmode,noumount)
# c:\ActiveState\perl on /perl type user (binmode)
# C:\msys\1.0\bin on /usr/bin type user (binmode,cygexec,noumount)
# C:\msys\1.0\bin on /bin type user (binmode,cygexec,noumount)
foreach $mount (@m) {
if( $mount =~ /(.*) on ([^ ]*) type /) {
my ($mingw, $real)=($2, $1);
if($pwd =~ /^$mingw/) {
# the path we got from pwd starts with the path
# we found on this line in the mount output
my $len = length($real);
if($len > $matchlen) {
# we remember the match that is the longest
$matchlen = $len;
$bestmatch = $real;
}
}
}
}
if(!$matchlen) {
logmsg "Serious error, can't find our \"real\" path\n";
}
else {
# now prepend the prefix from the mount command to build
# our "actual path"
$pwd = "$bestmatch$pwd";
}
$pwd =~ s#\\#/#g;
}
elsif ($curl =~ /win32/) {
Daniel Stenberg
committed
# Native Windows builds don't understand the
# output of cygwin's pwd. It will be
# something like /cygdrive/c/<some path>.
#
# Use the cygpath utility to convert the
# working directory to a Windows friendly
# path. The -m option converts to use drive
# letter:, but it uses / instead \. Forward
# slashes (/) are easier for us. We don't
# have to escape them to get them to curl
# through a shell.
chomp($pwd = `cygpath -m $pwd`);
}
elsif ($libcurl =~ /openssl/i) {
Daniel Stenberg
committed
$ssllib="OpenSSL";
elsif ($libcurl =~ /gnutls/i) {
Daniel Stenberg
committed
$ssllib="GnuTLS";
elsif ($libcurl =~ /nss/i) {
$has_nss=1;
Daniel Stenberg
committed
$ssllib="NSS";
}
elsif ($libcurl =~ /yassl/i) {
$has_yassl=1;
$has_openssl=1;
$ssllib="yassl";
}
}
elsif($_ =~ /^Protocols: (.*)/i) {
# these are the protocols compiled in to this libcurl
@protocols = split(' ', $1);
# Generate a "proto-ipv6" version of each protocol to match the
# IPv6 <server> name. This works even if IPv6 support isn't
# compiled in because the <features> test will fail.
push @protocols, map($_ . "-ipv6", @protocols);
# 'none' is used in test cases to mean no server
push @protocols, ('none');
}
elsif($_ =~ /^Features: (.*)/i) {
if($feat =~ /debug/i) {
# debug is a listed "feature", use that knowledge
$curl_debug = 1;
# set the NETRC debug env
$ENV{'CURL_DEBUG_NETRC'} = 'log/netrc';
}
if($feat =~ /SSL/i) {
# ssl enabled
$ssl_version=1;
}
if($feat =~ /Largefile/i) {
# large file support
$large_file=1;
}
Daniel Stenberg
committed
if($feat =~ /IDN/i) {
# IDN support
$has_idn=1;
}
if($feat =~ /libz/i) {
$has_libz = 1;
}
Daniel Stenberg
committed
if($feat =~ /NTLM/i) {
# NTLM enabled
$has_ntlm=1;
}
}
}
if(!$curl) {
logmsg "unable to get curl's version, further details are:\n";
logmsg "issued command: \n";
logmsg "$versioncmd \n";
if ($versretval == -1) {
logmsg "command failed with: \n";
logmsg "$versnoexec \n";
}
elsif ($versretval & 127) {
logmsg sprintf("command died with signal %d, and %s coredump.\n",
($versretval & 127), ($versretval & 128)?"a":"no");
}
else {
logmsg sprintf("command exited with value %d \n", $versretval >> 8);
}
logmsg "contents of $curlverout: \n";
displaylogcontent("$curlverout");
logmsg "contents of $curlvererr: \n";
displaylogcontent("$curlvererr");
die "couldn't get curl's version";
}
if(-r "../lib/config.h") {
open(CONF, "<../lib/config.h");
while(<CONF>) {
if($_ =~ /^\#define HAVE_GETRLIMIT/) {
$has_getrlimit = 1;
}
}
close(CONF);
}
Daniel Stenberg
committed
# client has ipv6 support
# check if the HTTP server has it!
my @sws = `server/sws --version`;
if($sws[0] =~ /IPv6/) {
# HTTP server has ipv6 support!
$http_ipv6 = 1;
}
Daniel Stenberg
committed
# check if the FTP server has it!
@sws = `server/sockfilt --version`;
Daniel Stenberg
committed
if($sws[0] =~ /IPv6/) {
# FTP server has ipv6 support!
$ftp_ipv6 = 1;
}
if(!$curl_debug && $torture) {
die "can't run torture tests since curl was not build with debug";
}
# curl doesn't list cryptographic support separately, so assume it's
# always available
$has_crypto=1;
my $hostname=`hostname`;
my $hosttype=`uname -a`;
logmsg ("********* System characteristics ******** \n",
"* $curl\n",
"* $libcurl\n",
"* System: $hosttype");
logmsg sprintf("* Server SSL: %s\n", $stunnel?"ON":"OFF");
logmsg sprintf("* libcurl SSL: %s\n", $ssl_version?"ON":"OFF");
logmsg sprintf("* libcurl debug: %s\n", $curl_debug?"ON":"OFF");
logmsg sprintf("* valgrind: %s\n", $valgrind?"ON":"OFF");
logmsg sprintf("* HTTP IPv6 %s\n", $http_ipv6?"ON":"OFF");
logmsg sprintf("* FTP IPv6 %s\n", $ftp_ipv6?"ON":"OFF");
logmsg sprintf("* HTTP port: %d\n", $HTTPPORT);
logmsg sprintf("* FTP port: %d\n", $FTPPORT);
logmsg sprintf("* FTP port 2: %d\n", $FTP2PORT);
Daniel Stenberg
committed
if($stunnel) {
logmsg sprintf("* FTPS port: %d\n", $FTPSPORT);
logmsg sprintf("* HTTPS port: %d\n", $HTTPSPORT);
logmsg sprintf("* HTTP IPv6 port: %d\n", $HTTP6PORT);
Daniel Stenberg
committed
}
Daniel Stenberg
committed
if($ftp_ipv6) {
logmsg sprintf("* FTP IPv6 port: %d\n", $FTP6PORT);
Daniel Stenberg
committed
}
logmsg sprintf("* TFTP port: %d\n", $TFTPPORT);
if($tftp_ipv6) {
logmsg sprintf("* TFTP IPv6 port: %d\n", $TFTP6PORT);
}
logmsg sprintf("* SCP/SFTP port: %d\n", $SSHPORT);
if($ssl_version) {
logmsg sprintf("* SSL library: %s\n", $ssllib);
$has_textaware = ($^O eq 'MSWin32') || ($^O eq 'msys');
logmsg sprintf("* Libtool lib: %s\n", $libtool?"ON":"OFF");
logmsg "***************************************** \n";
#######################################################################
# substitute the variable stuff into either a joined up file or
# a command, in either case passed by reference
#
sub subVariables {
my ($thing) = @_;
$$thing =~ s/%HOSTIP/$HOSTIP/g;
Daniel Stenberg
committed
$$thing =~ s/%HTTPPORT/$HTTPPORT/g;
$$thing =~ s/%HOST6IP/$HOST6IP/g;
$$thing =~ s/%HTTP6PORT/$HTTP6PORT/g;
$$thing =~ s/%HTTPSPORT/$HTTPSPORT/g;
$$thing =~ s/%FTPPORT/$FTPPORT/g;
Daniel Stenberg
committed
$$thing =~ s/%FTP6PORT/$FTP6PORT/g;
Daniel Stenberg
committed
$$thing =~ s/%FTP2PORT/$FTP2PORT/g;
$$thing =~ s/%FTPSPORT/$FTPSPORT/g;
$$thing =~ s/%SRCDIR/$srcdir/g;
$$thing =~ s/%PWD/$pwd/g;
$$thing =~ s/%TFTPPORT/$TFTPPORT/g;
$$thing =~ s/%TFTP6PORT/$TFTP6PORT/g;
$$thing =~ s/%SSHPORT/$SSHPORT/g;
$$thing =~ s/%CURL/$CURL/g;
$$thing =~ s/%USER/$USER/g;
Daniel Stenberg
committed
# The purpose of FTPTIME2 and FTPTIME3 is to provide times that can be
# used for time-out tests and that whould work on most hosts as these
# adjust for the startup/check time for this particular host. We needed
# to do this to make the test suite run better on very slow hosts.
my $ftp2 = $ftpchecktime * 2;
my $ftp3 = $ftpchecktime * 3;
$$thing =~ s/%FTPTIME2/$ftp2/g;
$$thing =~ s/%FTPTIME3/$ftp3/g;
Daniel Stenberg
committed
sub fixarray {
my @in = @_;
for(@in) {
subVariables \$_;
}
return @in;
}
#######################################################################
# Run a single specified test case
#
my ($testnum, $count, $total)=@_;
my @what;
my $why;
Daniel Stenberg
committed
my %feature;
Daniel Stenberg
committed
my $cmd;
# load the test case file definition
if(loadtest("${TESTDIR}/test${testnum}")) {
if($verbose) {
# this is not a test
logmsg "RUN: $testnum doesn't look like a test case\n";
Daniel Stenberg
committed
$why = "no test";
}
else {
@what = getpart("client", "features");
for(@what) {
my $f = $_;
$f =~ s/\s//g;
Daniel Stenberg
committed
$feature{$f}=$f; # we require this feature
if($f eq "SSL") {
if($ssl_version) {
next;
}
}
elsif($f eq "OpenSSL") {
if($has_openssl) {
next;
}
}
elsif($f eq "GnuTLS") {
if($has_gnutls) {
next;
}
}
elsif($f eq "NSS") {
if($has_nss) {
next;
}
}
elsif($f eq "netrc_debug") {
if($curl_debug) {
next;
}
}
elsif($f eq "large_file") {
if($large_file) {
next;
}
}
Daniel Stenberg
committed
elsif($f eq "idn") {
if($has_idn) {
next;
}
}
elsif($f eq "ipv6") {
if($has_ipv6) {
next;
}
}
elsif($f eq "libz") {
if($has_libz) {
next;
}
}
Daniel Stenberg
committed
elsif($f eq "NTLM") {
if($has_ntlm) {
next;
}
}
elsif($f eq "getrlimit") {
if($has_getrlimit) {
next;
}
}
elsif($f eq "crypto") {
if($has_crypto) {
next;
}
}
# See if this "feature" is in the list of supported protocols
elsif (grep /^$f$/, @protocols) {
next;
}
Daniel Stenberg
committed
$why = "curl lacks $f support";
last;
}
Daniel Stenberg
committed
if(!$why) {
$why = serverfortest($testnum);
}
Daniel Stenberg
committed
if(!$why) {
Daniel Stenberg
committed
my @precheck = getpart("client", "precheck");
Daniel Stenberg
committed
$cmd = $precheck[0];
Daniel Stenberg
committed
chomp $cmd;
subVariables \$cmd;
Daniel Stenberg
committed
if($cmd) {
my @o = `$cmd 2>/dev/null`;
Daniel Stenberg
committed
if($o[0]) {
$why = $o[0];
chomp $why;
}
logmsg "prechecked $cmd\n" if($verbose);
Daniel Stenberg
committed
}
}
Daniel Stenberg
committed
if($why) {
# there's a problem, count it as "skipped"
$skipped++;
$skipped{$why}++;
$teststat[$testnum]=$why; # store reason for this test case
if(!$short) {
Daniel Stenberg
committed
printf "test %03d SKIPPED: $why\n", $testnum;
}
return -1;
}
logmsg sprintf("test %03d...", $testnum);
# extract the reply data
my @reply = getpart("reply", "data");
my @replycheck = getpart("reply", "datacheck");
if (@replycheck) {
# we use this file instead to check the final output against
my %hash = getpartattr("reply", "datacheck");
if($hash{'nonewline'}) {
# Yes, we must cut off the final newline from the final line
# of the datacheck
chomp($replycheck[$#replycheck]);
}
Daniel Stenberg
committed
my @curlcmd= fixarray ( getpart("client", "command") );
# this is the valid protocol blurb curl should generate
Daniel Stenberg
committed
my @protocol= fixarray ( getpart("verify", "protocol") );
# redirected stdout/stderr to these files
$STDOUT="$LOGDIR/stdout$testnum";
$STDERR="$LOGDIR/stderr$testnum";
# if this section exists, we verify that the stdout contained this:
Daniel Stenberg
committed
my @validstdout = fixarray ( getpart("verify", "stdout") );
# if this section exists, we verify upload
my @upload = getpart("verify", "upload");
# if this section exists, it might be FTP server instructions:
my @ftpservercmd = getpart("reply", "servercmd");
my $CURLOUT="$LOGDIR/curl$testnum.out"; # curl output if not stdout
my @testname= getpart("client", "name");
if(!$short) {
my $name = $testname[0];
$name =~ s/\n//g;
logmsg "[$name]\n";
}
if($listonly) {
return 0; # look successful
}
my @codepieces = getpart("client", "tool");
my $tool="";
if(@codepieces) {
$tool = $codepieces[0];
chomp $tool;
}
Daniel Stenberg
committed
# remove server output logfiles
Daniel Stenberg
committed
unlink($SERVER2IN);
if(@ftpservercmd) {
# write the instructions to file
writearray($FTPDCMD, \@ftpservercmd);
}
my (@setenv)= getpart("client", "setenv");
my @envs;
my $s;
for $s (@setenv) {
chomp $s; # cut off the newline
subVariables \$s;
if($s =~ /([^=]*)=(.*)/) {
my ($var, $content)=($1, $2);
$ENV{$var}=$content;
# remember which, so that we can clear them afterwards!
push @envs, $var;
}
}
Daniel Stenberg
committed
my @blaha;
($cmd, @blaha)= getpart("client", "command");
# make some nice replace operations
$cmd =~ s/\n//g; # no newlines please
if($curl_debug) {
unlink($memdump);
}
my @inputfile=getpart("client", "file");
if(@inputfile) {
# we need to generate a file before this test is invoked
Daniel Stenberg
committed
my %fileattr = getpartattr("client", "file");
Daniel Stenberg
committed
my $filename=$fileattr{'name'};
logmsg "ERROR: section client=>file has no name attribute\n";
my $fileContent = join('', @inputfile);
subVariables \$fileContent;
# logmsg "DEBUG: writing file " . $filename . "\n";
open OUTFILE, ">$filename";
binmode OUTFILE; # for crapage systems, use binary
print OUTFILE $fileContent;
my %cmdhash = getpartattr("client", "command");
if($cmdhash{'option'} !~ /no-output/) {
#We may slap on --output!
$out=" --output $CURLOUT ";
my $cmdargs;
if(!$tool) {
# run curl, add -v for debug information output
$cmdargs ="$out --include -v --trace-time $cmd";
}
else {
$cmdargs = " $cmd"; # $cmd is the command line for the test file
$CURLOUT = $STDOUT; # sends received data to stdout
}
my @stdintest = getpart("client", "stdin");
if(@stdintest) {
my $stdinfile="$LOGDIR/stdin-for-$testnum";
writearray($stdinfile, \@stdintest);
$cmdargs .= " <$stdinfile";
if(!$tool) {
$CMDLINE="$CURL";
else {
$CMDLINE="$LIBDIR/$tool";
if(! -f $CMDLINE) {
print "The tool set in the test case for this: '$tool' does not exist\n";
return -1;
}
if($valgrind) {
Daniel Stenberg
committed
$CMDLINE = "valgrind ".$valgrind_tool."--leak-check=yes --num-callers=16 ${valgrind_logfile}=log/valgrind$testnum $CMDLINE";
}
logmsg "$CMDLINE\n";
Daniel Stenberg
committed
}
print CMDLOG "$CMDLINE\n";
Daniel Stenberg
committed
unlink("core");
my $dumped_core;
my $cmdres;
my @precommand= getpart("client", "precommand");
if($precommand[0]) {
# this is pure perl to eval!
my $code = join("", @precommand);
eval $code;
if($@) {
logmsg "perl: $code\n";
logmsg "precommand: $@";
if($gdbthis) {
open(GDBCMD, ">log/gdbcmd");
print GDBCMD "set args $cmdargs\n";
print GDBCMD "show args\n";
close(GDBCMD);
}
# run the command line we built
if ($torture) {
Daniel Stenberg
committed
return torture($CMDLINE,
"$gdb --directory libtest $DBGCURL -x log/gdbcmd");
}
elsif($gdbthis) {
system("$gdb --directory libtest $DBGCURL -x log/gdbcmd");
$cmdres=0; # makes it always continue after a debugged run
$cmdres = system("$CMDLINE");
my $signal_num = $cmdres & 127;
Daniel Stenberg
committed
$dumped_core = $cmdres & 128;
if(!$anyway && ($signal_num || $dumped_core)) {
$cmdres = 1000;
}
else {
$cmdres /= 256;
}
Daniel Stenberg
committed
if(!$dumped_core) {
if(-r "core") {
# there's core file present now!
$dumped_core = 1;
}
}
if($dumped_core) {
logmsg "core dumped\n";
logmsg "running gdb for post-mortem analysis:\n";
Daniel Stenberg
committed
open(GDBCMD, ">log/gdbcmd2");
print GDBCMD "bt\n";
close(GDBCMD);
system("$gdb --directory libtest -x log/gdbcmd2 -batch $DBGCURL core ");
Daniel Stenberg
committed
# unlink("log/gdbcmd2");
}
}
# remove the special FTP command file after each test!
unlink($FTPDCMD);
my $e;
for $e (@envs) {
$ENV{$e}=""; # clean up
}
my @err = getpart("verify", "errorcode");
my $errorcode = $err[0] || "0";
my $ok="";
my $res;
if (@validstdout) {
# verify redirected stdout
my @actual = loadarray($STDOUT);
# get all attributes
my %hash = getpartattr("verify", "stdout");
# get the mode attribute
my $filemode=$hash{'mode'};
if(($filemode eq "text") && $has_textaware) {
# text mode when running on windows: fix line endings
map s/\r\n/\n/g, @actual;
}
$res = compare("stdout", \@actual, \@validstdout);
return 1;
}
$ok .= "s";
}
else {
$ok .= "-"; # stdout not checked
my %replyattr = getpartattr("reply", "data");
Daniel Stenberg
committed
if(!$replyattr{'nocheck'} && (@reply || $replyattr{'sendzero'})) {
# verify the received data
my @out = loadarray($CURLOUT);
my %hash = getpartattr("reply", "data");
# get the mode attribute
my $filemode=$hash{'mode'};
if(($filemode eq "text") && $has_textaware) {
# text mode when running on windows: fix line endings
map s/\r\n/\n/g, @out;
}
$res = compare("data", \@out, \@reply);
return 1;
}
$ok .= "d";
}
else {
$ok .= "-"; # data not checked
if(@upload) {
# verify uploaded data
my @out = loadarray("$LOGDIR/upload.$testnum");
$res = compare("upload", \@out, \@upload);
}
$ok .= "u";
}
else {
$ok .= "-"; # upload not checked
Daniel Stenberg
committed
my @out;
my $retry = 5;
# Verify the sent request. Sometimes, like in test 513 on some hosts,
# curl will return back faster than the server writes down the request
# to its file, so we might need to wait here for a while to see if the
# file gets written a bit later.
while($retry--) {
@out = loadarray($SERVERIN);
if(!$out[0]) {
# nothing there yet, wait a while and try again
sleep(1);
}
}
# what to cut off from the live protocol sent by curl
my @strip = getpart("verify", "strip");
# check if there's any attributes on the verify/protocol section
my %hash = getpartattr("verify", "protocol");
if($hash{'nonewline'}) {
# Yes, we must cut off the final newline from the final line
# of the protocol data
chomp($protstrip[$#protstrip]);
}
Daniel Stenberg
committed
# strip off all lines that match the patterns from both arrays
@out = striparray( $_, \@out);
@protstrip= striparray( $_, \@protstrip);
}
# what parts to cut off from the protocol
my @strippart = getpart("verify", "strippart");
my $strip;
for $strip (@strippart) {
chomp $strip;
for(@out) {
eval $strip;
}
}
$res = compare("protocol", \@out, \@protstrip);
if($res) {
return 1;
}
$ok .= "p";
}
else {
$ok .= "-"; # protocol not checked
}
my @outfile=getpart("verify", "file");
if(@outfile) {
# we're supposed to verify a dynamicly generated file!
my %hash = getpartattr("verify", "file");
my $filename=$hash{'name'};
if(!$filename) {
logmsg "ERROR: section verify=>file has no name attribute\n";
}
my @generated=loadarray($filename);
Daniel Stenberg
committed
# what parts to cut off from the file
my @stripfile = getpart("verify", "stripfile");
my $filemode=$hash{'mode'};
if(($filemode eq "text") && $has_textaware) {
# text mode when running on windows means adding an extra
# strip expression
push @stripfile, "s/\r\n/\n/";
}
Daniel Stenberg
committed
my $strip;
for $strip (@stripfile) {
chomp $strip;
for(@generated) {
eval $strip;
}
}
$res = compare("output", \@generated, \@outfile);
if($res) {
return 1;
}
$ok .= "o";
}
else {
$ok .= "-"; # output not checked
# accept multiple comma-separated error codes
my @splerr = split(/ *, */, $errorcode);
my $errok;
foreach $e (@splerr) {
if($e == $cmdres) {
# a fine error code
$errok = 1;
last;
}
}
if($errok) {
$ok .= "e";
Daniel Stenberg
committed
}
else {
if(!$short) {
printf "\ncurl returned $cmdres, %s was expected\n", $errorcode;
}
logmsg " exit FAILED\n";
Daniel Stenberg
committed
return 1;
}
@what = getpart("client", "killserver");
for(@what) {
my $serv = $_;
chomp $serv;
if($serv =~ /^ftp(\d*)(-ipv6|)/) {
my ($id, $ext) = ($1, $2);
#print STDERR "SERV $serv $id $ext\n";
ftpkillslave($id, $ext, $verbose);
}
stopserver($run{$serv}); # the pid file is in the hash table
$run{$serv}=0; # clear pid
logmsg "RUN: The $serv server is not running\n";
if($curl_debug) {
if(! -f $memdump) {
logmsg "\n** ALERT! memory debugging with no output file?\n";
}
else {
my @memdata=`$memanalyze $memdump`;
my $leak=0;
for(@memdata) {
if($_ ne "") {
# well it could be other memory problems as well, but
# we call it leak for short here
$leak=1;
}
}
if($leak) {
logmsg "\n** MEMORY FAILURE\n";
logmsg @memdata;
return 1;
}
else {
$ok .= "m";
Daniel Stenberg
committed
}
else {
$ok .= "-"; # memory not checked
}
Daniel Stenberg
committed
if($valgrind) {
Daniel Stenberg
committed
# this is the valid protocol blurb curl should generate
my @disable= getpart("verify", "valgrind");
if($disable[0] !~ /disable/) {
opendir(DIR, "log") ||
return 0; # can't open log dir
my @files = readdir(DIR);
closedir DIR;
my $f;
my $l;
foreach $f (@files) {
if($f =~ /^valgrind$testnum\.pid/) {
$l = $f;
last;
Daniel Stenberg
committed
}
Daniel Stenberg
committed
}
my $src=$ENV{'srcdir'};
if(!$src) {
$src=".";
}
my @e = valgrindparse($src, $feature{'SSL'}, "log/$l");
if($e[0]) {
logmsg " valgrind ERROR ";
logmsg @e;
Daniel Stenberg
committed
return 1;
}
$ok .= "v";
Daniel Stenberg
committed
}
Daniel Stenberg
committed
else {
if(!$short) {
logmsg " valgrind SKIPPED";
Daniel Stenberg
committed
}
$ok .= "-"; # skipped
Daniel Stenberg
committed
}
else {
$ok .= "-"; # valgrind not checked
logmsg "$ok " if(!$short);
my $sofar= time()-$start;
my $esttotal = $sofar/$count * $total;
my $estleft = $esttotal - $sofar;
Daniel Stenberg
committed
my $left=sprintf("remaining: %02d:%02d",
$estleft/60,
$estleft%60);
Daniel Stenberg
committed
printf "OK (%-3d out of %-3d, %s)\n", $count, $total, $left;
Daniel Stenberg
committed
# the test succeeded, remove all log files
if(!$keepoutfiles) {
cleardir($LOGDIR);
}
unlink($FTPDCMD); # remove the instructions for this test
#######################################################################
# Stop all running test servers
sub stopservers {