my $stunnel = checkcmd("stunnel");
my $valgrind = checkcmd("valgrind");
+my $start;
my $valgrind_tool;
if($valgrind) {
#
sub singletest {
- my $testnum=$_[0];
+ my ($testnum, $count, $total)=@_;
my @what;
my $why;
my @err = getpart("verify", "errorcode");
my $errorcode = $err[0] || "0";
-
+ my $ok="";
my $res;
if (@validstdout) {
# verify redirected stdout
if($res) {
return 1;
}
- if(!$short) {
- print " stdout OK";
- }
+ $ok .= "s";
+ }
+ else {
+ $ok .= "-"; # stdout not checked
}
my %replyattr = getpartattr("reply", "data");
if ($res) {
return 1;
}
- if(!$short) {
- print " data OK";
- }
+ $ok .= "d";
+ }
+ else {
+ $ok .= "-"; # data not checked
}
if(@upload) {
if ($res) {
return 1;
}
- if(!$short) {
- print " upload OK";
- }
+ $ok .= "u";
+ }
+ else {
+ $ok .= "-"; # upload not checked
}
if(@protocol) {
if($res) {
return 1;
}
- if(!$short) {
- print " protocol OK";
- }
+
+ $ok .= "p";
+
+ }
+ else {
+ $ok .= "-"; # protocol not checked
}
my @outfile=getpart("verify", "file");
if($res) {
return 1;
}
- if(!$short) {
- print " output OK";
- }
+
+ $ok .= "o";
+ }
+ else {
+ $ok .= "-"; # output not checked
}
# accept multiple comma-separated error codes
if($verbose) {
print " received exitcode $cmdres OK";
}
- elsif(!$short) {
- print " exit OK";
- }
+ $ok .= "e";
}
else {
if(!$short) {
return 1;
}
else {
- if(!$short) {
- print " memory OK";
- }
+ $ok .= "m";
}
}
}
+ else {
+ $ok .= "-"; # memory not checked
+ }
+
if($valgrind) {
# this is the valid protocol blurb curl should generate
my @disable= getpart("verify", "valgrind");
print @e;
return 1;
}
- elsif(!$short) {
- printf " valgrind OK";
- }
+ $ok .= "v";
}
else {
if(!$short) {
print " valgrind SKIPPED";
}
+ $ok .= "-"; # skipped
}
}
- if($short) {
- print "OK";
+ else {
+ $ok .= "-"; # valgrind not checked
}
- print "\n";
+
+ print "$ok " if(!$short);
+
+ my $sofar= time()-$start;
+ my $esttotal = $sofar/$count * $total;
+ my $estleft = $esttotal - $sofar;
+ my $left=sprintf("remaining: %dm%ds",
+ $estleft/60,
+ $estleft%60);
+ printf "OK ($count out of $total, %s)\n", $left;
# the test succeeded, remove all log files
if(!$keepoutfiles) {
my $ok=0;
my $total=0;
my $lasttest;
+my @at = split(" ", $TESTCASES);
+my $count;
+
+$start = time();
-foreach $testnum (split(" ", $TESTCASES)) {
+foreach $testnum (@at) {
$lasttest = $testnum if($testnum > $lasttest);
+ $count++;
- my $error = singletest($testnum);
+ my $error = singletest($testnum, $count, scalar(@at));
if($error < 0) {
# not a test we can run
next;
}
if($all) {
- print "TESTDONE: $all tests were considered.\n";
+ my $sofar = time()-$start;
+ print "TESTDONE: $all tests were considered during $sofar seconds.\n";
}
if($skipped) {