You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
715 B
15 lines
715 B
3 years ago
|
function(test_environment_variable name expected_value)
|
||
|
string(REGEX MATCH "${name}=([^\n]*)" REGEX_RESULT "${actual_stdout}")
|
||
|
if(NOT REGEX_RESULT)
|
||
|
string(APPEND RunCMake_TEST_FAILED "Environment variable '${name}' is not defined.\n")
|
||
|
else()
|
||
|
set(actual_value "${CMAKE_MATCH_1}")
|
||
|
if(NOT "${actual_value}" MATCHES "${expected_value}")
|
||
|
string(REPLACE "\n" "\n " _actual "${expected_value}")
|
||
|
string(REPLACE "\n" "\n " _expect "${actual_value}")
|
||
|
string(APPEND RunCMake_TEST_FAILED "Expected value of environment variable '${name}':\n ${_expect}\nActual value:\n ${_actual}\n")
|
||
|
endif()
|
||
|
endif()
|
||
|
set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
|
||
|
endfunction()
|