Commit d7955d4e authored by gaborbencze's avatar gaborbencze Committed by Kyle Edwards

Tests: Create test for SKIP_REGULAR_EXPRESSION test property

parent 4f1dec86
......@@ -120,6 +120,20 @@ set_tests_properties(test1 PROPERTIES FAIL_REGULAR_EXPRESSION \"foo;test1;bar\"
endfunction()
run_FailRegexFoundTest()
function(run_SkipRegexFoundTest)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SkipRegexFound)
set(RunCMake_TEST_NO_CLEAN 1)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\")
set_tests_properties(test1 PROPERTIES SKIP_REGULAR_EXPRESSION \"test1\")
")
run_cmake_command(SkipRegexFound ${CMAKE_CTEST_COMMAND} -V)
endfunction()
run_SkipRegexFoundTest()
function(run_SerialFailed)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SerialFailed)
set(RunCMake_TEST_NO_CLEAN 1)
......
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:
Skip regular expression found in output. Regex=[[]test1]")
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()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment