Setup environment:

Before using the test coverage tool, make sure to:
  • Add /afs/ to PATH environment variable.
  • Report to Known problems section

Process to use LCOV:

  • Compilation:
    In order for any coverage analysis to take place, the application must be compiled with GCC using the -fprofile-arcs and -ftest-coverage flags.
    The application should be executed from the directory it was compiled in, and for GCOV to work on user space programs, the application must exit normally.
  • LCOV usage:
    The process for using LCOV with an application is as follows:
    1. Run the program following your test procedure, and exit.
    2. lcov --directory [dirname] --capture --output-file
    3. genhtml -o [outputdir]
  • Usage lcov [OPTIONS]:
    Use lcov to collect coverage data from either the currently running Linux kernel or from a user space application.
    Specify the --directory option to get coverage data for a user space program.
      -h, --help                      Print this help, then exit
      -v, --version                   Print version number, then exit
      -q, --quiet                     Do not print progress messages
      -z, --zerocounters              Reset all execution counts to zero
      -c, --capture                   Capture coverage data
      -t, --test-name NAME            Specify test name to be stored with data
      -o, --output-file FILENAME      Write data to FILENAME instead of stdout
      -d, --directory DIR             Use .da files in DIR instead of kernel
      -k, --kernel-directory KDIR     Capture kernel coverage data only from KDIR
      -a, --add-tracefile FILE        Add contents of tracefiles
      -e, --extract FILE PATTERN      Extract files matching PATTERN from FILE
      -r, --remove FILE PATTERN       Remove files matching PATTERN from FILE
      -l, --list FILE                 List contents of tracefile FILE
          --diff FILE DIFF            Transform tracefile FILE according to DIFF
          --no-checksum               Do not calculate a checksum for each line
          --convert-filenames         Convert filenames when applying diff
          --strip DEPTH               Strip initial DEPTH directory levels in diff

-- Main.jbenard - 13 Apr 2005

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2005-04-13 - unknown
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    SPI All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback