aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-10-29 09:12:47 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-10-29 09:12:47 +0000
commitffc6d062d806d7f8bb879f0f6173310948b3a6d5 (patch)
tree3881d82f3ac5c154ce249ae48f4b5c84c98ccbf5 /tests
parent757a7d085110d09ef24c040927ac3615207ce516 (diff)
now check for and use valgrind, inserted and modified the check for stunnel
and we no longer use the stunnel.pm
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runtests.pl29
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 70cd5a4cb..70688247f 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -57,7 +57,8 @@ my $memdump="memdump";
# the path to the script that analyzes the memory debug output file:
my $memanalyze="./memanalyze.pl";
-my $checkstunnel = &checkstunnel;
+my $checkstunnel = checkcmd("stunnel");
+my $checkvalgrind = checkcmd("valgrind");
my $ssl_version; # set if libcurl is built with SSL support
@@ -65,6 +66,12 @@ my $skipped=0; # number of tests skipped; reported in main loop
my %skipped; # skipped{reason}=counter, reasons for skip
my @teststat; # teststat[testnum]=reason, reasons for skip
+if($checkvalgrind) {
+ # we have found valgrind on the host, use it
+
+ # perhaps we should verify that valgrind works before we actually use it?
+ $CURL="valgrind --leak-check=yes --logfile-fd=3 -q $CURL";
+}
#######################################################################
# variables the command line options may set
#
@@ -106,6 +113,20 @@ foreach $protocol (('ftp', 'http', 'ftps', 'https', 'gopher', 'no')) {
}
#######################################################################
+# Check for a command in the PATH.
+#
+sub checkcmd {
+ my ($cmd)=@_;
+ my @paths=("/usr/sbin", "/usr/local/sbin", "/sbin", "/usr/bin",
+ "/usr/local/bin", split(":", $ENV{'PATH'}));
+ for(@paths) {
+ if( -x "$_/$cmd") {
+ return "$_/$cmd";
+ }
+ }
+}
+
+#######################################################################
# Return the pid of the server as found in the given pid file
#
sub serverpid {
@@ -578,7 +599,7 @@ sub checkcurl {
my $curl;
my $libcurl;
- my @version=`$CURL -V`;
+ my @version=`$CURL -V 2>/dev/null`;
for(@version) {
chomp;
@@ -635,6 +656,7 @@ sub checkcurl {
printf("* Server SSL: %s\n", $checkstunnel?"ON":"OFF");
printf("* libcurl SSL: %s\n", $ssl_version?"ON":"OFF");
printf("* libcurl debug: %s\n", $curl_debug?"ON":"OFF");
+ printf("* valgrind: %s\n", $checkvalgrind?"ON":"OFF");
print "***************************************** \n";
}
@@ -881,6 +903,9 @@ sub singletest {
$cmdargs .= " <$stdinfile";
}
+ if($checkvalgrind) {
+ $cmdargs .= " 3>log/valgrind$testnum";
+ }
my $CMDLINE;
if(!$tool) {