Using Jenkins with boost.test unit tests

你。 提交于 2019-11-29 23:08:14

xUnit parsing works for me using Jenkins 1.498, xUnit 1.52, boost 1.42. I have a new project using boost 1.53 and the XML output format appears to be the same to my all-to-humanly-error-prone eye, but since I haven't yet set up unit tests in Jenkins, I'm not 100% sure the output is compatible.

As recommended in the xUnit plugin comments, I'm running the Boost test program with:

run_test --log_format=XML --log_sink=results.xml --log_level=all --report_level=no

I have my post-build xUnit step configured to parse results.xml with the BoostTest-1.x format.

If you're still having problems, perhaps you can update your question with more details about your versions and how you generate the test output.

run_test --log_format=XML --log_sink=results.xml --log_level=all --report_level=no --result_code=no

I've added a parameter to Dave Bacher's answer because apparently Boost Test was using a non-zero exit code to indicate a test failure but Jenkins was interpreting this as a more fundamental failure, and thus stopping without processing the test results.

exit 201
Build step 'Execute Windows batch command' marked build as failure`

Ok, normally it works with this options. But if you are using it in large Projects and the XML file is getting too big, the XUnit plugin does not work anymore. So I had to change the log_level to test_suite. Only the errors are logged, the successful checks are not logged.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!