A more nicely formatted version of this blog post is mirrored on blogspot at http://cmake.blogspot.com/2012/09/one-way-to-run-dashboard-on-windows.html -the blogspot link is also better if you are viewing this from a phone.
These instructions assume installations of:
- git bash shell (MSYS git)
- svn command line tools (CollabNet command line client)
- CMake (2.8.9 used to test these instructions)
- Visual Studio 9 2008
Execute the following sequence of commands in a git bash shell, either in your HOME directory, or at the root of one of your drives.
git clone git://github.com/dlrdave/EasyDashboardScripts.git
ctest -S EasyDashboard.cmake,--setup
After running the –setup, you’ll see output directing your next steps, something like this:
ElapsedTime='0' delta='0' context='EasyDashboardVariables-TopOfScript'
ElapsedTime='0' delta='0' context='EasyDashboardVariables-BottomOfScript'
ElapsedTime='0' delta='0' context='EasyDashboard-TopOfScript'--setup:
Checking for 'D:/Dashboards/My Tests' directory...Next steps:
Edit the defaults and overrides files listed above to
customize EasyDashboardScripts for this site. At a minimum,
please set ED_contact and verify that the ED_site value is
acceptable in EasyDashboardDefaults.cmake.Open the file 'D:/Dashboards/EasyDashboardScripts/EasyDashboardScripts.htm'
for detailed help.ElapsedTime='1' delta='1' context='EasyDashboard-BottomOfScript'
Edit the defaults and overrides files to make the recommended “personalization” changes and then you’re ready to try submitting your first dashboard.
To get started with a project that already builds using cmake, and runs its test suite via ctest, you can just checkout a source tree and run the script EasyDashboard.cmake. Here’s a simple sequence of commands to run Debug and Release dashboards of teem:
(Assuming you’re starting in EasyDashboardScripts and “My Tests” is a sibling directory. In the git bash shell, you use “/” as directory separators. In the Windows cmd prompt, you use “\” instead…)
cd "../My Tests"
svn co http://teem.svn.sourceforge.net/svnroot/teem/teem/trunk Teem
ctest -S ../../../EasyDashboardScripts/EasyDashboard.cmake,vs9-Release-TargetInstall
ctest -S ../../../EasyDashboardScripts/EasyDashboard.cmake,vs9-Debug-TargetInstall
This will run two Experimental dashboard submissions, one for a Release build and one for a Debug build that both use Visual Studio 9, and both result in a fully tested build tree, and a sibling-to-the-build directory install tree.
You can add “-Nightly” to the script arguments to switch from an Experimental to a Nightly build.
To use Visual Studio 8 or 10 rather than 9, just change the “-vs9” to either “-vs8” or “-vs10”.
Once you’ve proven that this works, you can write a batch file that can then be scheduled to execute every night after the Nightly start time for your project. One for the teem project could look like this:
@rem Teem scripts:
@remsetlocalpushd "D:\Dashboards\My Tests\Nightly\Teem"set DD_CTEST=D:\Dashboards\Support\CMake-2.8.9\bin\ctest.exe
set DD_SCRIPT=D:\Dashboards\EasyDashboardScripts\EasyDashboard.cmakeset DD_ARGS=vs9-Release-Nightly-TargetInstall
"%DD_CTEST%" -S "%DD_SCRIPT%,%DD_ARGS%" >"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.out.log" 2>"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.err.log"set DD_ARGS=vs9-Debug-Nightly-TargetInstall
"%DD_CTEST%" -S "%DD_SCRIPT%,%DD_ARGS%" >"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.out.log" 2>"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.err.log"set DD_ARGS=vs8-Release-Nightly-TargetInstall
"%DD_CTEST%" -S "%DD_SCRIPT%,%DD_ARGS%" >"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.out.log" 2>"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.err.log"set DD_ARGS=vs8-Debug-Nightly-TargetInstall
"%DD_CTEST%" -S "%DD_SCRIPT%,%DD_ARGS%" >"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.out.log" 2>"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.err.log"popdendlocal
In fact, this script is what is running at Kitware right now on the dash22.kitware Windows dashboard machine.
After you have a batch file running the set of dashboards you want reliably (you should be able to double-click the batch file in Windows Explorer and have them all run and submit properly), then you can add running the batch file as a Scheduled Task so that it happens automatically once each night. Google around for setting up a “Scheduled Task” for whatever version of Windows you’re running. The UI for adding tasks has changed a few times from version to version of Windows. Or, if you need instructions specifically for XP, Vista or 7, I can probably write something up for that, too.
Let me know if you need more advice. I think this should be sufficient information to get you started setting up your own Windows dashboards.
Of course, EasyDashboard also works on Mac and Linux.