summaryrefslogtreecommitdiffstats
path: root/Modules/GoogleTestAddTests.cmake
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2017-11-30 19:18:56 (GMT)
committerMatthew Woehlke <matthew.woehlke@kitware.com>2017-11-30 20:07:52 (GMT)
commite99e39829ba36dbfad189a94062363343d7d3d8b (patch)
tree6996b2737a82664f938a46ecfaec312d1658907d /Modules/GoogleTestAddTests.cmake
parentc2019d7c0c9156ee78323ef0fc6bbeabe1c22192 (diff)
downloadCMake-e99e39829ba36dbfad189a94062363343d7d3d8b.zip
CMake-e99e39829ba36dbfad189a94062363343d7d3d8b.tar.gz
CMake-e99e39829ba36dbfad189a94062363343d7d3d8b.tar.bz2
GoogleTest: Improve gtest_discover_tests messages
Adjust the formatting of error messages produced when test discovery goes wrong, in order to avoid spurious line breaking.
Diffstat (limited to 'Modules/GoogleTestAddTests.cmake')
-rw-r--r--Modules/GoogleTestAddTests.cmake10
1 files changed, 7 insertions, 3 deletions
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
index 7d0d909..6424d56 100644
--- a/Modules/GoogleTestAddTests.cmake
+++ b/Modules/GoogleTestAddTests.cmake
@@ -24,7 +24,8 @@ endfunction()
# Run test executable to get list of available tests
if(NOT EXISTS "${TEST_EXECUTABLE}")
message(FATAL_ERROR
- "Specified test executable '${TEST_EXECUTABLE}' does not exist"
+ "Specified test executable does not exist.\n"
+ " Path: '${TEST_EXECUTABLE}'"
)
endif()
execute_process(
@@ -33,10 +34,13 @@ execute_process(
RESULT_VARIABLE result
)
if(NOT ${result} EQUAL 0)
+ string(REPLACE "\n" "\n " output "${output}")
message(FATAL_ERROR
- "Error running test executable '${TEST_EXECUTABLE}':\n"
+ "Error running test executable.\n"
+ " Path: '${TEST_EXECUTABLE}'\n"
" Result: ${result}\n"
- " Output: ${output}\n"
+ " Output:\n"
+ " ${output}\n"
)
endif()