From 558cd77b9358b8703947ffc2ac04e25543e93854 Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 27 Jan 2014 00:11:56 +0000 Subject: [PATCH] Document running the testsuite for coverage information. git-svn-id: https://svn.dealii.org/trunk@32322 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/developers/testsuite.html | 65 ++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 5 deletions(-) diff --git a/deal.II/doc/developers/testsuite.html b/deal.II/doc/developers/testsuite.html index 793b94dbbc..44ceb6f1ce 100644 --- a/deal.II/doc/developers/testsuite.html +++ b/deal.II/doc/developers/testsuite.html @@ -5,7 +5,7 @@ The deal.II Testsuite - + @@ -55,7 +55,8 @@
  • Running the testsuite
    1. How to interpret the output
    2. -
    3. Parallelize testsuite configuration
    4. +
    5. Parallelizing testsuite configuration
    6. +
    7. Generating coverage information
  • Testsuite development
    1. @@ -334,10 +335,12 @@ xx: =============================== OUTPUT END ============================ -

      Parallelize testsuite configuration

      +

      Parallelizing testsuite configuration

      - If you have set up a good portion of the testsuite you'll notice that a + If you have set up the testsuite (or at least a few hundred tests by + providing a sufficiently general regular expression + as TEST_PICKUP_REGEX) you'll notice that a reconfiguration of the build directory takes a noticeable time (in the order of minutes instead of seconds) with Reconfiguring testsuite subprojects. @@ -348,7 +351,59 @@ xx: =============================== OUTPUT END ============================ variable.

      - Alternatively, you can use Ninja. + Alternatively, you can use Ninja as your build tool instead + of make. +

      + + + + +

      Generating coverage information

      + +

      + The testsuite can also be used to provide coverage information, + i.e., data that shows which lines of the library are executed how many + times by running through all of the tests in the testsuite. This is of + interest in finding places in the library that are not covered by + the testsuite and, consequently, are prone to the inadvertent + introduction of bugs since existing functionality is not subject to + existing tests. +

      + +

      + To run the testsuite in this mode, essentially, you have to do three + things: +

        +
      1. + build the library with appropriate profiling flags +
      2. +
      3. + run all or some tests (built with the same profiling flags) +
      4. +
      5. + gather all information and convert them to a viewable format. +
      6. +
      + In order to achieve the first two, configure the library with +
      +  cmake -DCMAKE_BUILD_TYPE=Debug -DDEAL_II_SETUP_COVERAGE=YES <...>
      +      
      + You can then build the library and run the tests as usual. +

      + +

      + For the last point, one can in principal use whatever tool one + wants. That said, the deal.II ctest driver already has builtin + functionality to gather all profiling files and submit them to cdash + where we already gather testsuite results + (see below). You can do so by invoking +

      +  ctest -DCOVERAGE=YES <...> -S ../tests/run_testsuite.cmake
      +      
      + when running the testsuite, or directly by +
      +	ctest <...> -S ../tests/run_coverage.cmake
      +      

      -- 2.39.5