What is the minimal FreeRTOS environment to execute unit-tests?

Hi Damien -

to me it looks like you have made a spot landing on the limits of usefulness of unit testing right on your first jump! Congrats! :slight_smile:

Queues are IPC mechanisms, and fairly heavily used ones in FreeRTOS, too. Thus, the very idea of a unit test is misproven in this example: A unit test assumes that the code to be tested is a static, fully deterministic function between the input parametrs and the result.

In RTOS rhis rarely holds true as any use of IPC implies side effects on other threads of execution as well as dependencies of other threads. Also, concurrency allow for many different outcomes of a function call with the same input parameters. There is nothing deterministic about that. Thus, as a corollary, only those functions in an RTOS context are meaningfully unit testable that do not have side effects nor rely on external operation parameters such as data passed in from other threads via IPC.

1 Like