mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
made 'runtests.pl -t' run over all the tests just like other command lines
Also made -t imply -n to disable valgrind, it runs sloooow otherwise. This now manages to run all tests OK up to test case 100 (the first FTP one) for me.
This commit is contained in:
parent
2b7727aad1
commit
d1542bf549
@ -167,7 +167,7 @@ sub torture {
|
|||||||
print " CMD: $testcmd\n" if($verbose);
|
print " CMD: $testcmd\n" if($verbose);
|
||||||
|
|
||||||
# memanalyze -v is our friend, get the number of allocations made
|
# memanalyze -v is our friend, get the number of allocations made
|
||||||
my $count;
|
my $count=0;
|
||||||
my @out = `$memanalyze -v $memdump`;
|
my @out = `$memanalyze -v $memdump`;
|
||||||
for(@out) {
|
for(@out) {
|
||||||
if(/^Allocations: (\d+)/) {
|
if(/^Allocations: (\d+)/) {
|
||||||
@ -175,6 +175,10 @@ sub torture {
|
|||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!$count) {
|
||||||
|
print " found no allocs to make fail\n";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
print " $count allocations to make fail\n";
|
print " $count allocations to make fail\n";
|
||||||
|
|
||||||
@ -187,7 +191,7 @@ sub torture {
|
|||||||
next;
|
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
|
# make the memory allocation function number $limit return failure
|
||||||
$ENV{'CURL_MEMLIMIT'} = $limit;
|
$ENV{'CURL_MEMLIMIT'} = $limit;
|
||||||
@ -205,6 +209,9 @@ sub torture {
|
|||||||
$ret = system($testcmd);
|
$ret = system($testcmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Now clear the variable again
|
||||||
|
$ENV{'CURL_MEMLIMIT'} = undef;
|
||||||
|
|
||||||
if(-r "core") {
|
if(-r "core") {
|
||||||
# there's core file present now!
|
# there's core file present now!
|
||||||
print " core dumped!\n";
|
print " core dumped!\n";
|
||||||
@ -243,8 +250,11 @@ sub torture {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stopservers();
|
print "torture OK\n";
|
||||||
exit; # for now, we stop after these tests
|
return 0;
|
||||||
|
|
||||||
|
#stopservers();
|
||||||
|
#exit; # for now, we stop after these tests
|
||||||
}
|
}
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
@ -304,7 +314,7 @@ sub runhttpserver {
|
|||||||
$pid = checkserver ($HTTPPIDFILE);
|
$pid = checkserver ($HTTPPIDFILE);
|
||||||
|
|
||||||
# verify if our/any server is running on this port
|
# 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);
|
print "CMD; $cmd\n" if ($verbose);
|
||||||
my $res = system($cmd);
|
my $res = system($cmd);
|
||||||
|
|
||||||
@ -1039,8 +1049,8 @@ sub singletest {
|
|||||||
}
|
}
|
||||||
# run the command line we built
|
# run the command line we built
|
||||||
if ($torture) {
|
if ($torture) {
|
||||||
torture($CMDLINE,
|
return torture($CMDLINE,
|
||||||
"gdb --directory libtest $DBGCURL -x log/gdbcmd");
|
"gdb --directory libtest $DBGCURL -x log/gdbcmd");
|
||||||
}
|
}
|
||||||
elsif($gdbthis) {
|
elsif($gdbthis) {
|
||||||
system("gdb --directory libtest $DBGCURL -x log/gdbcmd");
|
system("gdb --directory libtest $DBGCURL -x log/gdbcmd");
|
||||||
@ -1334,6 +1344,7 @@ sub startservers {
|
|||||||
if($pid <= 0) {
|
if($pid <= 0) {
|
||||||
return 2; # error starting it
|
return 2; # error starting it
|
||||||
}
|
}
|
||||||
|
printf ("* pid ftp => %-5d\n", $pid) if($verbose);
|
||||||
$run{'ftp'}=$pid;
|
$run{'ftp'}=$pid;
|
||||||
}
|
}
|
||||||
if(!$run{'ftps'}) {
|
if(!$run{'ftps'}) {
|
||||||
@ -1361,6 +1372,7 @@ sub startservers {
|
|||||||
if($pid <= 0) {
|
if($pid <= 0) {
|
||||||
return 2; # problems starting server
|
return 2; # problems starting server
|
||||||
}
|
}
|
||||||
|
printf ("* pid http => %-5d\n", $pid) if($verbose);
|
||||||
$run{'http'}=$pid;
|
$run{'http'}=$pid;
|
||||||
}
|
}
|
||||||
if(!$run{'https'}) {
|
if(!$run{'https'}) {
|
||||||
@ -1373,6 +1385,7 @@ sub startservers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif($what eq "none") {
|
elsif($what eq "none") {
|
||||||
|
print "* starts no server\n" if ($verbose);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
warn "we don't support a server for $what";
|
warn "we don't support a server for $what";
|
||||||
@ -1456,6 +1469,8 @@ do {
|
|||||||
if($xtra =~ s/(\d+)$//) {
|
if($xtra =~ s/(\d+)$//) {
|
||||||
$tortalloc = $1;
|
$tortalloc = $1;
|
||||||
}
|
}
|
||||||
|
# we undef valgrind to make this fly in comparison
|
||||||
|
undef $valgrind;
|
||||||
}
|
}
|
||||||
elsif($ARGV[0] eq "-a") {
|
elsif($ARGV[0] eq "-a") {
|
||||||
# continue anyway, even if a test fail
|
# continue anyway, even if a test fail
|
||||||
|
Loading…
Reference in New Issue
Block a user