Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continuous Integration/ Unit testing in embedded C++ systems

What tools are generally used for unit testing and especially continuous integration for embedded systems?

I am especially thinking that you usually have to cross-compile and deploy, and also that you can't easily visualize the target platform. Also it can be difficult to run test-code and frameworks.

What could I use too alleviate these difficulties?

(I think it should be some kind of dual targeting, where the build server runs its tests on a easier target)

like image 483
Olav Avatar asked May 05 '11 21:05

Olav


People also ask

What is unit testing in continuous integration?

Unit testing is the place to start when implementing testing in the Development Phase of the CI/CD pipeline. Unit testing is the process of testing discrete functions at the source code level. A developer will write a test that exercises a function.

What is unit testing in embedded C?

Unit testing is a method of testing software where individual software components are isolated and tested for correctness. Ideally, these unit tests are able to cover most if not all of the code paths, argument bounds, and failure cases of the software under test.


1 Answers

For unit testing, take a look at Unity. http://sourceforge.net/apps/trac/unity/wiki It is a really lightweight test harness (2 x .h and 1 x .c file) supported by Ruby scripts. We have been using in an embedded ARM7 target system for unit testing (redirecting test reporting over a serial port). It is also supported by CMock for (surprise, surprise) Mocking. Even though not extensive, the great thing about these is they are so easy to use. Regarding CI, then Hudson is very good if you're Linux based. Also look at CppUTest and check out James Grenning's book "TDD for Embedded C" at http://renaissancesoftware.net/

like image 120
nsc_feabhas Avatar answered Nov 16 '22 03:11

nsc_feabhas