Let Travis submit to a CDash dashboard

Submitted by Matthias on Wed, 01/20/2016 - 09:50

Travis, the popular CI tool for C++ projects on GitHub, enables continuous builds with nice integration to GitHub. But it lacks a good look into the build and test logs. Especially if you run tests with ctest, the default output of tests will not show the executables output in the Travis logs. On the other hand, running everything with full verbosity makes finding the interesting information on Travis logs tedious.

Enter the CDash dashboard. It breaks build and test logs nicely up and can show useful statistics and how things progressed over time. So why not instruct Travis to submit its logs to a dashboard? That's exactly what I started doing in Vc. Instead of calling cmake && make && ctest directly from .travis.yml, it only calls ctest -V -S test.cmake now. This executes the cmake script that does an Experimental build dashboard submission.

This is what my .travis.yml looks like now:

language: cpp
[...]
before_script:
    - export dashboard_model=Experimental
    - export build_type=Release
    - export NUMBER_OF_PROCESSORS=2

script:
    - ctest -V -S test.cmake

There is a issue with ctest, though. If the build passes, but any test fails, the ctest executable will return 0 (i.e. success) and Travis will consider the revision as good. You can work around this issue by having ctest_test return the status and if this variable indicates a failure call message(FATAL_ERROR ...) from the ctest script.

Add new comment

By submitting this form, you accept the Mollom privacy policy.