Skip to content

Commit

Permalink
Respect path order of DL_PATHS in catch_discover_tests function
Browse files Browse the repository at this point in the history
  • Loading branch information
cy20lin authored and horenmar committed Aug 13, 2024
1 parent 9721048 commit 1538be6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions extras/CatchAddTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function(catch_discover_tests_impl)
set(output_suffix ${_TEST_OUTPUT_SUFFIX})
set(dl_paths ${_TEST_DL_PATHS})
set(dl_framework_paths ${_TEST_DL_FRAMEWORK_PATHS})
set(environment_modifications "")
set(script)
set(suite)
set(tests)
Expand All @@ -57,7 +58,9 @@ function(catch_discover_tests_impl)
endif()

if(dl_paths)
cmake_path(CONVERT "${dl_paths}" TO_NATIVE_PATH_LIST paths)
cmake_path(CONVERT "$ENV{${dl_paths_variable_name}}" TO_NATIVE_PATH_LIST env_dl_paths)
list(PREPEND env_dl_paths "${dl_paths}")
cmake_path(CONVERT "${env_dl_paths}" TO_NATIVE_PATH_LIST paths)
set(ENV{${dl_paths_variable_name}} "${paths}")
endif()

Expand Down Expand Up @@ -123,7 +126,7 @@ function(catch_discover_tests_impl)
if(dl_paths)
foreach(path ${dl_paths})
cmake_path(NATIVE_PATH path native_path)
list(APPEND environment_modifications "${dl_paths_variable_name}=path_list_prepend:${native_path}")
list(PREPEND environment_modifications "${dl_paths_variable_name}=path_list_prepend:${native_path}")
endforeach()
endif()

Expand Down

0 comments on commit 1538be6

Please sign in to comment.