summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-19 18:21:28 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-01-19 18:21:36 (GMT)
commit5031934fb05181eb925b81f6747feaa8ffa27787 (patch)
treea0b9164df4469a3efa333166cadf477d76a294f6 /Tests
parente107fd0713c93f8b7d5be54552b51b1632b34f8c (diff)
parentf6ed2585e595305d4866e4128bf98e9236b6ecd2 (diff)
downloadCMake-5031934fb05181eb925b81f6747feaa8ffa27787.zip
CMake-5031934fb05181eb925b81f6747feaa8ffa27787.tar.gz
CMake-5031934fb05181eb925b81f6747feaa8ffa27787.tar.bz2
Merge topic 'configure-log'
f6ed2585e5 Modules: Record system inspection steps in the configure log 0f688386ea Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.log ecc26f98eb UsewxWidgets: Remove leftover debugging code 874c2e1198 FindQt4: Drop outdated advice to look at CMakeError.log on failure a80465bcad GHS: Drop debugging message from log 9199449687 CompileFeatures: Warn explicitly when feature detection binary is not found 24ccc8c3c9 CompilerId: Restore logging of failed identifications 95976514f6 Tests: Avoid using CMake{Output,Error}.log files Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8089
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CheckFortran.cmake1
-rw-r--r--Tests/CheckSwift.cmake1
-rw-r--r--Tests/FortranOnly/CMakeLists.txt22
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt1
-rw-r--r--Tests/RunCMake/Configure/ErrorLogs-stderr.txt4
-rw-r--r--Tests/RunCMake/Configure/ErrorLogs.cmake2
-rw-r--r--Tests/RunCMake/try_compile/CMP0128-common.cmake23
-rw-r--r--Tests/RunCMake/try_compile/ConfigureLog-config.txt18
-rw-r--r--Tests/RunCMake/try_compile/Inspect-config.txt27
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadName-config.txt12
-rw-r--r--Tests/RunCMake/try_run/ConfigureLog-config.txt18
-rw-r--r--Tests/SystemInformation/DumpInformation.cxx4
12 files changed, 106 insertions, 27 deletions
diff --git a/Tests/CheckFortran.cmake b/Tests/CheckFortran.cmake
index 36293f5..1e943a1 100644
--- a/Tests/CheckFortran.cmake
+++ b/Tests/CheckFortran.cmake
@@ -33,6 +33,7 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\"
RESULT_VARIABLE result
)
include(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckFortran/result.cmake OPTIONAL)
+ # FIXME: Replace with message(CONFIGURE_LOG) when CMake version is high enough.
if(CMAKE_Fortran_COMPILER AND "${result}" STREQUAL "0")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"${_desc} passed with the following output:\n"
diff --git a/Tests/CheckSwift.cmake b/Tests/CheckSwift.cmake
index 099c298..86ea603 100644
--- a/Tests/CheckSwift.cmake
+++ b/Tests/CheckSwift.cmake
@@ -42,6 +42,7 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\"
include(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckSwift/result.cmake
OPTIONAL)
+ # FIXME: Replace with message(CONFIGURE_LOG) when CMake version is high enough.
if(CMAKE_Swift_COMPILER AND "${result}" STREQUAL "0")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"${_desc} passed with the following output:\n"
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt
index b07c214..fc71a18 100644
--- a/Tests/FortranOnly/CMakeLists.txt
+++ b/Tests/FortranOnly/CMakeLists.txt
@@ -56,8 +56,6 @@ add_custom_target(checksayhello ALL
)
add_dependencies(checksayhello sayhello)
-set(err_log ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log)
-file(REMOVE "${err_log}")
include(CheckFortranSourceCompiles)
unset(HAVE_PRINT CACHE)
CHECK_Fortran_SOURCE_COMPILES([[
@@ -66,10 +64,24 @@ CHECK_Fortran_SOURCE_COMPILES([[
END
]] HAVE_PRINT)
if(NOT HAVE_PRINT)
- if(EXISTS "${err_log}")
- file(READ "${err_log}" err)
+ set(configure_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeConfigureLog.yaml")
+ if(EXISTS "${configure_log}")
+ file(READ "${configure_log}" log_content)
+ else()
+ set(log_content "")
+ endif()
+ if(log_content MATCHES [[( -
+ kind: "try_compile-v1"(
++ [^
+]+)+
+ checks:
+ - "Performing Test HAVE_PRINT"(
++ [^
+]+)+)]])
+ set(err "${CMAKE_MATCH_1}")
+ else()
+ set(err "")
endif()
- string(REPLACE "\n" "\n " err " ${err}")
message(SEND_ERROR "CHECK_Fortran_SOURCE_COMPILES for HAVE_PRINT failed:\n"
"${err}")
endif()
diff --git a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt
index 55bb894..da548a6 100644
--- a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt
+++ b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt
@@ -1,2 +1 @@
-- Configuring incomplete, errors occurred!
-See also ".*/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-build/CMakeFiles/CMakeOutput\.log".
diff --git a/Tests/RunCMake/Configure/ErrorLogs-stderr.txt b/Tests/RunCMake/Configure/ErrorLogs-stderr.txt
index 4eee45d..ec8c8c2 100644
--- a/Tests/RunCMake/Configure/ErrorLogs-stderr.txt
+++ b/Tests/RunCMake/Configure/ErrorLogs-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at ErrorLogs.cmake:3 \(message\):
+CMake Error at ErrorLogs.cmake:[0-9]+ \(message\):
Some error!
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Configure/ErrorLogs.cmake b/Tests/RunCMake/Configure/ErrorLogs.cmake
index e8cf062..3a9d107 100644
--- a/Tests/RunCMake/Configure/ErrorLogs.cmake
+++ b/Tests/RunCMake/Configure/ErrorLogs.cmake
@@ -1,3 +1,5 @@
+file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Some detailed output information!\n")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Some detailed error information!\n")
message(SEND_ERROR "Some error!")
diff --git a/Tests/RunCMake/try_compile/CMP0128-common.cmake b/Tests/RunCMake/try_compile/CMP0128-common.cmake
index 0b8a12b..64b1a77 100644
--- a/Tests/RunCMake/try_compile/CMP0128-common.cmake
+++ b/Tests/RunCMake/try_compile/CMP0128-common.cmake
@@ -1,10 +1,6 @@
cmake_policy(SET CMP0067 NEW)
enable_language(CXX)
-# Isolate the one try_compile below in the error log.
-set(CMakeError_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log")
-file(REMOVE "${CMakeError_log}")
-
# Add our own -std= flag to the try_compile check.
set(CMAKE_REQUIRED_FLAGS -std=c++11)
@@ -24,8 +20,21 @@ int main()
}
" SRC_COMPILED)
if(NOT SRC_COMPILED)
- if(EXISTS "${CMakeError_log}")
- file(READ "${CMakeError_log}" err_log)
+ message("Check failed to compile:")
+ set(configure_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeConfigureLog.yaml")
+ if(EXISTS "${configure_log}")
+ file(READ "${configure_log}" log_content)
+ else()
+ set(log_content "")
+ endif()
+ if(log_content MATCHES [[( -
+ kind: "try_compile-v1"(
++ [^
+]+)+
+ checks:
+ - "Performing Test SRC_COMPILED"(
++ [^
+]+)+)]])
+ message("${configure_log} contains:\n${CMAKE_MATCH_1}")
endif()
- message("${err_log}")
endif()
diff --git a/Tests/RunCMake/try_compile/ConfigureLog-config.txt b/Tests/RunCMake/try_compile/ConfigureLog-config.txt
index 262ed3c..1f848bf 100644
--- a/Tests/RunCMake/try_compile/ConfigureLog-config.txt
+++ b/Tests/RunCMake/try_compile/ConfigureLog-config.txt
@@ -1,6 +1,13 @@
^
---
-events:
+events:(
+ -
+ kind: "message-v1"
+ backtrace:(
+ - "[^"]+")+
+ message: \|(
++ [^
+]*)*)+
-
kind: "try_compile-v1"
backtrace:
@@ -17,7 +24,14 @@ events:
variable: "CMAKE_C_ABI_COMPILED"
cached: true
stdout: \|.*
- exitCode: 0
+ exitCode: 0(
+ -
+ kind: "message-v1"
+ backtrace:(
+ - "[^"]+")+
+ message: \|(
++ [^
+]*)*)*
-
kind: "try_compile-v1"
backtrace:
diff --git a/Tests/RunCMake/try_compile/Inspect-config.txt b/Tests/RunCMake/try_compile/Inspect-config.txt
index e09fe55..7a39335 100644
--- a/Tests/RunCMake/try_compile/Inspect-config.txt
+++ b/Tests/RunCMake/try_compile/Inspect-config.txt
@@ -1,6 +1,13 @@
^
---
-events:
+events:(
+ -
+ kind: "message-v1"
+ backtrace:(
+ - "[^"]+")+
+ message: \|(
++ [^
+]*)*)+
-
kind: "try_compile-v1"
backtrace:
@@ -17,7 +24,14 @@ events:
variable: "CMAKE_C_ABI_COMPILED"
cached: true
stdout: \|.*
- exitCode: 0
+ exitCode: 0(
+ -
+ kind: "message-v1"
+ backtrace:(
+ - "[^"]+")+
+ message: \|(
++ [^
+]*)*)+
-
kind: "try_compile-v1"
backtrace:
@@ -34,5 +48,12 @@ events:
variable: "CMAKE_CXX_ABI_COMPILED"
cached: true
stdout: \|.*
- exitCode: 0
+ exitCode: 0(
+ -
+ kind: "message-v1"
+ backtrace:(
+ - "[^"]+")+
+ message: \|(
++ [^
+]*)*)*
\.\.\.$
diff --git a/Tests/RunCMake/try_compile/SourceFromBadName-config.txt b/Tests/RunCMake/try_compile/SourceFromBadName-config.txt
index 10f3293..cb76565 100644
--- a/Tests/RunCMake/try_compile/SourceFromBadName-config.txt
+++ b/Tests/RunCMake/try_compile/SourceFromBadName-config.txt
@@ -1 +1,11 @@
-^$
+^
+---
+events:(
+ -
+ kind: "message-v1"
+ backtrace:(
+ - "[^"]+")+
+ message: \|(
++ [^
+]*)*)+
+\.\.\.$
diff --git a/Tests/RunCMake/try_run/ConfigureLog-config.txt b/Tests/RunCMake/try_run/ConfigureLog-config.txt
index ba396e0..bf3c3bd 100644
--- a/Tests/RunCMake/try_run/ConfigureLog-config.txt
+++ b/Tests/RunCMake/try_run/ConfigureLog-config.txt
@@ -1,6 +1,13 @@
^
---
-events:
+events:(
+ -
+ kind: "message-v1"
+ backtrace:(
+ - "[^"]+")+
+ message: \|(
++ [^
+]*)*)+
-
kind: "try_compile-v1"
backtrace:
@@ -16,7 +23,14 @@ events:
variable: "CMAKE_C_ABI_COMPILED"
cached: true
stdout: \|.*
- exitCode: 0
+ exitCode: 0(
+ -
+ kind: "message-v1"
+ backtrace:(
+ - "[^"]+")+
+ message: \|(
++ [^
+]*)*)*
-
kind: "try_run-v1"
backtrace:
diff --git a/Tests/SystemInformation/DumpInformation.cxx b/Tests/SystemInformation/DumpInformation.cxx
index f89a58f..913e4c4 100644
--- a/Tests/SystemInformation/DumpInformation.cxx
+++ b/Tests/SystemInformation/DumpInformation.cxx
@@ -63,13 +63,9 @@ int main(int, char*[])
DumpInformation_BINARY_DIR "/OtherProperties.txt",
DumpInformation_BINARY_DIR "/../../Source/cmConfigure.h",
DumpInformation_BINARY_DIR "/../../CMakeCache.txt",
- DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeOutput.log",
- DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeError.log",
DumpInformation_BINARY_DIR "/../../Bootstrap.cmk/cmake_bootstrap.log",
DumpInformation_BINARY_DIR "/../../Source/cmsys/Configure.hxx",
DumpInformation_BINARY_DIR "/../../Source/cmsys/Configure.h",
- DumpInformation_BINARY_DIR "/CMakeFiles/CMakeOutput.log",
- DumpInformation_BINARY_DIR "/CMakeFiles/CMakeError.log",
0
};