← Commit list

02aa75a8c2

Daniel Stenberg
Daniel Stenberg
2025-11-28
SUCCESS Duration: 196s

Subject

runtests: allow a test to switch off memdebug

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

docs/tests/FILEFORMAT.md+4 -1
@@ -586,7 +586,7 @@ command has been run.
If the variable name has no assignment, no `=`, then that variable is just
deleted.
-### `<command [option="no-q/no-output/no-include/force-output/binary-trace"] [timeout="secs"][delay="secs"][type="perl/shell"]>`
+### `<command [option="no-q/no-output/no-include/no-memdebug/force-output/binary-trace"] [timeout="secs"][delay="secs"][type="perl/shell"]>`
Command line to run.
If the command spans multiple lines, they are concatenated with a space added
@@ -608,6 +608,9 @@ otherwise written to verify stdout.
Set `option="no-include"` to prevent the test script to slap on the
`--include` argument.
+Set `option="no-memdebug"` to make the test run without the memdebug tracking
+system. For tests that are incompatible - multi-threaded for example.
+
Set `option="no-q"` avoid using `-q` as the first argument in the curl command
line.
lib/memdebug.c+0 -2
@@ -111,8 +111,6 @@ void curl_dbg_memdebug(const char *logname)
if(!curl_dbg_logfile) {
if(logname && *logname)
curl_dbg_logfile = CURLX_FOPEN_LOW(logname, FOPEN_WRITETEXT);
- else
- curl_dbg_logfile = stderr;
#ifdef MEMDEBUG_LOG_SYNC
/* Flush the log file after every line so the log is not lost in a crash */
if(curl_dbg_logfile)
tests/data/test3207+1 -1
@@ -37,7 +37,7 @@ concurrent HTTPS GET using shared ssl session cache
lib%TESTNUMBER
</tool>
# provide URL and ca-cert
-<command>
+<command option="no-memdebug">
https://localhost:%HTTPSPORT/%TESTNUMBER %CERTDIR/certs/test-ca.crt
</command>
</client>
tests/runner.pm+11 -0
@@ -840,6 +840,7 @@ sub singletest_run {
$tool = $tool_name . exe_ext('TOOL');
}
+ my $oldmemdebug;
my $disablevalgrind;
my $CMDLINE="";
my $cmdargs;
@@ -1025,6 +1026,11 @@ sub singletest_run {
# timestamp starting of test command
$$testtimings{"timetoolini"} = Time::HiRes::time();
+ if($cmdhash{'option'} && ($cmdhash{'option'} =~ /no-memdebug/)) {
+ $oldmemdebug = $ENV{'CURL_MEMDEBUG'};
+ delete $ENV{'CURL_MEMDEBUG'};
+ }
+
# run the command line we built
if($torture) {
$cmdres = torture($CMDLINE,
@@ -1048,6 +1054,11 @@ sub singletest_run {
($cmdres, $dumped_core) = normalize_cmdres(runclient("$CMDLINE"));
}
+ # restore contents
+ if($oldmemdebug) {
+ $ENV{'CURL_MEMDEBUG'} = $oldmemdebug;
+ }
+
# timestamp finishing of test command
$$testtimings{"timetoolend"} = Time::HiRes::time();
tests/runtests.pl+4 -2
@@ -1763,8 +1763,10 @@ sub singletest_check {
if(! -f "$logdir/$MEMDUMP") {
my %cmdhash = getpartattr("client", "command");
my $cmdtype = $cmdhash{'type'} || "default";
- logmsg "\n** ALERT! memory tracking with no output file?\n"
- if($cmdtype ne "perl");
+ if($cmdhash{'option'} !~ /no-memdebug/) {
+ logmsg "\n** ALERT! memory tracking with no output file?\n"
+ if($cmdtype ne "perl");
+ }
$ok .= "-"; # problem with memory checking
}
else {