summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ctest_build
diff options
context:
space:
mode:
authorZack Galbreath <zack.galbreath@kitware.com>2020-09-24 17:41:15 (GMT)
committerZack Galbreath <zack.galbreath@kitware.com>2020-09-28 17:13:52 (GMT)
commitab9ad2a6a0addcb1366b68c0a28df7e1c9c9bc6f (patch)
tree468f7042c85c95f9b0b5c39b27094b9fd4facae1 /Tests/RunCMake/ctest_build
parent56e4e942d22bddc1662d5a3d057ab8246b805c32 (diff)
downloadCMake-ab9ad2a6a0addcb1366b68c0a28df7e1c9c9bc6f.zip
CMake-ab9ad2a6a0addcb1366b68c0a28df7e1c9c9bc6f.tar.gz
CMake-ab9ad2a6a0addcb1366b68c0a28df7e1c9c9bc6f.tar.bz2
ctest: report make-level errors to CDash when using launchers
Fixes: #19545
Diffstat (limited to 'Tests/RunCMake/ctest_build')
-rw-r--r--Tests/RunCMake/ctest_build/BuildCommandFailure-check.cmake12
-rw-r--r--Tests/RunCMake/ctest_build/BuildCommandFailure-result.txt1
-rw-r--r--Tests/RunCMake/ctest_build/BuildCommandFailure-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_build/RunCMakeTest.cmake6
4 files changed, 19 insertions, 1 deletions
diff --git a/Tests/RunCMake/ctest_build/BuildCommandFailure-check.cmake b/Tests/RunCMake/ctest_build/BuildCommandFailure-check.cmake
new file mode 100644
index 0000000..feac3ce
--- /dev/null
+++ b/Tests/RunCMake/ctest_build/BuildCommandFailure-check.cmake
@@ -0,0 +1,12 @@
+file(GLOB build_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Build.xml")
+if(build_xml_file)
+ file(READ "${build_xml_file}" build_xml LIMIT 4096)
+ if(NOT build_xml MATCHES [[this command failed]])
+ string(REPLACE "\n" "\n " build_xml " ${build_xml}")
+ set(RunCMake_TEST_FAILED
+ "Build.xml does not have expected error message:\n${build_xml}"
+ )
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "Build.xml not found")
+endif()
diff --git a/Tests/RunCMake/ctest_build/BuildCommandFailure-result.txt b/Tests/RunCMake/ctest_build/BuildCommandFailure-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_build/BuildCommandFailure-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_build/BuildCommandFailure-stderr.txt b/Tests/RunCMake/ctest_build/BuildCommandFailure-stderr.txt
new file mode 100644
index 0000000..bbe9410
--- /dev/null
+++ b/Tests/RunCMake/ctest_build/BuildCommandFailure-stderr.txt
@@ -0,0 +1 @@
+^Error\(s\) when building project
diff --git a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
index b2e562a..072fbac 100644
--- a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
@@ -48,8 +48,12 @@ function(run_BuildChangeId)
endfunction()
run_BuildChangeId()
-set(RunCMake_USE_LAUNCHERS FALSE)
set(RunCMake_USE_CUSTOM_BUILD_COMMAND TRUE)
+set(RunCMake_BUILD_COMMAND "${FAKE_BUILD_COMMAND_EXE}")
+run_ctest(BuildCommandFailure)
+unset(RunCMake_BUILD_COMMAND)
+
+set(RunCMake_USE_LAUNCHERS FALSE)
set(RunCMake_BUILD_COMMAND "${COLOR_WARNING}")
run_ctest(IgnoreColor)
unset(RunCMake_BUILD_COMMAND)