summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-26 14:32:37 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-08-26 14:33:08 (GMT)
commit7d89c5bf77ab00273d30a7e88a9ea85d55e34854 (patch)
tree1ce5c67753a8c56a706236a2bd287ceead2d2619 /Tests
parentf5a7ae0c4bcfa90fb530d69f9277290c5f947db2 (diff)
parent207926795971d260d602390fbd70e3cb78b4deb3 (diff)
downloadCMake-7d89c5bf77ab00273d30a7e88a9ea85d55e34854.zip
CMake-7d89c5bf77ab00273d30a7e88a9ea85d55e34854.tar.gz
CMake-7d89c5bf77ab00273d30a7e88a9ea85d55e34854.tar.bz2
Merge topic 'warnings_skip_color'
2079267959 ctest_build: ignore ANSI color Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3702
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/color_warning.c7
-rw-r--r--Tests/RunCMake/ctest_build/IgnoreColor-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_build/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/ctest_build/test.cmake.in5
5 files changed, 23 insertions, 2 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index c952b1a..0e93cf8 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -248,7 +248,8 @@ add_RunCMake_test(export)
add_RunCMake_test(cmake_minimum_required)
add_RunCMake_test(cmake_parse_arguments)
add_RunCMake_test(continue)
-add_RunCMake_test(ctest_build)
+add_executable(color_warning color_warning.c)
+add_RunCMake_test(ctest_build -DCOLOR_WARNING=$<TARGET_FILE:color_warning>)
add_RunCMake_test(ctest_cmake_error)
add_RunCMake_test(ctest_configure)
if(COVERAGE_COMMAND)
diff --git a/Tests/RunCMake/color_warning.c b/Tests/RunCMake/color_warning.c
new file mode 100644
index 0000000..831abd9
--- /dev/null
+++ b/Tests/RunCMake/color_warning.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+int main(void)
+{
+ printf(
+ "/tmp/hello.c:3:2: \033[35mwarning:\033[0m Hello, World! [-W#warnings]\n");
+ return 0;
+}
diff --git a/Tests/RunCMake/ctest_build/IgnoreColor-stdout.txt b/Tests/RunCMake/ctest_build/IgnoreColor-stdout.txt
new file mode 100644
index 0000000..cd1720f
--- /dev/null
+++ b/Tests/RunCMake/ctest_build/IgnoreColor-stdout.txt
@@ -0,0 +1,2 @@
+ 0 Compiler errors
+ 1 Compiler warnings
diff --git a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
index 1092d2a..b2e562a 100644
--- a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
@@ -1,6 +1,8 @@
include(RunCTest)
set(CASE_CTEST_BUILD_ARGS "")
+set(RunCMake_USE_LAUNCHERS TRUE)
+set(RunCMake_USE_CUSTOM_BUILD_COMMAND FALSE)
function(run_ctest_build CASE_NAME)
set(CASE_CTEST_BUILD_ARGS "${ARGN}")
@@ -45,3 +47,9 @@ function(run_BuildChangeId)
run_ctest(BuildChangeId)
endfunction()
run_BuildChangeId()
+
+set(RunCMake_USE_LAUNCHERS FALSE)
+set(RunCMake_USE_CUSTOM_BUILD_COMMAND TRUE)
+set(RunCMake_BUILD_COMMAND "${COLOR_WARNING}")
+run_ctest(IgnoreColor)
+unset(RunCMake_BUILD_COMMAND)
diff --git a/Tests/RunCMake/ctest_build/test.cmake.in b/Tests/RunCMake/ctest_build/test.cmake.in
index 6f15ec9..9f7fa13 100644
--- a/Tests/RunCMake/ctest_build/test.cmake.in
+++ b/Tests/RunCMake/ctest_build/test.cmake.in
@@ -9,7 +9,10 @@ set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
-set(CTEST_USE_LAUNCHERS TRUE)
+set(CTEST_USE_LAUNCHERS "@RunCMake_USE_LAUNCHERS@")
+if (@RunCMake_USE_CUSTOM_BUILD_COMMAND@)
+ set(CTEST_BUILD_COMMAND "\"@RunCMake_BUILD_COMMAND@\"")
+endif()
set(ctest_build_args "@CASE_CTEST_BUILD_ARGS@")
ctest_start(Experimental)