Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons. Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/51487 )
Change subject: tests: Add unit test to run init/shutdown for mec1308.c, ene_lpc.c ......................................................................
Patch Set 10:
(5 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/51487/comment/895ea4b0_adbc9c8d PS6, Line 9: hwaccess_io.h : because those are needed to test lifecycle of mec1308.c
Do you mean you would like to see more tests that are using mocked i/o, to ensure the approach works […]
I added test for ene_lpc.c, to verify the io mocking framework is working for different drivers, and yes it is! Moreover, ene's state is more complicated, it needs to track two values. I picked ene almost at random, but it is actually a good example that framework can deal with different states.
Patchset:
PS1:
flashbuses_to_text_test_success() was only introduced to get the ball rolling on starting to think a […]
I would keep them until I have a better replacement, what do you think?
Patchset:
PS10: And now we have very cool io mocking framework, and two tests that are using it! This definitely needs to be split into 3 patches (framework, mec test, ene test) but I thought it would be good to have a first look at the whole picture. Also thank you to everyone!
File tests/tests.c:
https://review.coreboot.org/c/flashrom/+/51487/comment/d2e996c9_8f09c4c2 PS6, Line 88: /* : * Uncomment LOG_ME below for verbose logging. : * It is commented by default because of too many calls. : */ : /* LOG_ME; */
So far I was able to print everything or nothing, but I will look more into this. […]
I haven't done anything with verbosity yet, a general question: is it possible to leave this for the next patch? I fully understand this comment is not a final solution! what do you think?
https://review.coreboot.org/c/flashrom/+/51487/comment/1f7c7fef_d1b58928 PS6, Line 102: 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));
So, CB:52604 is what I had in mind. Feel free to take it over if […]
This is awesome, and it works! Thank you!