aboutsummaryrefslogtreecommitdiff
path: root/tests/runtests.pl
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2013-03-15 19:58:00 +0100
committerYang Tse <yangsita@gmail.com>2013-03-15 19:59:51 +0100
commit1700668d783220957a2ad0d1f4f963be58b687f7 (patch)
treeb38fa3310b60e9e2b6b2c981c05fccc2a55c6b49 /tests/runtests.pl
parenta8f93d4efc07cd445843b5bc82a3b38653744868 (diff)
tests: add #96 #558 and #1330
These verfy that the 'memory tracking' subsystem is actually doing its job when using curl tool (#96), a test in libtest (#558) and also a unit test (#1330), in order to prevent regressions in this functionallity.
Diffstat (limited to 'tests/runtests.pl')
-rwxr-xr-xtests/runtests.pl26
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index cc6999cdc..2c577e98f 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -176,8 +176,8 @@ my $TESTCASES="all";
my $perl="perl -I$srcdir";
my $server_response_maxtime=13;
-my $debug_build=0; # curl built with --enable-debug
-my $curl_debug=0; # curl built with --enable-curldebug (memory tracking)
+my $debug_build=0; # built debug enabled (--enable-debug)
+my $has_memory_tracking=0; # built with memory tracking (--enable-curldebug)
my $libtool;
# name of the file that the memory debugging creates:
@@ -2368,8 +2368,8 @@ sub checksystem {
elsif($_ =~ /^Features: (.*)/i) {
$feat = $1;
if($feat =~ /TrackMemory/i) {
- # curl was built with --enable-curldebug (memory tracking)
- $curl_debug = 1;
+ # built with memory tracking support (--enable-curldebug)
+ $has_memory_tracking = 1;
}
if($feat =~ /debug/i) {
# curl was built with --enable-debug
@@ -2487,8 +2487,9 @@ sub checksystem {
}
}
- if(!$curl_debug && $torture) {
- die "can't run torture tests since curl was not built with curldebug";
+ if(!$has_memory_tracking && $torture) {
+ die "can't run torture tests since curl was built without ".
+ "TrackMemory feature (--enable-curldebug)";
}
$has_shared = `sh $CURLCONFIG --built-shared`;
@@ -2511,7 +2512,7 @@ sub checksystem {
logmsg sprintf("* Server SSL: %8s", $stunnel?"ON ":"OFF");
logmsg sprintf(" libcurl SSL: %s\n", $ssl_version?"ON ":"OFF");
logmsg sprintf("* debug build: %8s", $debug_build?"ON ":"OFF");
- logmsg sprintf(" track memory: %s\n", $curl_debug?"ON ":"OFF");
+ logmsg sprintf(" track memory: %s\n", $has_memory_tracking?"ON ":"OFF");
logmsg sprintf("* valgrind: %8s", $valgrind?"ON ":"OFF");
logmsg sprintf(" HTTP IPv6 %s\n", $http_ipv6?"ON ":"OFF");
logmsg sprintf("* FTP IPv6 %8s", $ftp_ipv6?"ON ":"OFF");
@@ -2790,6 +2791,11 @@ sub singletest {
next;
}
}
+ elsif($f eq "TrackMemory") {
+ if($has_memory_tracking) {
+ next;
+ }
+ }
elsif($f eq "large_file") {
if($large_file) {
next;
@@ -3064,7 +3070,7 @@ sub singletest {
# there was no command given, use something silly
$cmd="-";
}
- if($curl_debug) {
+ if($has_memory_tracking) {
unlink($memdump);
}
@@ -3659,9 +3665,9 @@ sub singletest {
return 1;
}
- if($curl_debug) {
+ if($has_memory_tracking) {
if(! -f $memdump) {
- logmsg "\n** ALERT! memory debugging with no output file?\n"
+ logmsg "\n** ALERT! memory tracking with no output file?\n"
if(!$cmdtype eq "perl");
}
else {