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:
(3 comments)
File hwaccess_io_unittest.h:
PS2:
Actually, I've no idea why the tests are declared in the […]
There is a flashrom_test_dep in toplevel meson.build, I think it's because it is using srcs and deps from the same toplevel file? I like that srcs and deps are the same. If it's possible to reference srcs and deps from toplevel file in tests/ file, I can try moving flashrom_test_dep.
File tests/init_shutdown.c:
https://review.coreboot.org/c/flashrom/+/51487/comment/3dfc4d60_c2bbf4a7 PS10, Line 53: MEC1308_SIO_PORT1
Can you not access these values somehow, or are you trying to test that the enums are correct?
These are not enums, these are #define values in mec1308.c, I don't know how to access them from here. Not sure whether it is possible at all?
File tests/tests.c:
https://review.coreboot.org/c/flashrom/+/51487/comment/4e464344_7bc7a177 PS10, Line 92: if (current_io && current_io->outb)
Why are these allowed to be NULL?
There are drivers where "doing nothing" mocking strategy is sufficient. For outx functions this would be literally doing nothing, for inx that would be return 0. Corresponding test doesn't have to create any mock in this case - that was my thinking.