Преглед изворни кода

Generalize CTest.Update* test dashboard script helpers

Teach (create|run)_dashboard_script macros to treat the argument as the
name of a build tree.  Append '.cmake' to generate the dashboard script
name.  This allows future re-use of the macros for multiple test
scripts.
Brad King пре 15 година
родитељ
комит
11bdc2b1a1

+ 2 - 2
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)

+ 2 - 2
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)

+ 6 - 6
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)
@@ -203,15 +203,15 @@ 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}

+ 2 - 2
Tests/CTestUpdateGIT.cmake.in

@@ -230,7 +230,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
   "# git command configuration
 set(CTEST_GIT_COMMAND \"${GIT}\")
 set(CTEST_GIT_UPDATE_OPTIONS)
@@ -253,4 +253,4 @@ execute_process(
 ")
 
 # Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)

+ 2 - 2
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)

+ 2 - 2
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)