summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/CommandLine/E_env-equal.cmake
blob: 3f18bb65f7a6c8e6916b803bca92f20a728e6a0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if (NOT DEFINED ENV{TEST_ENV_EXPECTED})
    if (NOT DEFINED ENV{TEST_ENV})
        message(STATUS "TEST_ENV is correctly not set in environment")
    else ()
        message(FATAL_ERROR "TEST_ENV is incorrectly set in environment")
    endif ()
else ()
    if (NOT DEFINED ENV{TEST_ENV})
        message(FATAL_ERROR "TEST_ENV is incorrectly not set in environment")
    elseif ("$ENV{TEST_ENV}" STREQUAL "$ENV{TEST_ENV_EXPECTED}")
        message(STATUS "TEST_ENV is correctly set in environment: $ENV{TEST_ENV}")
    else ()
        message(FATAL_ERROR "TEST_ENV is incorrectly set in environment!\n\tactual: $ENV{TEST_ENV}\n\texpected: $ENV{TEST_ENV_EXPECTED}")
    endif ()
endif ()