简体   繁体   中英

CppUTest on Jenkins

We use CppUTest to run unit tests. This is being performed by Cmake/Ninja where after building the tests, we use ninja to execute them ninja test

an example output of this is:

1/3 Test #1: Test1...................................................   Passed    0.03 sec
      Start 2: Test2
2/3 Test #2: Test2.........................................................   Passed    0.00 sec
      Start 3: Test3
3/3 Test #3: Test3..............................................................***Exception: SegFault  0.00 sec

66% tests passed, 1 tests failed out of 3

Total Test time (real) =   0.26 sec

The following tests FAILED:
     3 - Test3 (SEGFAULT)
Errors while running CTest
FAILED: CMakeFiles/test.util 

This is ok if i trigger the build locally on my machine and analyze it manually. Now what i am looking for is an already existing solution to help jenkins analyze the output.

Right now, Jenkins executes the build and exits "successfully", because the command itself ninja test executed successfully, but not all of the tests.

Maybe you already found this but you can create a JUnit output with cpputest with the -ojunit output flag. Jenkins should then be able to import the results from this file.

CppUTest Commandline Switches

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM