summaryrefslogtreecommitdiffstats
path: root/Tests/CTestUpdateCVS.cmake.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-06-22 20:26:02 (GMT)
committerBrad King <brad.king@kitware.com>2009-06-22 20:26:02 (GMT)
commitdb024f444e6672951b1beed84c5dbf6de76b7e85 (patch)
tree981443cdea6256ccfb4c851a4dcd137474365aa3 /Tests/CTestUpdateCVS.cmake.in
parentd3679610c6b60ff442a3f467b47005ea7c3996c1 (diff)
downloadCMake-db024f444e6672951b1beed84c5dbf6de76b7e85.zip
CMake-db024f444e6672951b1beed84c5dbf6de76b7e85.tar.gz
CMake-db024f444e6672951b1beed84c5dbf6de76b7e85.tar.bz2
ENH: Auto-enable CTest.UpdateCVS test on Windows
The test needs to create a cvs repository with 'cvs init', but the CVSNT client on Windows needs 'cvs init -n' to avoid administrator access. Previously we required users to explicitly enable CTEST_TEST_UPDATE_CVS to activate the test on Windows. This teaches the test to use the '-n' option when necessary. Now we can enable the test in all cases except when trying to use a cygwin cvs.exe without cygwin paths.
Diffstat (limited to 'Tests/CTestUpdateCVS.cmake.in')
-rw-r--r--Tests/CTestUpdateCVS.cmake.in15
1 files changed, 14 insertions, 1 deletions
diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in
index e983c25..8ac0fa1 100644
--- a/Tests/CTestUpdateCVS.cmake.in
+++ b/Tests/CTestUpdateCVS.cmake.in
@@ -18,6 +18,19 @@ message(" cvs = ${CVS}")
set(REPO ${TOP}/repo)
set(CVSCMD ${CVS} -d${REPO})
+# CVSNT requires an extra option to 'cvs init'.
+set(CVS_INIT_OPT)
+execute_process(
+ COMMAND ${CVS} --version
+ RESULT_VARIABLE RESULT
+ OUTPUT_VARIABLE OUTPUT
+ ERROR_VARIABLE OUTPUT
+ )
+if("${RESULT}" STREQUAL "0" AND "${OUTPUT}" MATCHES "\\(CVSNT\\)")
+ set(CVS_INIT_OPT -n)
+ message(" cvs init needs -n")
+endif()
+
#-----------------------------------------------------------------------------
# Initialize the testing directory.
message("Creating test directory...")
@@ -28,7 +41,7 @@ init_testing()
message("Creating repository...")
file(MAKE_DIRECTORY ${TOP}/repo)
run_child(
- COMMAND ${CVSCMD} init
+ COMMAND ${CVSCMD} init ${CVS_INIT_OPT}
)
#-----------------------------------------------------------------------------