No, KDB_EXEC_PATH is not set for an installed kdb (unless the user sets it)
I just took the master version of Elektra and installed it. The file /usr/local/lib/elektra/tool_exec/check_meta contains the line:
export KDB_EXEC_PATH="/home/klemens/libelektra/build/bin:$KDB_EXEC_PATH"
Of course this doesn't affect testmod_* tests, but it is wrong nonetheless. I will create a new issue.
_Originally posted by @kodebach in https://github.com/ElektraInitiative/libelektra/issues/2856#issuecomment-554971666_
Setting KDB_EXEC_PATH in installed test scripts not necessarily wrong, but it should not contain the build directory. It wouldn't matter, if the build directory no longer exists. But tests could break, if the build directory contains different versions of the test scripts.
We should use a solution similar to the one that is used for the $KDB variable. It is only set to ${CMAKE_BINARY_DIR}/bin/kdb in the testscr_* variants of the tests, which are not installed.
Thank you for reporting this problem! I think its unrelated to check_meta in particular but it is in all tests (as it is done in tests/shell/include_common.sh.in).
I agree with @kodebach that we need to avoid this line completely for the installed scripts using a similar logic as we have for KDB.
@petermax2 do you maybe have time to fix this?
I think its unrelated to check_meta in particular but it is in all tests (as it is done in tests/shell/include_common.sh.in).
check_meta was just an example.
Maybe the line can be removed from there altogether and we simply set KDB_EXEC_PATH from within the environment of cmake/ctest as it is already done in tests/shell/shell_recorder/tutorial_wrapper/CMakeLists.txt
AFAIK CMake's add_test doesn't allow setting environment variables, we would have to wrap the test in a script or in an env call or something like that.
@kodebach is right! Setting the environment via add_msr_test does not work.
@petermax2 do you maybe have time to fix this?
Not so much. I will try to find a fix but I don't know when I'll be able to investigate further.
I will try to find a fix
@petermax2 thank you!