docs/cmocka: Fill out documentation for cmocka

Write documentation for cmocka.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit is contained in:
Matteo Golin
2025-12-23 17:03:10 -05:00
committed by Xiang Xiao
parent 0891fa5cfb
commit 0885b324a1
@@ -1,3 +1,38 @@
====================
``cmocka`` libcmocka
====================
cmocka is:
an elegant unit testing framework for C with support for mock objects. It
only requires the standard C library, works on a range of computing
platforms (including embedded) and with different compilers.
The cmocka application in the NuttX apps is an adaptation of cmocka into the
NuttX build system.
You can find out more about how to use the cmocka library on the official
`cmocka website <https://cmocka.org/index.html>`_.
Interface Notes
---------------
The cmocka library header requires that several other standard header files be
included prior to it. Your include statement should look like this:
.. code:: c
#include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <cmocka.h>
Build options
-------------
* ``CONFIG_TESTING_CMOCKA_PROG``: If enabled, a `cmocka` test binary will be
included in your image.
* ``CONFIG_TESTING_CMOCKA_LEAKDETECT``: Cmocka can check for memory leaks.
Intended to be used in a local environment.