Files
cmake/Tests/RunCMake/ctest_test/TestEnvironment-check.cmake
T
Daniel Pfeifer 508a72fc1c cmCTestRunTest: Don't modify the current environment
Instead, pass the environment variables to the child process.
2026-03-11 21:06:06 +01:00

11 lines
552 B
CMake

file(READ "${RunCMake_TEST_BINARY_DIR}/Testing/TAG" _tag)
string(REGEX REPLACE "^([^\n]*)\n.*$" "\\1" _date "${_tag}")
file(READ "${RunCMake_TEST_BINARY_DIR}/Testing/${_date}/Test.xml" _test_contents)
if(NOT _test_contents MATCHES "<Value>#CTEST_RESOURCE_GROUP_COUNT=\nENV1=env1\nENV2=env2</Value>")
string(APPEND RunCMake_TEST_FAILED "Could not find expected environment variables in Test.xml")
endif()
if(_test_contents MATCHES "BAD_ENVIRONMENT_VARIABLE")
string(APPEND RunCMake_TEST_FAILED "Found BAD_ENVIRONMENT_VARIABLE in Test.xml")
endif()