mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-08 23:44:00 +03:00
set: Add test cases for setting ENV{VAR} to empty
The behavior differs by platform and if the variable is already set. Encode existing behavior in tests to preserve it until intentionally changed. Issue: #27285
This commit is contained in:
1 parent
a878d1c490
commit
20761cf349
4 files changed
+22
No files matched your search
@@ -0,0 +1,2 @@
|
||||
^-- ENV{UNSET_THEN_EMPTY} is not defined
|
||||
-- ENV{SET_THEN_EMPTY} is not defined$
|
||||
@@ -0,0 +1,2 @@
|
||||
^-- ENV{UNSET_THEN_EMPTY} is not defined
|
||||
-- ENV{SET_THEN_EMPTY} is defined to ''$
|
||||
@@ -0,0 +1,15 @@
|
||||
unset(ENV{UNSET_THEN_EMPTY})
|
||||
set(ENV{UNSET_THEN_EMPTY} "")
|
||||
if(DEFINED ENV{UNSET_THEN_EMPTY})
|
||||
message(STATUS "ENV{UNSET_THEN_EMPTY} is defined to '$ENV{UNSET_THEN_EMPTY}'")
|
||||
else()
|
||||
message(STATUS "ENV{UNSET_THEN_EMPTY} is not defined")
|
||||
endif()
|
||||
|
||||
set(ENV{SET_THEN_EMPTY} "set")
|
||||
set(ENV{SET_THEN_EMPTY} "")
|
||||
if(DEFINED ENV{SET_THEN_EMPTY})
|
||||
message(STATUS "ENV{SET_THEN_EMPTY} is defined to '$ENV{SET_THEN_EMPTY}'")
|
||||
else()
|
||||
message(STATUS "ENV{SET_THEN_EMPTY} is not defined")
|
||||
endif()
|
||||
@@ -12,3 +12,6 @@ run_cmake(CacheUnknownArguments)
|
||||
run_cmake(CacheMissingArguments)
|
||||
run_cmake(CacheWrongTYPE)
|
||||
run_cmake(CacheSetUnset)
|
||||
|
||||
# set(ENV{}) syntax
|
||||
run_cmake_script(Env)
|
||||
Reference in new issue
Block a user