From 0418efb7added53ff83e0868d44ea8965ec15027 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 13 Jan 2023 11:27:52 -0500 Subject: Tests: Add explicit ConfigureLog case to RunCMake.try_compile --- Tests/RunCMake/try_compile/ConfigureLog-bad.c | 1 + Tests/RunCMake/try_compile/ConfigureLog-config.txt | 45 ++++++++++++++++++++++ Tests/RunCMake/try_compile/ConfigureLog-test.c | 4 ++ Tests/RunCMake/try_compile/ConfigureLog.cmake | 9 +++++ Tests/RunCMake/try_compile/RunCMakeTest.cmake | 1 + 5 files changed, 60 insertions(+) create mode 100644 Tests/RunCMake/try_compile/ConfigureLog-bad.c create mode 100644 Tests/RunCMake/try_compile/ConfigureLog-config.txt create mode 100644 Tests/RunCMake/try_compile/ConfigureLog-test.c create mode 100644 Tests/RunCMake/try_compile/ConfigureLog.cmake (limited to 'Tests') diff --git a/Tests/RunCMake/try_compile/ConfigureLog-bad.c b/Tests/RunCMake/try_compile/ConfigureLog-bad.c new file mode 100644 index 0000000000..6508eadd1d --- /dev/null +++ b/Tests/RunCMake/try_compile/ConfigureLog-bad.c @@ -0,0 +1 @@ +#error "This does not compile!" diff --git a/Tests/RunCMake/try_compile/ConfigureLog-config.txt b/Tests/RunCMake/try_compile/ConfigureLog-config.txt new file mode 100644 index 0000000000..6ed3bfe91a --- /dev/null +++ b/Tests/RunCMake/try_compile/ConfigureLog-config.txt @@ -0,0 +1,45 @@ +^ +--- +events: + - + kind: "try_compile-v1" + backtrace: + - "[^"]*/Modules/CMakeDetermineCompilerABI.cmake:[0-9]+ \(try_compile\)" + - "[^"]*/Modules/CMakeTestCCompiler.cmake:[0-9]+ \(CMAKE_DETERMINE_COMPILER_ABI\)" + - "ConfigureLog.cmake:[0-9]+ \(enable_language\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + directories: + source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" + binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" + buildResult: + variable: "CMAKE_C_ABI_COMPILED" + cached: true + stdout: \|.* + exitCode: 0 + - + kind: "try_compile-v1" + backtrace: + - "ConfigureLog.cmake:[0-9]+ \(try_compile\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + directories: + source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" + binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" + buildResult: + variable: "COMPILE_RESULT" + cached: true + stdout: \|.* + exitCode: [1-9][0-9]* + - + kind: "try_compile-v1" + backtrace: + - "ConfigureLog.cmake:[0-9]+ \(try_compile\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + directories: + source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" + binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" + buildResult: + variable: "COMPILE_RESULT" + cached: true + stdout: \|.* + exitCode: 0 +\.\.\.$ diff --git a/Tests/RunCMake/try_compile/ConfigureLog-test.c b/Tests/RunCMake/try_compile/ConfigureLog-test.c new file mode 100644 index 0000000000..8488f4e58f --- /dev/null +++ b/Tests/RunCMake/try_compile/ConfigureLog-test.c @@ -0,0 +1,4 @@ +int main(void) +{ + return 0; +} diff --git a/Tests/RunCMake/try_compile/ConfigureLog.cmake b/Tests/RunCMake/try_compile/ConfigureLog.cmake new file mode 100644 index 0000000000..f475014183 --- /dev/null +++ b/Tests/RunCMake/try_compile/ConfigureLog.cmake @@ -0,0 +1,9 @@ +enable_language(C) + +try_compile(COMPILE_RESULT + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-bad.c + ) + +try_compile(COMPILE_RESULT + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c + ) diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index ad1cc2903d..51ccac8c5e 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -15,6 +15,7 @@ run_cmake_with_options(Inspect ) include("${RunCMake_BINARY_DIR}/Inspect-build/info.cmake") +run_cmake(ConfigureLog) run_cmake(NoArgs) run_cmake(OneArg) run_cmake(TwoArgs) -- cgit v1.2.1 From 9d9e8450a872a4a9ec1a74cc7a73df100c32c7e8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 13 Jan 2023 11:19:29 -0500 Subject: try_compile: Add optional LOG_DESCRIPTION to record in configure log Issue: #23200 --- Tests/RunCMake/try_compile/ConfigureLog-config.txt | 2 ++ Tests/RunCMake/try_compile/ConfigureLog.cmake | 2 ++ Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt | 8 ++++++++ Tests/RunCMake/try_compile/EmptyValueArgs.cmake | 3 +++ Tests/RunCMake/try_compile/NoLogDescription-result.txt | 1 + Tests/RunCMake/try_compile/NoLogDescription-stderr.txt | 7 +++++++ Tests/RunCMake/try_compile/NoLogDescription.cmake | 4 ++++ Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake | 1 + Tests/RunCMake/try_run/ConfigureLog-config.txt | 2 ++ Tests/RunCMake/try_run/ConfigureLog.cmake | 2 ++ 10 files changed, 32 insertions(+) create mode 100644 Tests/RunCMake/try_compile/NoLogDescription-result.txt create mode 100644 Tests/RunCMake/try_compile/NoLogDescription-stderr.txt create mode 100644 Tests/RunCMake/try_compile/NoLogDescription.cmake (limited to 'Tests') diff --git a/Tests/RunCMake/try_compile/ConfigureLog-config.txt b/Tests/RunCMake/try_compile/ConfigureLog-config.txt index 6ed3bfe91a..caf8a719f7 100644 --- a/Tests/RunCMake/try_compile/ConfigureLog-config.txt +++ b/Tests/RunCMake/try_compile/ConfigureLog-config.txt @@ -21,6 +21,7 @@ events: backtrace: - "ConfigureLog.cmake:[0-9]+ \(try_compile\)" - "CMakeLists.txt:[0-9]+ \(include\)" + description: "Source that should not compile\." directories: source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" @@ -34,6 +35,7 @@ events: backtrace: - "ConfigureLog.cmake:[0-9]+ \(try_compile\)" - "CMakeLists.txt:[0-9]+ \(include\)" + description: "Source that should compile\." directories: source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" diff --git a/Tests/RunCMake/try_compile/ConfigureLog.cmake b/Tests/RunCMake/try_compile/ConfigureLog.cmake index f475014183..4502d24f0a 100644 --- a/Tests/RunCMake/try_compile/ConfigureLog.cmake +++ b/Tests/RunCMake/try_compile/ConfigureLog.cmake @@ -2,8 +2,10 @@ enable_language(C) try_compile(COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-bad.c + LOG_DESCRIPTION "Source that should not compile." ) try_compile(COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c + LOG_DESCRIPTION "Source that should compile." ) diff --git a/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt b/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt index b1344bd43d..b03e0b3568 100644 --- a/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt +++ b/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt @@ -7,3 +7,11 @@ CMake Error at EmptyValueArgs.cmake:[0-9]+ \(try_compile\): COPY_FILE_ERROR must be followed by a variable name Call Stack \(most recent call first\): CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at EmptyValueArgs.cmake:[0-9]+ \(try_compile\): + Error after keyword "LOG_DESCRIPTION": + + empty string not allowed + +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/try_compile/EmptyValueArgs.cmake b/Tests/RunCMake/try_compile/EmptyValueArgs.cmake index fda4f10232..f0052c5333 100644 --- a/Tests/RunCMake/try_compile/EmptyValueArgs.cmake +++ b/Tests/RunCMake/try_compile/EmptyValueArgs.cmake @@ -5,3 +5,6 @@ try_compile(RESULT ${try_compile_bindir_or_SOURCES} try_compile(RESULT ${try_compile_bindir_or_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/src.c COPY_FILE "x" COPY_FILE_ERROR "") +try_compile(RESULT ${try_compile_bindir_or_SOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/src.c + LOG_DESCRIPTION "") diff --git a/Tests/RunCMake/try_compile/NoLogDescription-result.txt b/Tests/RunCMake/try_compile/NoLogDescription-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/try_compile/NoLogDescription-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoLogDescription-stderr.txt b/Tests/RunCMake/try_compile/NoLogDescription-stderr.txt new file mode 100644 index 0000000000..9005bcd877 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoLogDescription-stderr.txt @@ -0,0 +1,7 @@ +CMake Error at NoLogDescription.cmake:[0-9]+ \(try_compile\): + Error after keyword "LOG_DESCRIPTION": + + missing required value + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoLogDescription.cmake b/Tests/RunCMake/try_compile/NoLogDescription.cmake new file mode 100644 index 0000000000..904763f6a8 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoLogDescription.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_SOURCE_DIR}/${try_compile_DEFS}) +try_compile(RESULT ${try_compile_bindir_or_SOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/src.c + LOG_DESCRIPTION) diff --git a/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake b/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake index 3158e327fb..0e4cc20192 100644 --- a/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake +++ b/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake @@ -12,6 +12,7 @@ run_cmake(NoCopyFile) run_cmake(NoCopyFile2) run_cmake(NoCopyFileError) run_cmake(NoCStandard) +run_cmake(NoLogDescription) run_cmake(NoOutputVariable) run_cmake(NoOutputVariable2) run_cmake(BadLinkLibraries) diff --git a/Tests/RunCMake/try_run/ConfigureLog-config.txt b/Tests/RunCMake/try_run/ConfigureLog-config.txt index 602437e264..18903d8a93 100644 --- a/Tests/RunCMake/try_run/ConfigureLog-config.txt +++ b/Tests/RunCMake/try_run/ConfigureLog-config.txt @@ -20,6 +20,7 @@ events: backtrace: - "ConfigureLog.cmake:[0-9]+ \(try_run\)" - "CMakeLists.txt:[0-9]+ \(include\)" + description: "Source that should not compile\." directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" @@ -36,6 +37,7 @@ events: backtrace: - "ConfigureLog.cmake:[0-9]+ \(try_run\)" - "CMakeLists.txt:[0-9]+ \(include\)" + description: "Source that should compile\." directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" diff --git a/Tests/RunCMake/try_run/ConfigureLog.cmake b/Tests/RunCMake/try_run/ConfigureLog.cmake index 4b5c7cb734..8a4b8a78df 100644 --- a/Tests/RunCMake/try_run/ConfigureLog.cmake +++ b/Tests/RunCMake/try_run/ConfigureLog.cmake @@ -1,9 +1,11 @@ try_run(RUN_RESULT COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-bad.c + LOG_DESCRIPTION "Source that should not compile." ) try_run(RUN_RESULT COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c + LOG_DESCRIPTION "Source that should compile." ) try_run(RUN_RESULT COMPILE_RESULT -- cgit v1.2.1 From d4bf7d80c618930e6b88c35d271a5b0a0656bb7b Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 Jan 2023 11:49:35 -0500 Subject: try_compile: Add a NO_LOG option to skip recording in the configure log --- Tests/RunCMake/try_compile/ConfigureLog.cmake | 5 +++++ Tests/RunCMake/try_run/ConfigureLog.cmake | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'Tests') diff --git a/Tests/RunCMake/try_compile/ConfigureLog.cmake b/Tests/RunCMake/try_compile/ConfigureLog.cmake index 4502d24f0a..511ade93d9 100644 --- a/Tests/RunCMake/try_compile/ConfigureLog.cmake +++ b/Tests/RunCMake/try_compile/ConfigureLog.cmake @@ -5,6 +5,11 @@ try_compile(COMPILE_RESULT LOG_DESCRIPTION "Source that should not compile." ) +try_compile(COMPILE_RESULT + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c + NO_LOG + ) + try_compile(COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c LOG_DESCRIPTION "Source that should compile." diff --git a/Tests/RunCMake/try_run/ConfigureLog.cmake b/Tests/RunCMake/try_run/ConfigureLog.cmake index 8a4b8a78df..e39310cd73 100644 --- a/Tests/RunCMake/try_run/ConfigureLog.cmake +++ b/Tests/RunCMake/try_run/ConfigureLog.cmake @@ -3,6 +3,11 @@ try_run(RUN_RESULT COMPILE_RESULT LOG_DESCRIPTION "Source that should not compile." ) +try_run(RUN_RESULT COMPILE_RESULT + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c + NO_LOG + ) + try_run(RUN_RESULT COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c LOG_DESCRIPTION "Source that should compile." -- cgit v1.2.1 From 48292c8624b901a842b6d4f8a88ca00f898e5639 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 13 Jan 2023 11:55:56 -0500 Subject: try_compile: Record stack of in-progess checks in configure log Many `try_compile` and `try_run` calls occur inside check modules between `message(CHECK_START)` and `message(CHECK_{PASS,FAIL})` pairs. Add a field to configure log entries to report this context. Issue: #23200 --- Tests/RunCMake/try_compile/ConfigureLog-config.txt | 5 +++++ Tests/RunCMake/try_compile/ConfigureLog-stdout.txt | 4 ++++ Tests/RunCMake/try_compile/ConfigureLog.cmake | 9 +++++++++ Tests/RunCMake/try_compile/Inspect-config.txt | 4 ++++ Tests/RunCMake/try_run/ConfigureLog-config.txt | 7 +++++++ Tests/RunCMake/try_run/ConfigureLog-stdout.txt | 4 ++++ Tests/RunCMake/try_run/ConfigureLog.cmake | 9 +++++++++ 7 files changed, 42 insertions(+) create mode 100644 Tests/RunCMake/try_compile/ConfigureLog-stdout.txt create mode 100644 Tests/RunCMake/try_run/ConfigureLog-stdout.txt (limited to 'Tests') diff --git a/Tests/RunCMake/try_compile/ConfigureLog-config.txt b/Tests/RunCMake/try_compile/ConfigureLog-config.txt index caf8a719f7..262ed3c3d2 100644 --- a/Tests/RunCMake/try_compile/ConfigureLog-config.txt +++ b/Tests/RunCMake/try_compile/ConfigureLog-config.txt @@ -8,6 +8,8 @@ events: - "[^"]*/Modules/CMakeTestCCompiler.cmake:[0-9]+ \(CMAKE_DETERMINE_COMPILER_ABI\)" - "ConfigureLog.cmake:[0-9]+ \(enable_language\)" - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Detecting C compiler ABI info" directories: source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" @@ -35,6 +37,9 @@ events: backtrace: - "ConfigureLog.cmake:[0-9]+ \(try_compile\)" - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Check 2" + - "Check 1" description: "Source that should compile\." directories: source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" diff --git a/Tests/RunCMake/try_compile/ConfigureLog-stdout.txt b/Tests/RunCMake/try_compile/ConfigureLog-stdout.txt new file mode 100644 index 0000000000..ba326428c5 --- /dev/null +++ b/Tests/RunCMake/try_compile/ConfigureLog-stdout.txt @@ -0,0 +1,4 @@ +-- Check 1 +-- Check 2 +-- Check 2 - passed +-- Check 1 - passed diff --git a/Tests/RunCMake/try_compile/ConfigureLog.cmake b/Tests/RunCMake/try_compile/ConfigureLog.cmake index 511ade93d9..294e0f9cf8 100644 --- a/Tests/RunCMake/try_compile/ConfigureLog.cmake +++ b/Tests/RunCMake/try_compile/ConfigureLog.cmake @@ -10,7 +10,16 @@ try_compile(COMPILE_RESULT NO_LOG ) +message(CHECK_START "Check 1") +message(CHECK_START "Check 2") try_compile(COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c LOG_DESCRIPTION "Source that should compile." ) +if (COMPILE_RESULT) + message(CHECK_PASS "passed") + message(CHECK_PASS "passed") +else() + message(CHECK_FAIL "failed") + message(CHECK_FAIL "failed") +endif() diff --git a/Tests/RunCMake/try_compile/Inspect-config.txt b/Tests/RunCMake/try_compile/Inspect-config.txt index 47169cfb80..e09fe55c3b 100644 --- a/Tests/RunCMake/try_compile/Inspect-config.txt +++ b/Tests/RunCMake/try_compile/Inspect-config.txt @@ -8,6 +8,8 @@ events: - "[^"]*/Modules/CMakeTestCCompiler.cmake:[0-9]+ \(CMAKE_DETERMINE_COMPILER_ABI\)" - "Inspect.cmake:[0-9]+ \(enable_language\)" - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Detecting C compiler ABI info" directories: source: "[^"]*/Tests/RunCMake/try_compile/Inspect-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_compile/Inspect-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" @@ -23,6 +25,8 @@ events: - "[^"]*/Modules/CMakeTestCXXCompiler.cmake:[0-9]+ \(CMAKE_DETERMINE_COMPILER_ABI\)" - "Inspect.cmake:[0-9]+ \(enable_language\)" - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Detecting CXX compiler ABI info" directories: source: "[^"]*/Tests/RunCMake/try_compile/Inspect-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_compile/Inspect-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" diff --git a/Tests/RunCMake/try_run/ConfigureLog-config.txt b/Tests/RunCMake/try_run/ConfigureLog-config.txt index 18903d8a93..ba396e03f7 100644 --- a/Tests/RunCMake/try_run/ConfigureLog-config.txt +++ b/Tests/RunCMake/try_run/ConfigureLog-config.txt @@ -7,6 +7,8 @@ events: - "[^"]*/Modules/CMakeDetermineCompilerABI.cmake:[0-9]+ \(try_compile\)" - "[^"]*/Modules/CMakeTestCCompiler.cmake:[0-9]+ \(CMAKE_DETERMINE_COMPILER_ABI\)" - "CMakeLists.txt:[0-9]+ \(project\)" + checks: + - "Detecting C compiler ABI info" directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" @@ -37,6 +39,8 @@ events: backtrace: - "ConfigureLog.cmake:[0-9]+ \(try_run\)" - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Check 1" description: "Source that should compile\." directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" @@ -59,6 +63,9 @@ events: backtrace: - "ConfigureLog.cmake:[0-9]+ \(try_run\)" - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Check 2" + - "Check 1" directories: source: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" binary: "[^"]*/Tests/RunCMake/try_run/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+" diff --git a/Tests/RunCMake/try_run/ConfigureLog-stdout.txt b/Tests/RunCMake/try_run/ConfigureLog-stdout.txt new file mode 100644 index 0000000000..ba326428c5 --- /dev/null +++ b/Tests/RunCMake/try_run/ConfigureLog-stdout.txt @@ -0,0 +1,4 @@ +-- Check 1 +-- Check 2 +-- Check 2 - passed +-- Check 1 - passed diff --git a/Tests/RunCMake/try_run/ConfigureLog.cmake b/Tests/RunCMake/try_run/ConfigureLog.cmake index e39310cd73..6635d73128 100644 --- a/Tests/RunCMake/try_run/ConfigureLog.cmake +++ b/Tests/RunCMake/try_run/ConfigureLog.cmake @@ -8,15 +8,24 @@ try_run(RUN_RESULT COMPILE_RESULT NO_LOG ) +message(CHECK_START "Check 1") try_run(RUN_RESULT COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c LOG_DESCRIPTION "Source that should compile." ) +message(CHECK_START "Check 2") try_run(RUN_RESULT COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c RUN_OUTPUT_VARIABLE RUN_OUTPUT ) +if (RUN_RESULT) + message(CHECK_PASS "passed") + message(CHECK_PASS "passed") +else() + message(CHECK_FAIL "failed") + message(CHECK_FAIL "failed") +endif() try_run(RUN_RESULT COMPILE_RESULT SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c -- cgit v1.2.1