Skip to content

buildserver

r4d2 edited this page Jan 25, 2014 · 1 revision

Setting up Jenkins

Git

Currently the git plugin is broken for private git repositories, we'll have to wait for the next release (the bug is already fixed in the github repo of the plugin).

In the meantime, the following is the first build step:

# TODO: wait for next version of the git plugin, right new we have to do this manually:
rm -rf pbil
git clone --recursive https://r4d2:[email protected]/AluruLab/pbil.git pbil

Cmake:

Install the plugin Hudson CMake plugin.

Configure it for:

  • Source Directory: pbil

  • Build Directory: build

  • Install Directory: install

Run tests:

Next step in the process is to call CTest:

# Run tests
cd build
# remove the Testing folder, otherwise the test results will ALL be parsed 
# (including old ones)
rm -rf Testing/
ctest -T Test || true # test but ignore the result
cd ..

Test coverage

For test coverage, the cmake needs to be build with ENABLE_COVERAGE, which currently is still auto-enabled, but shouldn't remain so.

The code coverage is determined with the program gcov. We use the wrapper gcovr. This has to be downloaded and installed somewhere into the $PATH where Jenkins can reach it. This can be done by copying the scripts/gcovr file into /usr/local/bin.

The next build step is then:

# run gcovr
cd build
# call gcovr with:
#  -r <source folder>
#  --object-directory <build/src>
#  -e <pattern>  // to exclude all test folders

gcovr -x -r $WORKSPACE/pbil/src --object-directory= $WORKSPACE/build/src -e ".*/test/.*"> Testing/coverage.xml

Post-build Actions

After the build procedure the testing and coverage reports have to be published.

To publish the GTest report (this needs the xUnit plugin): Publish xUnit Test Report -> Google Test, and add the following pattern:

build/Testing/gtest/*.xml

For the CTest report: Publish jUnit Test Report and add the pattern:

build/Testing/20*/Test.xml

For the coverage report, the plugin Cobertura is needen. Then publish a Cobertura report with pattern:

**/Testing/coverage.xml
Clone this wiki locally