Attention is currently required from: Nico Huber, Angel Pons, Anastasia Klimchuk.
Anastasia Klimchuk uploaded patch set #2 to this change.
tests: Split flashrom tests into two executables
The reason for splitting: some tests need to wrap spi_send_command,
some other tests (specifically the tests in the next patch in this
chain) need a real spi_send_command.
Cmocka offers a capability to call __real_spi_send_command to call a
real function and bypass the wrap. However, the function in question,
spi_send_command, is not called in tests explicitly. There is no
clear way to say "for this one test use the wrap, for other tests use
real".
There is one test file spi25.c which needs spi_send_command to be
wrapped, and this test file is extracted into a separate executable
in this patch. The rest of existing tests don't care about
spi_send_command. However in the next patch new tests are added,
and they need spi_send_command real. The approach used here is: use
real function unless it is required to mock, so all tests that don't
care go into the executable with the real spi_send_command.
BUG=b:181803212
TEST=builds and ninja test
Change-Id: I22945cce3d0f36adaa8032167a3ef4e54eccb611
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
---
M tests/meson.build
M tests/tests.c
M tests/tests.h
A tests/wrap_send_tests.c
A tests/wrap_send_tests.h
5 files changed, 127 insertions(+), 35 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/53/56753/2
To view, visit change 56753. To unsubscribe, or for help writing mail filters, visit settings.