Unit test framework for C and C++

Unit tests are now one of the standard measures in the software development process. With their help, the error rate of individual modules is reduced and subsequent integration is simplified. Unit tests allow error conditions to be checked that cannot or must not be achieved in a system test. 

FORTecH has been using unit tests in its own development process since the first frameworks were published. Due to the great diversity of target environments in the embedded environment, we rely on our own, simple and pragmatic framework for C and C++, which is based on the concepts of CppUnit

Unit Test Code
Unit Test Code

In contrast to complex, integrated test systems, we assume that testability begins with the design. Modules use interfaces that enable isolated testing. This allows the product code for C and C++ to be tested in static libraries that are executed in unchanged form in the product. Sources of error such as the use of different compiler options can thus be excluded. Test results are generated in a JUnit-compatible format, which allows easy integration into continuous integration systems such as Jenkins/Hudson

Test Suite
Test Suite

On more powerful target systems with their own operating system and shell functionality, we typically use script-controlled deployment and result transfer. For smaller microcontroller applications, e.g. based on the ARM Cortex M0...M4, the test control and evaluation is shifted to the development machine. Only the code to be tested, the test cases and a minimalist server are loaded onto the microcontroller. The interface used for communication depends on the resources of the target system (USB, CAN, LIN, ...) and can be customised. The development computer controls the test execution via a graphical user interface or command line. The development environment and test control work in parallel so that the targeted execution of individual unit tests in the debugger is possible. 

We are happy to support you in customising our tools to your specific development environment. If required, we are available to help you integrate unit testing into your processes.

Contact