Attention is currently required from: Nico Huber, Angel Pons, Anastasia Klimchuk.
4 comments:
Commit Message:
hwaccess_io.h
because those are needed to test lifecycle of mec1308.c
I would like to see one other example of ported i/o usage being addressed with the same test code to build confidence that the approach is flexible enough.
It maybe worth considering that there is sufficient complexity in trying to deal with ported i/o mocking that the mocking framework is its own patch.
Patchset:
Thank you! I will try to address your other comment to create mocks in separate compilation unit. […]
flashbuses_to_text_test_success() was only introduced to get the ball rolling on starting to think about how a test framework could even be wired into Flashrom. I think we are starting to get well past that point now that Anastasia has gotten the hang of cmocka and is making great progress. In light of that, I wouldn't be opposed to removing the flashbuses_to_text_test_success() test if its just a burden as our tests continue to mature.
That is to say, I have no strong feelings about it now that we have more example test code and will let the democracy of the community decide upon the exemplification test of flashbuses_to_text_test_success() ultimate fate. Fundamentally I agree with Nico's assessment so I guess the above perhaps provides some historical context.
File tests/tests.c:
/*
* Uncomment LOG_ME below for verbose logging.
* It is commented by default because of too many calls.
*/
/* LOG_ME; */
does cmocka have a mechanism to allow verbosity to be tuned while running a test?
return ((port == 0x2e /* MEC1308_SIO_PORT1 */
|| port == 0x4e /* MEC1308_SIO_PORT2 */)
? 0x20 /* MEC1308_DEVICE_ID_REG */
: ((outb_val == 0x84 /* MEC1308_MBX_DATA_START */)
? 0xaa /* MEC1308_CMD_PASSTHRU_SUCCESS */
: 0));
such values and logic may want to be encoded and stashed away within
mec1308_init_and_shutdown_test_success() but queried here.
I guess will_return() and mock_type() are the tricks to use here?
To view, visit change 51487. To unsubscribe, or for help writing mail filters, visit settings.