开发者

How to let Jenkins/Hudson parse the output of a custom test script?

I have set up Jenkins to run a freestyle project. I am running a pytho开发者_Python百科n 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜