When I explicitly set the CMake target property RUNTIME_OUTPUT_DIRECTORY for a unit test, the unit test view/plugin does not find the executable and tries to find it in $CMAKE_BINARY_DIR. In my CMakeLists.txt set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${my_project_SOURCE_DIRECTORY}/dist/bin") # setting up the test set_target_properties(test-my_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tests ) add_test(NAME test-my_test COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tests/test-my_test --gtest_output=xml:test-my_test_out.xml ) When running `make test` in the build directory manually: Running tests... /usr/bin/ctest --force-new-ctest-process Test project /home/USER/projects/my_project/build Start 1: test-my_test 1/1 Test #1: test-my_test .................. Passed 0.00 sec 100% tests passed, 0 tests failed out of 1 Total Test time (real) = 0.01 sec When running/clicking on the unit test in the unit test view I get a Process Error with "*** Could not start program '/home/USER/projects/my_project/build/tests/test-my_test --gtest_output=xml:test-my_test_out.xml'. Make sure that the path is specified correctly ***"
I'm experiencing this issue in 5.2.1 and it is quite annoying. Any thoughts on whether it would be a simple or difficult fix? It's not just unit tests but executable targets in general.
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version? If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone!