4
votes

I have set up Jenkins to run a freestyle project. I am running a python test script, connecting over a serial connection to a piece of hardware. I would like Jenkins/Hudson to report (JUnit style) about the test results.

The test script prints the number of tests, the number of passed tests and number of failed tests as follows:

Total number of tests: 3 Number of passed test: 3 Number of failed test: 0

How can I get Jenkins to parse this? Or alternatively, how should I feed my test results to Jenkins in order to get them parsed.

1

1 Answers

4
votes

I use CMake's CTest which calls Google's C++ Testing Framework to do some tests for me which can export to JUnit compliant XML to a file in the build directory.

To do this, I added a custom build step (executing a shell command 'make test' to run the tests) and then use the JUnit test results plugin (check 'Publish JUnit test result report' and give it the location of the XML file).

This then shows my test results in the Jenkins build. If you implemented something like this, you would get extra reporting granularity based on which tests passed and how long they took compared to your fairly simple console output at the moment.