[Cmake-commits] [cmake-commits] king committed EnforceConfig.cmake.in 1.1 1.2
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon Nov 23 14:24:56 EST 2009
Update of /cvsroot/CMake/CMake/Tests
In directory public:/mounts/ram/cvs-serv24518/Tests
Modified Files:
EnforceConfig.cmake.in
Log Message:
Fake $HOME to isolate tests from user
On platforms with $HOME in the environment, some of our features use it
to store information in the user home directory. However, tests for
these features should not touch the real user home directory. Instead
we configure a fake $HOME that points inside the build tree for use
during testing.
See issue #9949.
Index: EnforceConfig.cmake.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/EnforceConfig.cmake.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** EnforceConfig.cmake.in 5 Jan 2009 19:14:25 -0000 1.1
--- EnforceConfig.cmake.in 23 Nov 2009 19:24:53 -0000 1.2
***************
*** 28,29 ****
--- 28,36 ----
MESSAGE("Guessing configuration ${CTEST_CONFIGURATION_TYPE}")
ENDIF(NOT CTEST_CONFIGURATION_TYPE AND CONFIG_REQUIRED)
+
+ # Fake a user home directory to avoid polluting the real one.
+ IF(DEFINED ENV{HOME})
+ SET(HOME "@CMake_BINARY_DIR@/Tests/CMakeFiles/TestHome")
+ FILE(MAKE_DIRECTORY "${HOME}")
+ SET(ENV{HOME} "${HOME}")
+ ENDIF(DEFINED ENV{HOME})
More information about the Cmake-commits
mailing list