Adding lcov to Hudson

11,942

Solution 1

Jenkins (or Hudson) can run anything you can run from the command line as part of the build process.

If you specifically want to use LCOV, you can:

  • Install LCOV on the build server, add a build step that executes it and archive the artifacts.
  • Add an LCOV installation into your repository and add a similar build step.

If you're after a code coverage tool, the Cobertura plugin might be what you're looking for.

Solution 2

I prefer the Cobertura plugin to lcov because it presents the results directly in each build report and doesn't copy the entire source code for each build. The information they present is very similar.

Unfortunately, it doesn't support gcov directly, but there is a Python script called gcovr that produces Cobertura-compatible output for Jenkins. This article explains how to set it up.

You can also run both coverage tools on each build, since they both use the same input from gcc.

Share:
11,942
Apophenia Overload
Author by

Apophenia Overload

Updated on August 14, 2022

Comments

  • Apophenia Overload
    Apophenia Overload almost 2 years

    rather new to Hudson here. I was wondering, how would one integrate lcov with it? How would I install the tarball into a Hudson job?

  • Apophenia Overload
    Apophenia Overload about 13 years
    Could Cobertura work with Objective-C programs- specifically, iOS apps?
  • sdmythos_gr
    sdmythos_gr over 12 years
    I used the gcovr to create the xml that Cobertura plugin was looking for...
  • Stephen
    Stephen almost 10 years
    having a lot of issues with gcovr. Its seems to want to do its own thing not what i want
  • Josh Kelley
    Josh Kelley over 8 years
    Another option is the lcov_cobertura script to turn LCOV results into Cobertura-compatible XML for Jenkins' Cobertura plugin.