runtests: assume a newer Valgrind by default

The tests for an older Valgrind version should probably just be deleted,
given that they're testing for an 18-year-old version.
This commit is contained in:
Dan Fandrich 2023-04-14 16:11:58 -07:00
Родитель 390af1ed5e
Коммит 43b876d7df
2 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -64,8 +64,8 @@ use globalconfig;
####################################################################### #######################################################################
# Global variables set elsewhere but used only by this package # Global variables set elsewhere but used only by this package
our $DBGCURL=$CURL; #"../src/.libs/curl"; # alternative for debugging our $DBGCURL=$CURL; #"../src/.libs/curl"; # alternative for debugging
our $valgrind_logfile="--logfile"; # the option name for valgrind 2.X our $valgrind_logfile="--log-file"; # the option name for valgrind >=3
our $valgrind_tool; our $valgrind_tool="--tool=memcheck";
our $gdb = checktestcmd("gdb"); our $gdb = checktestcmd("gdb");
our $gdbthis; # run test case with gdb debugger our $gdbthis; # run test case with gdb debugger
our $gdbxwin; # use windowed gdb when using gdb our $gdbxwin; # use windowed gdb when using gdb

Просмотреть файл

@ -2329,9 +2329,11 @@ if($valgrind) {
# since valgrind 2.1.x, '--tool' option is mandatory # since valgrind 2.1.x, '--tool' option is mandatory
# use it, if it is supported by the version installed on the system # use it, if it is supported by the version installed on the system
# (this happened in 2003, so we could probably don't need to care about
# that old version any longer and just delete this check)
runclient("valgrind --help 2>&1 | grep -- --tool > /dev/null 2>&1"); runclient("valgrind --help 2>&1 | grep -- --tool > /dev/null 2>&1");
if (($? >> 8)==0) { if (($? >> 8)) {
$valgrind_tool="--tool=memcheck"; $valgrind_tool="";
} }
open(my $curlh, "<", "$CURL"); open(my $curlh, "<", "$CURL");
my $l = <$curlh>; my $l = <$curlh>;
@ -2342,14 +2344,16 @@ if($valgrind) {
close($curlh); close($curlh);
# valgrind 3 renamed the --logfile option to --log-file!!! # valgrind 3 renamed the --logfile option to --log-file!!!
# (this happened in 2005, so we could probably don't need to care about
# that old version any longer and just delete this check)
my $ver=join(' ', runclientoutput("valgrind --version")); my $ver=join(' ', runclientoutput("valgrind --version"));
# cut off all but digits and dots # cut off all but digits and dots
$ver =~ s/[^0-9.]//g; $ver =~ s/[^0-9.]//g;
if($ver =~ /^(\d+)/) { if($ver =~ /^(\d+)/) {
$ver = $1; $ver = $1;
if($ver >= 3) { if($ver < 3) {
$valgrind_logfile="--log-file"; $valgrind_logfile="--logfile";
} }
} }
} }