print " CMD: $testcmd\n" if($verbose);
# memanalyze -v is our friend, get the number of allocations made
- my $count;
+ my $count=0;
my @out = `$memanalyze -v $memdump`;
for(@out) {
if(/^Allocations: (\d+)/) {
last;
}
}
+ if(!$count) {
+ print " found no allocs to make fail\n";
+ return 0;
+ }
print " $count allocations to make fail\n";
next;
}
- print "Fail alloc no: $limit\r" if(!$gdbthis);
+ print "Fail alloc no: $limit\r" if($verbose);
# make the memory allocation function number $limit return failure
$ENV{'CURL_MEMLIMIT'} = $limit;
$ret = system($testcmd);
}
+ # Now clear the variable again
+ $ENV{'CURL_MEMLIMIT'} = undef;
+
if(-r "core") {
# there's core file present now!
print " core dumped!\n";
}
}
- stopservers();
- exit; # for now, we stop after these tests
+ print "torture OK\n";
+ return 0;
+
+ #stopservers();
+ #exit; # for now, we stop after these tests
}
#######################################################################
$pid = checkserver ($HTTPPIDFILE);
# verify if our/any server is running on this port
- my $cmd = "$CURL -o log/verifiedserver --silent -i $HOSTIP:$HOSTPORT/verifiedserver 2>/dev/null";
+ my $cmd = "$CURL -o log/verifiedserver http://$HOSTIP:$HOSTPORT/verifiedserver 2>/dev/null";
print "CMD; $cmd\n" if ($verbose);
my $res = system($cmd);
}
# run the command line we built
if ($torture) {
- torture($CMDLINE,
- "gdb --directory libtest $DBGCURL -x log/gdbcmd");
+ return torture($CMDLINE,
+ "gdb --directory libtest $DBGCURL -x log/gdbcmd");
}
elsif($gdbthis) {
system("gdb --directory libtest $DBGCURL -x log/gdbcmd");
if($pid <= 0) {
return 2; # error starting it
}
+ printf ("* pid ftp => %-5d\n", $pid) if($verbose);
$run{'ftp'}=$pid;
}
if(!$run{'ftps'}) {
if($pid <= 0) {
return 2; # problems starting server
}
+ printf ("* pid http => %-5d\n", $pid) if($verbose);
$run{'http'}=$pid;
}
if(!$run{'https'}) {
}
}
elsif($what eq "none") {
+ print "* starts no server\n" if ($verbose);
}
else {
warn "we don't support a server for $what";
if($xtra =~ s/(\d+)$//) {
$tortalloc = $1;
}
+ # we undef valgrind to make this fly in comparison
+ undef $valgrind;
}
elsif($ARGV[0] eq "-a") {
# continue anyway, even if a test fail