ITK/Policy and Procedure for Adding Dashboards: Difference between revisions
Line 52: | Line 52: | ||
** Add to CMAKE_CXX_FLAGS the flags: -g -O0 -fprofile-arcs -ftest-coverage | ** Add to CMAKE_CXX_FLAGS the flags: -g -O0 -fprofile-arcs -ftest-coverage | ||
** Add to CMAKE_C_FLAGS the flags: -g -O0 -fprofile-arcs -ftest-coverage | ** Add to CMAKE_C_FLAGS the flags: -g -O0 -fprofile-arcs -ftest-coverage | ||
** If using gcc4x, then the coverage flags must also be passed to the linker, | ** If using gcc4x, then the coverage flags must also be passed to the linker, | ||
*** http://www.itk.org/pipermail/insight-users/2007-August/023289.html | *** http://www.itk.org/pipermail/insight-users/2007-August/023289.html | ||
*** Therefore, add also CMAKE_EXE_LINKER_FLAGS:STRING=-g -O0 -fprofile-arcs -ftest-coverage | |||
** Make sure that the COVERAGE_COMMAND, CMake variable is pointing to the gcov executable that you want to use (the one that matches the version of gcc that you are using for this ITK build). | ** Make sure that the COVERAGE_COMMAND, CMake variable is pointing to the gcov executable that you want to use (the one that matches the version of gcc that you are using for this ITK build). | ||
** Type "c" for Configuring | ** Type "c" for Configuring |
Revision as of 15:22, 19 October 2009
This page is under construction
The Nightly and Continuous build/test of ITK is essential to its survival.
The ITK Dashboard presents dashboard submissions from the ITK community. The dashboards represent unique configurations of hardware platforms, operating systems, compilers, compiler options and ITK options.
Policy
Each dashboard shall present a unique combination of hardware/compiler/OS, optional features and compiler options. The dashboard submitter will monitor the ITK dashboard on a routine basis to make sure that the dashboard is reporting as a Nightly or Continuous build.
Procedure
The recommended method for dashboard submission is using ctest scripts.
Preparing a Dashboard Submission
- Use a CMake GUI (CMakeSetup on Windows or ccmake on UNIX) or the wizard mode (cmake -i) to edit cache entries.
- Perform a manual build.
- Run the tests.
- As of ITK 3.6, the configure process creates a file ${ITK_BINARY_DIR}/CMake/itkSampleBuildTest.cmake that contains ctest commands to build, test and submit a configuration that is the same as your configured build.
- Copy the itkSampleBuildTest.cmake file to another directory and rename it.
- Edit this file to select the type of submission to Nightly or Continuous
- Select the build type, either Debug, Release, RelWithDebInfo or MinSizeRel
- By default, the script will
- For nightly submissions, start with an empty binary directory. If your platform takes an unreasonable time to build from a clean directory, you can change CTEST_START_WITH_EMPTY_DIRECTORY to FALSE.
- For continuous submissions, start with an empty binary directory the first time it runs each day. Here again, if your platform takes a long time to build from a clean binary directory, you can change CTEST_START_WITH_EMPTY_DIRECTORY_ONCE to FALSE.
- Test your ctest script
- ctest -V -S your_script_file
Scheduling a Dashboard Submission
Dashboard submissions can be automatically run with Cron or Scheduler.
Advanced Features
Memory Checker
Coverage
Code coverage can be performed with
- gcov under Linux
- BullsEye under Linux and Windows
These two applications compute code coverage in different ways
- gcov computes line coverage
- BullsEye computes branch coverage
Configuring GCOV Coverage
- Make sure that the program gcov is installed in your system and that its version matches the version of the gcc compiler that you are using for building ITK. For example
- gcov --version
- gcc --version
- Run ccmake in the binary directory where you build ITK
- Add to CMAKE_CXX_FLAGS the flags: -g -O0 -fprofile-arcs -ftest-coverage
- Add to CMAKE_C_FLAGS the flags: -g -O0 -fprofile-arcs -ftest-coverage
- If using gcc4x, then the coverage flags must also be passed to the linker,
- http://www.itk.org/pipermail/insight-users/2007-August/023289.html
- Therefore, add also CMAKE_EXE_LINKER_FLAGS:STRING=-g -O0 -fprofile-arcs -ftest-coverage
- Make sure that the COVERAGE_COMMAND, CMake variable is pointing to the gcov executable that you want to use (the one that matches the version of gcc that you are using for this ITK build).
- Type "c" for Configuring
- Type "g" for Generating the Makefiles
- At this point your build is configured for reporting code coverage
- Test it by submitting an Experimental build using any of the two following commands:
- make Experimental
- ctest -D Experimental
- The coverage submission should appear close to the bottom of the ITK Dashboard
To make this part of a Nightly or Continuous build, it is convenient to incorporate these settings into the CTest script that you are using for driving the build. The typical way of incorporating these option is to insert the following lines
COVERAGE_COMMAND:FILEPATH=/usr/bin/gcov-3.4 CMAKE_CXX_FLAGS:STRING=-g -O0 -fprofile-arcs -ftest-coverage CMAKE_C_FLAGS:STRING=-g -O0 -fprofile-arcs -ftest-coverage CMAKE_EXE_LINKER_FLAGS:STRING=-g -O0 -fprofile-arcs -ftest-coverage
into the block:
SET (CTEST_INITIAL_CACHE " ... )
Style
OS Compiler Debug/Release Static/Shared 32/64 bit Wrapping