Unit Testing a project that uses an RTOS

You seem to have a misconception about unit testing. Whether your code uses an RTOS is not relevant because unit testing involves testing the code modules, i.e., C functions, in isolation. The RTOS would not be operating during your test.

Unit Testing also presumes you are testing against a set of requirements that define the functionality of the code. The goal of most unit testing is to be able to provide various forms of coverage of your code. This includes statement, decision and multiple condition decision coverage.

Statement coverage shows that you have exercised every line of code in the function.

Decision coverage involves showing that both sides (true/false) of all conditions are covered.

Multiple condition decision coverage (MCDC) is used to test complex decisions, i.e., if (a && (b || c)) and insure that all variations are covered. MCDC testing is usually limited to very critical applications such as avionics where failure can have catastrophic results.

Subroutines are typically stubbed, i.e., intercepted and controlled, to prove that each was called in order and that passed arguments are correct and various returned values function correctly.

I admit I don't have any experience with the tools you mention but there are a number of commercial unit test tools available, Cantata, LDRA TestBench, IBM Rational Test Real Time and others that are suitable for in depth unit testing.

There are also commercial solutions for the RTOS itself. My company offers and off-the-shelf unit and integration test package for both µC/OS-II and µC/OS-III.

Scott Validated Software