Stylesheet for the xUnit plugin for Jenkins to handle CTest test results.
XSLT PowerShell Shell
Switch branches/tags
Nothing to show
Clone or download
Latest commit 22265f5 Nov 14, 2014

README.md

jenkins-ctest-plugin + xUnit-plugin = CTest test reports in Jenkins-CI

Installation

  1. Make sure you've installed the xUnit Plugin in Jenkins.
  2. 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.

Using the Transform

  1. 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!)
  1. Specify a pattern for CTest files to transform.
  2. GO!

Running the Tests

It takes a little finagling to get CTest to generate the XML output for consumption by this XSL.

*nix

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.

Windows

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

License

jenkins-ctest-plugin is covered under the MIT License. See LICENSE for more information.

Based on WebUI-plugin