GoogleTest: when test executor is failing, only path of test executable is shown
In GoogleTestAddTests.cmake
:
68 execute_process(
69 COMMAND ${_TEST_EXECUTOR} "${_TEST_EXECUTABLE}" --gtest_list_tests
70 WORKING_DIRECTORY "${_TEST_WORKING_DIR}"
71 TIMEOUT ${_TEST_DISCOVERY_TIMEOUT}
72 OUTPUT_VARIABLE output
73 RESULT_VARIABLE result
74 )
75 if(NOT ${result} EQUAL 0)
76 string(REPLACE "\n" "\n " output "${output}")
77 message(FATAL_ERROR
78 "Error running test executable.\n"
79 " Path: '${_TEST_EXECUTABLE}'\n"
80 " Result: ${result}\n"
81 " Output:\n"
82 " ${output}\n"
83 )
84 endif()
Line 79 should be:
79 " Path: '${_TEST_EXECUTOR} ${_TEST_EXECUTABLE}'\n"
The current behaviour is, when the test executor fails, only the path of the test executable is shown, which is misleading for the user.
The expected behaviour would be to show both executor and executable paths, as shown above.