Skip to content

Commit 1538be6

Browse files
cy20linhorenmar
authored andcommitted
Respect path order of DL_PATHS in catch_discover_tests function
1 parent 9721048 commit 1538be6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

extras/CatchAddTests.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function(catch_discover_tests_impl)
3737
set(output_suffix ${_TEST_OUTPUT_SUFFIX})
3838
set(dl_paths ${_TEST_DL_PATHS})
3939
set(dl_framework_paths ${_TEST_DL_FRAMEWORK_PATHS})
40+
set(environment_modifications "")
4041
set(script)
4142
set(suite)
4243
set(tests)
@@ -57,7 +58,9 @@ function(catch_discover_tests_impl)
5758
endif()
5859

5960
if(dl_paths)
60-
cmake_path(CONVERT "${dl_paths}" TO_NATIVE_PATH_LIST paths)
61+
cmake_path(CONVERT "$ENV{${dl_paths_variable_name}}" TO_NATIVE_PATH_LIST env_dl_paths)
62+
list(PREPEND env_dl_paths "${dl_paths}")
63+
cmake_path(CONVERT "${env_dl_paths}" TO_NATIVE_PATH_LIST paths)
6164
set(ENV{${dl_paths_variable_name}} "${paths}")
6265
endif()
6366

@@ -123,7 +126,7 @@ function(catch_discover_tests_impl)
123126
if(dl_paths)
124127
foreach(path ${dl_paths})
125128
cmake_path(NATIVE_PATH path native_path)
126-
list(APPEND environment_modifications "${dl_paths_variable_name}=path_list_prepend:${native_path}")
129+
list(PREPEND environment_modifications "${dl_paths_variable_name}=path_list_prepend:${native_path}")
127130
endforeach()
128131
endif()
129132

0 commit comments

Comments
 (0)