Skip to content

Commit

Permalink
tests: fix test 558, 1330 for MSVC, allow TrackMemory with MSVC in cmake
Browse files Browse the repository at this point in the history
Extend output filter to pick up backslashes. This makes them pass in CI
when run in the vcpkg MSVC job, for example.

Also:
- cmake: allow TrackMemory, aka `ENABLE_CURLDEBUG` again. Drop FIXME.
- cmake: drop stale TODO.
- runtests: include the word 'TrackMemory' in the message disabling it.

Follow-up to 9f23c8f curl#14541
Follow-up to 94c596b curl#16283

Closes curl#16289
  • Loading branch information
vszakats committed Feb 10, 2025
1 parent 71ace9f commit e9be5ff
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,6 @@ if(ENABLE_DEBUG)
endif()
option(ENABLE_CURLDEBUG "Enable TrackMemory debug feature" ${ENABLE_DEBUG})

if(MSVC)
set(ENABLE_CURLDEBUG OFF) # FIXME: TrackMemory + MSVC fails test 558 and 1330. Tested with static build, Debug mode.
endif()

if(ENABLE_DEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "DEBUGBUILD")
endif()
Expand Down Expand Up @@ -2196,7 +2192,6 @@ if(NOT CURL_DISABLE_INSTALL)

# curl-config needs the following options to be set.
set(CC "${CMAKE_C_COMPILER}")
# TODO: probably put a -D... options here?
set(CONFIGURE_OPTIONS "")
set(CURLVERSION "${_curl_version}")
set(VERSIONNUM "${_curl_version_num}")
Expand Down
2 changes: 1 addition & 1 deletion tests/data/test1330
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ MEM unit%TESTNUMBER.c: free()
s/ =.*//
s/\(.*\)/()/
s/:\d+/:/
s:^(MEM )(.*/)(.*):$1$3:
s:^(MEM )(.*[/\\])(.*):$1$3:
s/\r\n/\n/
s/^MEM getenv.c: realloc\(\)[\n]$//
s/^MEM getenv.c: free\(\)[\n]$//
Expand Down
2 changes: 1 addition & 1 deletion tests/data/test558
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ s/^MEM escape.c:\d+ free\(\(nil\)\)[\n]$//
s/ =.*//
s/\(.*\)/()/
s/:\d+/:/
s:^(MEM |FD )(.*/)(.*):$1$3:
s:^(MEM |FD )(.*[/\\])(.*):$1$3:
s/\r\n/\n/
s/^MEM getenv.c: realloc\(\)[\n]$//
s/^MEM getenv.c: free\(\)[\n]$//
Expand Down
2 changes: 1 addition & 1 deletion tests/runtests.pl
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ sub checksystemfeatures {
}
if($feature{"TrackMemory"} && $feature{"threaded-resolver"}) {
logmsg("*\n",
"*** DISABLES memory tracking when using threaded resolver\n",
"*** DISABLES TrackMemory (memory tracking) when using threaded resolver\n",
"*\n");
}

Expand Down

0 comments on commit e9be5ff

Please sign in to comment.