mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 04:40:56 -06:00
For pass regex, display only the element that was found, rather than all elements Rename loop variable for fail regex, from pass to fail For consistency, add space in output for pass Add tests that find and don't find PASS_REGULAR_EXPRESSION, and a test that finds FAIL_REGULAR_EXPRESSION, whose LastTest.log files are checked using *-check.cmake.
17 lines
655 B
CMake
17 lines
655 B
CMake
set(last_test_log "${RunCMake_TEST_BINARY_DIR}/Testing/Temporary/LastTest.log")
|
|
if(EXISTS "${last_test_log}")
|
|
file(READ "${last_test_log}" last_test_log_content)
|
|
string(REGEX REPLACE "\n+$" "" last_test_log_content "${last_test_log_content}")
|
|
if(NOT last_test_log_content MATCHES "
|
|
Test Pass Reason:
|
|
Required regular expression not found. Regex=[[]foo
|
|
toast1
|
|
bar
|
|
]")
|
|
string(REPLACE "\n" "\n " last_test_log_content " ${last_test_log_content}")
|
|
set(RunCMake_TEST_FAILED "LastTest.log does not have expected content:\n${last_test_log_content}")
|
|
endif()
|
|
else()
|
|
set(RunCMake_TEST_FAILED "LastTest.log missing:\n ${last_test_log}")
|
|
endif()
|