summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/Autogen/RunCMakeTest.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/Autogen/RunCMakeTest.cmake b/Tests/RunCMake/Autogen/RunCMakeTest.cmake
index 12a8f8e..5c2ea2b 100644
--- a/Tests/RunCMake/Autogen/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Autogen/RunCMakeTest.cmake
@@ -239,6 +239,16 @@ ${make_program_stderr}
endif()
endfunction()
+ function(expect_n_times string_to_check expected_output expected_count test_name)
+ count_substring("${string_to_check}" "${expected_output}" count)
+ if(NOT count EQUAL ${expected_count})
+ message(STATUS "${test_name}-expect_${expected_count}_times - FAILED")
+ message(FATAL_ERROR "Expected to find ${expected_output} exactly ${expected_count} times in ${string_to_check} but found ${count} occurrences of ${expected_output}")
+ else()
+ message(STATUS "${test_name}-expect_${expected_count}_times - PASSED")
+ endif()
+ endfunction()
+
function(not_expect make_program_stdout unexpected_output test_name)
count_substring("${make_program_stdout}" "${unexpected_output}" count)
if(NOT count EQUAL 0)