Test case organisation


Use the GUI to create and organise your unit test specification the way you want it.



Embunit displays the test suite hierarchy. The content of each test case is shown as a list of high-level operations.



Example test case

Example test case



Test Driven Development (TDD)


You can define your tests before writing your code. If you haven't finished defining your interfaces - no problem; just go back and add the details later.


No binary file formats


All files used or generated by Embunit are text files.


Test suites and source code can be checked into your version control system and any changes can easily be reviewed using a file comparison utility. Test harnesses can be pulled from the version control system and run automatically as part of the daily build.


Embunit stores the test suite in XML.



Unit test source code generation


You don't need to write a single line of test code, Embunit generates the test harness for you.


You can select whether Embunit generates C or C++ source code.


The automatic code generation means that you have more time to focus on what needs to be tested. You can write tests first, even if you haven't finished defining the interface.



Automatically generated C++ source code

Automatically generated C++ source code



C++ exception handling


Embunit allows you to specify when you expect an exception to be thrown, and optionally to specify the exception type.


You can also test that constructors throw under given conditions.


Embunit automatically inserts catch-all exception handling code so that unexpected exceptions are caught and reported. An unexpected exception aborts the individual test case but not the test suite, allowing subsequent test cases to execute normally.


The use of exception handling is optional, and the catch-all exception handling code can be disabled if desired.


Embedded C++ compilers


Most embedded C++ compilers do not implement all the features of the C++ language, or allow you to switch certain features off. Embunit's C++ code generation does not use the following features:



Exception handling code can also be disabled, giving full compatibility with the Embedded C++ language (EC++).



Customising Embunit to suit your system


Test results


The way your system indicates whether tests have passed or failed is heavily dependent on the tools you are using and the available I/O. Embunit uses a set of functions that can be customised to suit your target.


The example implementations supplied with Embunit use printf() and std::out to report test results.


Stub code


To make it easier to write clear, maintainable stub code Embunit allows you to specify the test "Context" anywhere in a test case. Stub code has access to the "Context" and can take appropriate action.


Stub code also has access to the test case and test step number


Comparing floating point numbers


Embunit uses a function to test whether two floating point numbers are equal. You can supply your own implementation of this function if necessary.


Custom memory allocation in C


You can define your own memory allocator to be used by the automatically generated source code.


Return to top >

Embunit is developed in the UK by

Apollo Systems Contracts Ltd.
Isis Business Centre
Unit 1 Sovereign Business Park
48 Willis Way
BH15 3TB
Sales contacts

Phone UK: 01202 373230

Phone outside the UK: +44 1202 373230

Email: sales@embunit.com
Stay in touch

Follow us on LinkedIn

Follow us on LinkedIn