summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/message
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-16 19:32:36 (GMT)
committerBrad King <brad.king@kitware.com>2023-01-18 16:37:11 (GMT)
commita78cba51978fbc805993604767c1902a249482ff (patch)
treeb4df0181bf56b68135e52c3745f60ab10c9d229c /Tests/RunCMake/message
parent645671d36f5cf0fa411d98a637f4edbc3d896c57 (diff)
downloadCMake-a78cba51978fbc805993604767c1902a249482ff.zip
CMake-a78cba51978fbc805993604767c1902a249482ff.tar.gz
CMake-a78cba51978fbc805993604767c1902a249482ff.tar.bz2
message: Add CONFIGURE_LOG mode to record a message in the configure log
Provide a replacement for `file(APPEND .../CMake{Output,Error}.log)` that records messages in the configure log. Issue: #23200
Diffstat (limited to 'Tests/RunCMake/message')
-rw-r--r--Tests/RunCMake/message/ConfigureLog-config.txt30
-rw-r--r--Tests/RunCMake/message/ConfigureLog-stdout.txt4
-rw-r--r--Tests/RunCMake/message/ConfigureLog.cmake7
-rw-r--r--Tests/RunCMake/message/ConfigureLogScript-config.txt1
-rw-r--r--Tests/RunCMake/message/ConfigureLogScript-stdout.txt4
-rw-r--r--Tests/RunCMake/message/ConfigureLogScript.cmake1
-rw-r--r--Tests/RunCMake/message/RunCMakeTest.cmake2
7 files changed, 49 insertions, 0 deletions
diff --git a/Tests/RunCMake/message/ConfigureLog-config.txt b/Tests/RunCMake/message/ConfigureLog-config.txt
new file mode 100644
index 0000000..49c12de
--- /dev/null
+++ b/Tests/RunCMake/message/ConfigureLog-config.txt
@@ -0,0 +1,30 @@
+^
+---
+events:
+ -
+ kind: "message-v1"
+ backtrace:
+ - "ConfigureLog.cmake:[0-9]+ \(message\)"
+ - "CMakeLists.txt:[0-9]+ \(include\)"
+ message: |
+ Message 0
+ -
+ kind: "message-v1"
+ backtrace:
+ - "ConfigureLog.cmake:[0-9]+ \(message\)"
+ - "CMakeLists.txt:[0-9]+ \(include\)"
+ checks:
+ - "Check 1"
+ message: |
+ Message 1
+ -
+ kind: "message-v1"
+ backtrace:
+ - "ConfigureLog.cmake:[0-9]+ \(message\)"
+ - "CMakeLists.txt:[0-9]+ \(include\)"
+ checks:
+ - "Check 2"
+ - "Check 1"
+ message: |
+ Message 2
+\.\.\.$
diff --git a/Tests/RunCMake/message/ConfigureLog-stdout.txt b/Tests/RunCMake/message/ConfigureLog-stdout.txt
new file mode 100644
index 0000000..ba32642
--- /dev/null
+++ b/Tests/RunCMake/message/ConfigureLog-stdout.txt
@@ -0,0 +1,4 @@
+-- Check 1
+-- Check 2
+-- Check 2 - passed
+-- Check 1 - passed
diff --git a/Tests/RunCMake/message/ConfigureLog.cmake b/Tests/RunCMake/message/ConfigureLog.cmake
new file mode 100644
index 0000000..6f2c1b0
--- /dev/null
+++ b/Tests/RunCMake/message/ConfigureLog.cmake
@@ -0,0 +1,7 @@
+message(CONFIGURE_LOG "Message 0")
+message(CHECK_START "Check 1")
+message(CONFIGURE_LOG "Message 1")
+message(CHECK_START "Check 2")
+message(CONFIGURE_LOG "Message 2")
+message(CHECK_PASS "passed")
+message(CHECK_PASS "passed")
diff --git a/Tests/RunCMake/message/ConfigureLogScript-config.txt b/Tests/RunCMake/message/ConfigureLogScript-config.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/message/ConfigureLogScript-config.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/message/ConfigureLogScript-stdout.txt b/Tests/RunCMake/message/ConfigureLogScript-stdout.txt
new file mode 100644
index 0000000..ba32642
--- /dev/null
+++ b/Tests/RunCMake/message/ConfigureLogScript-stdout.txt
@@ -0,0 +1,4 @@
+-- Check 1
+-- Check 2
+-- Check 2 - passed
+-- Check 1 - passed
diff --git a/Tests/RunCMake/message/ConfigureLogScript.cmake b/Tests/RunCMake/message/ConfigureLogScript.cmake
new file mode 100644
index 0000000..e1cd21b
--- /dev/null
+++ b/Tests/RunCMake/message/ConfigureLogScript.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/ConfigureLog.cmake")
diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake
index 1233838..c54e8f2 100644
--- a/Tests/RunCMake/message/RunCMakeTest.cmake
+++ b/Tests/RunCMake/message/RunCMakeTest.cmake
@@ -1,7 +1,9 @@
include(RunCMake)
+run_cmake_script(ConfigureLogScript)
run_cmake_script(newline)
+run_cmake(ConfigureLog)
run_cmake(defaultmessage)
run_cmake(nomessage)
run_cmake(message-internal-warning)