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.
1 mkdir Dashboards<br />cd Dashboards<br />git clone git://github.com/dlrdave/EasyDashboardScripts.git<br />cd EasyDashboardScripts<br />ctest -S EasyDashboard.cmake,--setup
After running the –setup, you’ll see output directing your next steps, something like this:
1 ElapsedTime='0' delta='0' context='EasyDashboardVariables-TopOfScript'<br />ElapsedTime='0' delta='0' context='EasyDashboardVariables-BottomOfScript'<br />ElapsedTime='0' delta='0' context='EasyDashboard-TopOfScript'
1 --setup:<br /> Configuring 'D:/Dashboards/Support/EasyDashboardDefaults.cmake'...<br /> Configuring 'D:/Dashboards/Support/EasyDashboardOverrides.cmake'...<br /> Checking for 'D:/Dashboards/My Tests' directory...
1 Next steps:<br />===========<br /> Edit the defaults and overrides files listed above to<br /> customize EasyDashboardScripts for this site. At a minimum,<br /> please set ED_contact and verify that the ED_site value is<br /> acceptable in EasyDashboardDefaults.cmake.
1 Open the file 'D:/Dashboards/EasyDashboardScripts/EasyDashboardScripts.htm'<br /> for detailed help.
1 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…)
1 cd "<span>../</span>My Tests"<br />mkdir Nightly<br />cd Nightly<br />svn co http://teem.svn.sourceforge.net/svnroot/teem/teem/trunk Teem<br />cd Teem<br />ctest -S <span>../../../</span>EasyDashboardScripts/EasyDashboard.cmake,vs9-Release-TargetInstall<br />ctest -S <span>../../../</span>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:
1 @rem -------------------------------------------------------------------------<br />@rem Teem scripts:<br />@rem
1 setlocal
1 pushd "D:\Dashboards\My Tests\Nightly\Teem"
1 set DD_CTEST=D:\Dashboards\Support\CMake-2.8.9\bin\ctest.exe<br />set DD_LOGS=D:\Dashboards\Logs<br />set DD_PROJ=Teem<br />set DD_SCRIPT=D:\Dashboards\EasyDashboardScripts\EasyDashboard.cmake
12 set DD_ARGS=vs9-Release-Nightly-TargetInstall<br />"%DD_CTEST%" -S "%DD_SCRIPT%,%DD_ARGS%" >"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.out.log"2>"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.err.log"
12 set DD_ARGS=vs9-Debug-Nightly-TargetInstall<br />"%DD_CTEST%" -S "%DD_SCRIPT%,%DD_ARGS%" >"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.out.log"2>"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.err.log"
12 set DD_ARGS=vs8-Release-Nightly-TargetInstall<br />"%DD_CTEST%" -S "%DD_SCRIPT%,%DD_ARGS%" >"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.out.log"2>"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.err.log"
12 set DD_ARGS=vs8-Debug-Nightly-TargetInstall<br />"%DD_CTEST%" -S "%DD_SCRIPT%,%DD_ARGS%" >"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.out.log"2>"%DD_LOGS%\%DD_PROJ%,%DD_ARGS%.err.log"
1 popd
1 endlocal
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.
Pingback: Amitha Perera