Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons, Simon Glass. 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:
(2 comments)
File tests/init_shutdown.c:
https://review.coreboot.org/c/flashrom/+/51487/comment/334bd496_cae2d50c PS10, Line 53: MEC1308_SIO_PORT1
Well you can move them to a header file
Yes, although that would mean including more header files here ... but maybe this is fine? In any case, that would be in a separate patch. What do other people think about it? And if yes, would you prefer do that separate patch before or after this one?
File tests/tests.c:
https://review.coreboot.org/c/flashrom/+/51487/comment/13e1d1b3_8ed2075e PS10, Line 92: if (current_io && current_io->outb)
OK, so do you mean to allow current_io to be NULL as well?
Yes! If a test wants io mocking, it sets current_io before executing whatever it is testing, and then at the end cleans up and sets current_io NULL (you can have a look at init_shutdown.c). So by default when test starts execution, current_io is NULL and if "do nothing" mocking is sufficient then nothing to do, NULL means "do nothing".