summaryrefslogtreecommitdiffstats
path: root/Tests/CTestUpdateCommon.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-02-23 20:59:07 (GMT)
committerBrad King <brad.king@kitware.com>2009-02-23 20:59:07 (GMT)
commit5b49f22cafba29e044737fbfafa38fdfebd9d8e2 (patch)
tree2260b14efc970e62218609ffdf198328f9c916e0 /Tests/CTestUpdateCommon.cmake
parenta16c857c30357d2ec03c975f64abb19ff78dd77d (diff)
downloadCMake-5b49f22cafba29e044737fbfafa38fdfebd9d8e2.zip
CMake-5b49f22cafba29e044737fbfafa38fdfebd9d8e2.tar.gz
CMake-5b49f22cafba29e044737fbfafa38fdfebd9d8e2.tar.bz2
ENH: Enhance CTest.UpdateCVS/SVN tests
This adds a source tree subdirectory to the content of the test projects. It also smoke tests more than one revision worth of changes.
Diffstat (limited to 'Tests/CTestUpdateCommon.cmake')
-rw-r--r--Tests/CTestUpdateCommon.cmake21
1 files changed, 17 insertions, 4 deletions
diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake
index 4502908..6c2a123 100644
--- a/Tests/CTestUpdateCommon.cmake
+++ b/Tests/CTestUpdateCommon.cmake
@@ -88,15 +88,26 @@ endfunction(create_content)
#-----------------------------------------------------------------------------
# Function to update content.
-function(update_content dir added_var removed_var)
+function(update_content dir added_var removed_var dirs_var)
file(APPEND ${TOP}/${dir}/foo.txt "foo line 2\n")
file(WRITE ${TOP}/${dir}/zot.txt "zot\n")
file(REMOVE ${TOP}/${dir}/bar.txt)
- set(${added_var} zot.txt PARENT_SCOPE)
+ file(MAKE_DIRECTORY ${TOP}/${dir}/subdir)
+ file(WRITE ${TOP}/${dir}/subdir/foo.txt "foo\n")
+ file(WRITE ${TOP}/${dir}/subdir/bar.txt "bar\n")
+ set(${dirs_var} subdir PARENT_SCOPE)
+ set(${added_var} zot.txt subdir/foo.txt subdir/bar.txt PARENT_SCOPE)
set(${removed_var} bar.txt PARENT_SCOPE)
endfunction(update_content)
#-----------------------------------------------------------------------------
+# Function to change existing files
+function(change_content dir)
+ file(APPEND ${TOP}/${dir}/foo.txt "foo line 3\n")
+ file(APPEND ${TOP}/${dir}/subdir/foo.txt "foo line 2\n")
+endfunction(change_content)
+
+#-----------------------------------------------------------------------------
# Function to write CTestConfiguration.ini content.
function(create_build_tree src_dir bin_dir)
file(MAKE_DIRECTORY ${TOP}/${bin_dir})
@@ -136,7 +147,8 @@ function(run_dashboard_command_line bin_dir)
)
# Verify the updates reported by CTest.
- check_updates(${bin_dir} foo.txt bar.txt zot.txt)
+ check_updates(${bin_dir} foo.txt bar.txt zot.txt
+ subdir/foo.txt subdir/bar.txt)
endfunction(run_dashboard_command_line)
#-----------------------------------------------------------------------------
@@ -148,7 +160,8 @@ function(run_dashboard_script name)
)
# Verify the updates reported by CTest.
- check_updates(dash-binary foo.txt bar.txt zot.txt)
+ check_updates(dash-binary foo.txt bar.txt zot.txt
+ subdir/foo.txt subdir/bar.txt)
endfunction(run_dashboard_script)
#-----------------------------------------------------------------------------