jenkins-ctest-plugin + xUnit-plugin = CTest test reports in Jenkins-CI
This was worthwhile and worked when I last used it. However, I have moved on, no longer use this or know if it is valuable, and have no capacity to meaningfully maintain it.
Unmaintained
- Make sure you've installed the xUnit Plugin in Jenkins.
- Get the
ctest-to-junit.xsl
file onto your Jenkins server(s) - I tend to use a Git Submodule to pull this whole repo into other projects.
- 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.xsl
stylesheet if you use Custom
- Specify a pattern for CTest files to transform.
- GO!
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 BUILDDIR/CTestResults.xml
.
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. Debug.CTestResults.xml
jenkins-ctest-plugin
is covered under the MIT License. See LICENSE for more information.
Based on WebUI-plugin