Skip to content

Commit a802b4b

Browse files
committed
[CMake] Never add current binary dir to command in ROOT_ADD_TEST
If a test added with `ROOT_ADD_TEST` uses a command that can't be found on the system and that is not an absolute path, the `ROOT_ADD_TEST` macro will implicitly prefix `$CMAKE_CURRENT_BINARY_DIR/`, assimum that the executable is supposed to be found in the current binary dir. However, that is not always a reasonable fallback, and can be even wrong if the executable was supposed to be found in the `PATH` that is set in the `ENVIRONMENT` for that test. So I think it's better to remove that fallback, requiring the tests to be explicit about which executable should be called.
1 parent 136e065 commit a802b4b

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

cmake/modules/RootMacros.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,9 +1542,6 @@ function(ROOT_ADD_TEST test)
15421542
find_program(_exe ${_prg})
15431543
if(_exe) # if the command is found in the system, use it
15441544
set(_cmd ${_exe} ${ARG_COMMAND})
1545-
elseif(NOT IS_ABSOLUTE ${_prg}) # if not absolute, assume is found in current binary dir
1546-
set(_prg ${CMAKE_CURRENT_BINARY_DIR}/${_prg})
1547-
set(_cmd ${_prg} ${ARG_COMMAND})
15481545
else() # take as it is
15491546
set(_cmd ${_prg} ${ARG_COMMAND})
15501547
endif()

0 commit comments

Comments
 (0)