summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-06-15 18:10:41 (GMT)
committerBrad King <brad.king@kitware.com>2010-06-15 18:10:41 (GMT)
commitb4aa834900f30fb7a2dc1148ba9e947a5bd98ee1 (patch)
tree27a91488ee0459b769a11ea4bc348f2b377d558e /Tests
parenta8a10d0f6a6f19170f38a91e51a283af885fb79b (diff)
parentc3781efb28a35f54ed6306354330734994f2c8b1 (diff)
downloadCMake-b4aa834900f30fb7a2dc1148ba9e947a5bd98ee1.zip
CMake-b4aa834900f30fb7a2dc1148ba9e947a5bd98ee1.tar.gz
CMake-b4aa834900f30fb7a2dc1148ba9e947a5bd98ee1.tar.bz2
Merge branch 'ctest-git-flexibility'
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CTestUpdateBZR.cmake.in4
-rw-r--r--Tests/CTestUpdateCVS.cmake.in4
-rw-r--r--Tests/CTestUpdateCommon.cmake18
-rw-r--r--Tests/CTestUpdateGIT.cmake.in59
-rwxr-xr-xTests/CTestUpdateGIT.sh.in2
-rw-r--r--Tests/CTestUpdateHG.cmake.in4
-rw-r--r--Tests/CTestUpdateSVN.cmake.in4
7 files changed, 68 insertions, 27 deletions
diff --git a/Tests/CTestUpdateBZR.cmake.in b/Tests/CTestUpdateBZR.cmake.in
index 7f90b50..c654f47 100644
--- a/Tests/CTestUpdateBZR.cmake.in
+++ b/Tests/CTestUpdateBZR.cmake.in
@@ -142,7 +142,7 @@ 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
+create_dashboard_script(dash-binary
"# bzr command configuration
set(CTEST_BZR_COMMAND \"${BZR}\")
set(CTEST_CHECKOUT_COMMAND
@@ -150,4 +150,4 @@ set(CTEST_CHECKOUT_COMMAND
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in
index 6f31a2c..a04673e 100644
--- a/Tests/CTestUpdateCVS.cmake.in
+++ b/Tests/CTestUpdateCVS.cmake.in
@@ -147,7 +147,7 @@ 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
+create_dashboard_script(dash-binary
"# CVS command configuration
set(CTEST_CVS_COMMAND \"${CVS}\")
set(CTEST_CVS_UPDATE_OPTIONS -dAP)
@@ -156,4 +156,4 @@ set(CTEST_CHECKOUT_COMMAND
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake
index 266f4b3..a52cb14 100644
--- a/Tests/CTestUpdateCommon.cmake
+++ b/Tests/CTestUpdateCommon.cmake
@@ -165,15 +165,15 @@ endfunction(create_build_tree)
#-----------------------------------------------------------------------------
# Function to write the dashboard test script.
-function(create_dashboard_script name custom_text)
+function(create_dashboard_script bin_dir custom_text)
# Write the dashboard script.
- file(WRITE ${TOP}/dashboard.cmake
+ file(WRITE ${TOP}/${bin_dir}.cmake
"# CTest Dashboard Script
set(CTEST_DASHBOARD_ROOT \"${TOP}\")
set(CTEST_SITE test.site)
set(CTEST_BUILD_NAME dash-test)
set(CTEST_SOURCE_DIRECTORY \${CTEST_DASHBOARD_ROOT}/dash-source)
-set(CTEST_BINARY_DIRECTORY \${CTEST_DASHBOARD_ROOT}/dash-binary)
+set(CTEST_BINARY_DIRECTORY \${CTEST_DASHBOARD_ROOT}/${bin_dir})
${custom_text}
# Start a dashboard and run the update step
ctest_start(Experimental)
@@ -191,27 +191,31 @@ function(run_dashboard_command_line bin_dir)
# Verify the updates reported by CTest.
list(APPEND UPDATE_MAYBE Updated{subdir})
+ set(_modified Modified{CTestConfig.cmake})
+ if(UPDATE_NO_MODIFIED)
+ set(_modified "")
+ endif()
check_updates(${bin_dir}
Updated{foo.txt}
Updated{bar.txt}
Updated{zot.txt}
Updated{subdir/foo.txt}
Updated{subdir/bar.txt}
- Modified{CTestConfig.cmake}
+ ${_modified}
)
endfunction(run_dashboard_command_line)
#-----------------------------------------------------------------------------
# Function to run the dashboard through a script
-function(run_dashboard_script name)
+function(run_dashboard_script bin_dir)
run_child(
WORKING_DIRECTORY ${TOP}
- COMMAND ${CMAKE_CTEST_COMMAND} -S ${name} -V
+ COMMAND ${CMAKE_CTEST_COMMAND} -S ${bin_dir}.cmake -V
)
# Verify the updates reported by CTest.
list(APPEND UPDATE_MAYBE Updated{subdir})
- check_updates(dash-binary
+ check_updates(${bin_dir}
Updated{foo.txt}
Updated{bar.txt}
Updated{zot.txt}
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index f0a5770..4ac1b31 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -192,15 +192,18 @@ run_child(
#-----------------------------------------------------------------------------
# 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 ${GIT} reset --hard master~2
- )
-run_child(
- WORKING_DIRECTORY ${TOP}/user-source
- COMMAND ${GIT} submodule update
- )
+macro(rewind_source src_dir)
+ message("Backing up to revision 1...")
+ run_child(
+ WORKING_DIRECTORY ${TOP}/${src_dir}
+ COMMAND ${GIT} reset --hard origin/master~2
+ )
+ run_child(
+ WORKING_DIRECTORY ${TOP}/${src_dir}
+ COMMAND ${GIT} submodule update
+ )
+endmacro(rewind_source)
+rewind_source(user-source)
# Make sure pull does not try to rebase (which does not work with
# modified files) even if ~/.gitconfig sets "branch.master.rebase".
@@ -224,13 +227,31 @@ UpdateCommand: ${GIT}
")
# Run the dashboard command line interface.
+set(UPDATE_NO_MODIFIED 1)
run_dashboard_command_line(user-binary)
+set(UPDATE_NO_MODIFIED 0)
+
+rewind_source(user-source)
+modify_content(user-source)
+
+message("Running CTest Dashboard Command Line (custom update)...")
+
+# Create the user build tree.
+create_build_tree(user-source user-binary-custom)
+file(APPEND ${TOP}/user-binary-custom/CTestConfiguration.ini
+ "# GIT command configuration
+UpdateCommand: ${GIT}
+GITUpdateCustom: ${GIT};pull;origin;master
+")
+
+# Run the dashboard command line interface.
+run_dashboard_command_line(user-binary-custom)
#-----------------------------------------------------------------------------
# Test initial checkout and update with a dashboard script.
message("Running CTest Dashboard Script...")
-create_dashboard_script(dashboard.cmake
+create_dashboard_script(dash-binary
"# git command configuration
set(CTEST_GIT_COMMAND \"${GIT}\")
set(CTEST_GIT_UPDATE_OPTIONS)
@@ -253,4 +274,20 @@ execute_process(
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
+
+rewind_source(dash-source)
+
+#-----------------------------------------------------------------------------
+# Test custom update with a dashboard script.
+message("Running CTest Dashboard Script (custom update)...")
+
+create_dashboard_script(dash-binary-custom
+ "# git command configuration
+set(CTEST_GIT_COMMAND \"${GIT}\")
+set(CTEST_GIT_UPDATE_OPTIONS)
+set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin master)
+")
+
+# Run the dashboard script with CTest.
+run_dashboard_script(dash-binary-custom)
diff --git a/Tests/CTestUpdateGIT.sh.in b/Tests/CTestUpdateGIT.sh.in
index 4761d32..e7586d6 100755
--- a/Tests/CTestUpdateGIT.sh.in
+++ b/Tests/CTestUpdateGIT.sh.in
@@ -1,5 +1,5 @@
#!/bin/sh
-if test "x$1" = "xpull"; then
+if test "x$1" = "xpull" -o "x$1" = "xreset"; then
"@GIT@" "$@" && sleep 1 && touch foo.txt
else
exec "@GIT@" "$@"
diff --git a/Tests/CTestUpdateHG.cmake.in b/Tests/CTestUpdateHG.cmake.in
index f2e5f83..543ddd9 100644
--- a/Tests/CTestUpdateHG.cmake.in
+++ b/Tests/CTestUpdateHG.cmake.in
@@ -145,7 +145,7 @@ 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
+create_dashboard_script(dash-binary
"# hg command configuration
set(CTEST_HG_COMMAND \"${HG}\")
set(CTEST_HG_UPDATE_OPTIONS)
@@ -160,4 +160,4 @@ execute_process(
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
diff --git a/Tests/CTestUpdateSVN.cmake.in b/Tests/CTestUpdateSVN.cmake.in
index 509597b..97b2a07 100644
--- a/Tests/CTestUpdateSVN.cmake.in
+++ b/Tests/CTestUpdateSVN.cmake.in
@@ -127,7 +127,7 @@ 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
+create_dashboard_script(dash-binary
"# Subversion command configuration
set(CTEST_SVN_COMMAND \"${SVN}\")
set(CTEST_SVN_UPDATE_OPTIONS
@@ -137,4 +137,4 @@ set(CTEST_CHECKOUT_COMMAND
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)