xUnit-plugin = CTest test reports in Jenkins-CIjenkins-ctest-plugin +
- Make sure you've installed the xUnit Plugin in Jenkins.
- Get the
ctest-to-junit.xslfile onto your Jenkins server(s) - I tend to use a Git Submodule to pull this whole repo into other projects.
Using the Transform
- When configuring your Job, in Post-build Actions, add Publish xUnit test result report, and add the Custom Tool option. (Actually, since this bug from May 2013, it looks like my XSL file is integrated with the plugin!)
- Specify the path to the
ctest-to-junit.xslstylesheet if you use Custom
- Specify a pattern for CTest files to transform.
Running the Tests
It takes a little finagling to get CTest to generate the XML output for consumption by this XSL.
You might want to look at
run-test-and-save.sh to see one way of prompting CTest to generate XML output and then moving it. You can execute that script as a build step from your build directory, and then your "pattern" will be
If you're on Windows, you can use the PowerShell script (with batch file launcher): run
run-test-and-save.bat (which runs
run-test-and-save.ps1 for you) which will have the same results as the *nix shell script.
Note that if you're using a multi-config generator (for example, Visual Studio), you need to pass a configuration to this script (which will pass it on to CTest), something like
-C Debug. To accommodate this, if you pass a config using
-C, the config name will be prepended to the output XML filename, e.g.
jenkins-ctest-plugin is covered under the MIT License. See LICENSE for more information.
Based on WebUI-plugin