RunCMake: Add RunCMake_TEST_NOT_EXPECT variables

This commit is contained in:
Orkun Tokdemir
2023-09-07 14:29:49 +02:00
parent b1cb23a011
commit e5358b9d8d

View File

@@ -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})