zephyr/tests/subsys
Gregory Shue 5623f54a35 fff: Add fff_extensions.h, RETURN_HANDLED_CONTEXT()
Add supplementary header <zephyr/fff_extensions.h>.  Add macro
to fff_extensions.h for simplifying definition of custom fake functions
needing call-unique information for producing desired output data.
When an array of custom fake context structures is defined and
the return field within the first structure instance is registered
with the standard SET_RETURN_SEQ() macro of FFF, the
RETURN_HANDLED_CONTEXT() macro provides the inverse logic to
recover the context structure for this called instance. The body of
the custom fake handler is provided to the RETURN_HANDLED_CONTEXT()
macro for appropriate execution and access to the custom fake
parameters.

A test suite is also provided to verify macro implementation and
illustrate usage. It is at:
zephyr/tests/subsys/testsuite/fff_fake_contexts/

This code was verified by:

1. (Pass) west build -p always \
            -b unit_testing tests/subsys/testsuite/fff_fake_contexts/ && \
         ./build/testbinary
2. (Pass) west build -p always \
            -b native_posix tests/subsys/testsuite/fff_fake_contexts/ && \
         ./build/zephyr/zephyr.exe
3. (Pass) ./scripts/twister -p unit_testing \
            -T tests/subsys/testsuite/fff_fake_contexts/
4. (Pass) ./scripts/twister -p native_posix \
            -T tests/subsys/testsuite/fff_fake_contexts/
5. (Pass) cd doc && build html-fast

Fix #55246

Signed-off-by: Gregory Shue <gregory.shue@legrand.com>
2023-03-16 13:43:33 -04:00
..
canbus/isotp tests: canbus: isotp: conformance: skip stmin test on low tick Hz 2023-02-08 12:09:36 +01:00
debug tests: use ignore_fault field instead of tags 2022-11-25 06:38:05 -05:00
dfu tests: dfu: Select FLASH_MAP and STREAM_FLASH 2023-03-03 10:49:32 +01:00
dsp/basicmath zdsp: add in-place operaton test for basicmath 2023-02-21 15:06:06 +01:00
edac tests: ibecc: Use LOG api instead of TC_PRINT() 2022-11-19 14:18:40 +09:00
emul tests: emul: remove subsys from test identifer 2023-03-10 14:01:59 +02:00
fs test: fs: fat_fs_api: Add tests for reentrant zephyr support 2023-03-13 11:58:57 +01:00
input/api tests: input: remove subsys from test identifer 2023-03-10 14:01:59 +02:00
ipc/ipc_service tests: ipc_service: Add ipc_service test of deregistered endpoint 2022-10-11 13:03:29 +02:00
jwt test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00
logging logging: Renamed internal defines to get rid of 2 suffix 2023-03-09 15:10:06 -08:00
mgmt boards: arm: add Arduino GIGA 2023-03-06 12:33:57 +01:00
modbus modbus: add user data for adu callback 2022-09-02 10:51:57 +02:00
openthread modules: openthread: platform: Added setting default tx power 2022-12-21 12:21:09 +01:00
pm tests: fix various test identifiers 2023-02-06 10:06:10 +01:00
portability tests: move to using CONFIG_MP_MAX_NUM_CPUS 2022-10-20 22:04:10 +09:00
rtio/rtio_api tests: rtio: remove subsys from test identifer 2023-03-10 14:01:59 +02:00
sd tests: sd: remove subsys from test identifer 2023-03-10 14:01:59 +02:00
settings settings fcb: Increase buffer for mcu with large write block size 2023-01-26 22:50:40 +09:00
shell samples and tests: Add REQUIRED to Zephyr find_package call 2023-03-02 09:58:27 +01:00
storage tests/samples: use integration_plaforms in more tests/samples 2022-11-29 16:03:23 +01:00
testsuite/fff_fake_contexts fff: Add fff_extensions.h, RETURN_HANDLED_CONTEXT() 2023-03-16 13:43:33 -04:00
tracing/tracing_api tests: tracing_api: move to new ztest API 2022-09-08 10:39:10 +02:00
usb all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences 2022-12-21 10:09:23 +01:00
zbus tests: zbus: modify test identifiers to match component 2023-02-19 20:39:20 -05:00