diff options
author | Orkun Tokdemir <ilhanorkuntokdemir@gmail.com> | 2023-09-07 12:29:49 (GMT) |
---|---|---|
committer | Orkun Tokdemir <ilhanorkuntokdemir@gmail.com> | 2023-09-11 12:51:58 (GMT) |
commit | e5358b9d8d1f284b6bd587bc6a84c3d6933edd5d (patch) | |
tree | 2a9f2d1c06a14216c8eee55fdce83065b3502464 /Tests/RunCMake | |
parent | b1cb23a011a8ffbcbb648abed36dc73491767ea5 (diff) | |
download | CMake-e5358b9d8d1f284b6bd587bc6a84c3d6933edd5d.zip CMake-e5358b9d8d1f284b6bd587bc6a84c3d6933edd5d.tar.gz CMake-e5358b9d8d1f284b6bd587bc6a84c3d6933edd5d.tar.bz2 |
RunCMake: Add RunCMake_TEST_NOT_EXPECT variables
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index bc4a330..4303ca0 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -53,6 +53,11 @@ function(run_cmake test) unset(expect_${o}) endif() endforeach() + foreach(o IN ITEMS stdout stderr config) + if(DEFINED RunCMake_TEST_NOT_EXPECT_${o}) + string(REGEX REPLACE "\n+$" "" not_expect_${o} "${RunCMake_TEST_NOT_EXPECT_${o}}") + endif() + endforeach() if (NOT expect_stderr) if (NOT RunCMake_DEFAULT_stderr) set(RunCMake_DEFAULT_stderr "^$") @@ -216,6 +221,11 @@ function(run_cmake test) string(APPEND msg "${o} does not match that expected.\n") endif() endif() + if(DEFINED not_expect_${o}) + if("${actual_${o}}" MATCHES "${not_expect_${o}}") + string(APPEND msg "${o} matches that not expected.\n") + endif() + endif() endforeach() unset(RunCMake_TEST_FAILED) if(RunCMake-check-file AND EXISTS ${top_src}/${RunCMake-check-file}) |