Skip to content
Snippets Groups Projects
  • David Kalnischkies's avatar
    cbc9ec23
    compile with absolute paths to allow lcov use · cbc9ec23
    David Kalnischkies authored
    Instructing gcc (or clang) to prepare for capturing coverage data is
    easy: Just build with: CXXFLAGS=--coverage
    
    The hard part is that our buildsystem uses relative paths and so
    confuses the hell out of lcov as it assumes this way that all our *.cc
    files are in the same directory… by changing to absolute paths in the
    compile rules we solve this problem.
    
    Still not perfect as it refers to build/include files for most headers
    and our forking/threading code isn't properly captured, but good enough
    to see red reports for now:
    
    CXXFLAGS=--coverage make
    make test
    ./test/integration/run-tests -q
    lcov --no-external --directory . --capture --output-file apt.info
    genhtml --output-directory ./coverage/ apt.info
    
    Git-Dch: Ignore
    cbc9ec23
    History
    compile with absolute paths to allow lcov use
    David Kalnischkies authored
    Instructing gcc (or clang) to prepare for capturing coverage data is
    easy: Just build with: CXXFLAGS=--coverage
    
    The hard part is that our buildsystem uses relative paths and so
    confuses the hell out of lcov as it assumes this way that all our *.cc
    files are in the same directory… by changing to absolute paths in the
    compile rules we solve this problem.
    
    Still not perfect as it refers to build/include files for most headers
    and our forking/threading code isn't properly captured, but good enough
    to see red reports for now:
    
    CXXFLAGS=--coverage make
    make test
    ./test/integration/run-tests -q
    lcov --no-external --directory . --capture --output-file apt.info
    genhtml --output-directory ./coverage/ apt.info
    
    Git-Dch: Ignore