summaryrefslogtreecommitdiff
path: root/Tests/CTestUpdateCVS.cmake.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-10-19 11:53:01 -0400
committerBrad King <brad.king@kitware.com>2008-10-19 11:53:01 -0400
commit3584a4eceb8032c36a896952a87143fcf38d4ffb (patch)
tree509176ea42cb97b77eab6891aff0b8f81fca556a /Tests/CTestUpdateCVS.cmake.in
parent935e9849003c6d3296e41b37e798019023f97dd3 (diff)
downloadcmake-3584a4eceb8032c36a896952a87143fcf38d4ffb.tar.gz
ENH: Test CTest update logic with VCS tools
This creates new tests "CTest.UpdateSVN" and "CTest.UpdateCVS". They test that the Update.xml produced by CTest for a version-controlled project contains entries for files added, changed, and removed.
Diffstat (limited to 'Tests/CTestUpdateCVS.cmake.in')
-rw-r--r--Tests/CTestUpdateCVS.cmake.in114
1 files changed, 114 insertions, 0 deletions
diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in
new file mode 100644
index 0000000000..f1bfc30656
--- /dev/null
+++ b/Tests/CTestUpdateCVS.cmake.in
@@ -0,0 +1,114 @@
+# This script drives creation of a CVS repository and checks
+# that CTest can update from it.
+
+#-----------------------------------------------------------------------------
+# Test in a directory next to this script.
+get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
+set(TOP "${TOP}/@CTestUpdateCVS_DIR@")
+
+# Include code common to all update tests.
+include("@CMAKE_CURRENT_SOURCE_DIR@/CTestUpdateCommon.cmake")
+
+#-----------------------------------------------------------------------------
+# Report CVS tools in use.
+message("Using CVS tools:")
+set(CVS "@CVS_EXECUTABLE@")
+message(" cvs = ${CVS}")
+
+set(REPO ${TOP}/repo)
+set(CVSCMD ${CVS} -d${REPO})
+
+#-----------------------------------------------------------------------------
+# Initialize the testing directory.
+message("Creating test directory...")
+init_testing()
+
+#-----------------------------------------------------------------------------
+# Create the repository.
+message("Creating repository...")
+file(MAKE_DIRECTORY ${TOP}/repo)
+run_child(
+ COMMAND ${CVSCMD} init
+ )
+
+#-----------------------------------------------------------------------------
+# Import initial content into the repository.
+message("Importing content...")
+create_content(import)
+
+# Import the content into the repository.
+run_child(
+ WORKING_DIRECTORY ${TOP}/import
+ COMMAND ${CVSCMD} import -m "Initial content" Project vendor-tag release-tag
+ )
+
+#-----------------------------------------------------------------------------
+# Create a working tree.
+message("Checking out revision 1...")
+run_child(
+ WORKING_DIRECTORY ${TOP}
+ COMMAND ${CVSCMD} co -d user-source Project
+ )
+run_child(
+ WORKING_DIRECTORY ${TOP}/user-source
+ COMMAND ${CVSCMD} tag Revision1
+ )
+
+#-----------------------------------------------------------------------------
+# Make changes in the working tree.
+message("Changing content...")
+update_content(user-source files_added files_removed)
+run_child(
+ WORKING_DIRECTORY ${TOP}/user-source
+ COMMAND ${CVSCMD} add ${files_added}
+ )
+run_child(
+ WORKING_DIRECTORY ${TOP}/user-source
+ COMMAND ${CVSCMD} rm ${files_removed}
+ )
+
+#-----------------------------------------------------------------------------
+# Commit the changes to the repository.
+message("Committing revision 2...")
+run_child(
+ WORKING_DIRECTORY ${TOP}/user-source
+ COMMAND ${CVSCMD} commit -m "Changed content"
+ )
+
+#-----------------------------------------------------------------------------
+# Go back to before the changes so we can test updating.
+message("Backing up to revision 1...")
+run_child(
+ WORKING_DIRECTORY ${TOP}/user-source
+ COMMAND ${CVSCMD} up -rRevision1
+ )
+
+#-----------------------------------------------------------------------------
+# Test updating the user work directory with the command-line interface.
+message("Running CTest Dashboard Command Line...")
+
+# Create the user build tree.
+create_build_tree(user-source user-binary)
+file(APPEND ${TOP}/user-binary/CTestConfiguration.ini
+ "# CVS command configuration
+CVSCommand: ${CVS}
+CVSUpdateOptions: -dAP
+")
+
+# Run the dashboard command line interface.
+run_dashboard_command_line(user-binary)
+
+#-----------------------------------------------------------------------------
+# Test initial checkout and update with a dashboard script.
+message("Running CTest Dashboard Script...")
+
+create_dashboard_script(dashboard.cmake
+ "# CVS command configuration
+set(CTEST_CVS_COMMAND \"${CVS}\")
+set(CTEST_CVS_UPDATE_OPTIONS -dAP)
+set(CTEST_CHECKOUT_COMMAND
+ \"\\\"\${CTEST_CVS_COMMAND}\\\" -d \\\"${REPO}\\\" co -rRevision1 -d dash-source Project\")
+")
+
+# Run the dashboard script with CTest.
+run_dashboard_script(dashboard.cmake)