Attention is currently required from: Nico Huber, Angel Pons, Anastasia Klimchuk.

Anastasia Klimchuk uploaded patch set #2 to this change.

View 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.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I22945cce3d0f36adaa8032167a3ef4e54eccb611
Gerrit-Change-Number: 56753
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-Attention: Nico Huber <nico.h@gmx.de>
Gerrit-Attention: Angel Pons <th3fanbus@gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-MessageType: newpatchset