Attention is currently required from: Thomas Heijligen, Evan Benn.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/69539 )
Change subject: tests: Add unmock_io.c ......................................................................
Patch Set 1:
(7 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/69539/comment/400974c9_c8d84192 PS1, Line 7: Add unmock_io.c Redirect to real I/O to support coverage run
https://review.coreboot.org/c/flashrom/+/69539/comment/1eef9953_5b36b3e7 PS1, Line 8: : Add functions and a struct that defer the io functions mocked by : mock_io to the real implementations. Implement a check that redirects mock io functions to the real implementations. Real I/O functions are needed for the coverage tool to be able to create and write files.
https://review.coreboot.org/c/flashrom/+/69539/comment/ad864346_2eddbbaa PS1, Line 10: This is to support code coverage. remove
File tests/unmock_io.c:
https://review.coreboot.org/c/flashrom/+/69539/comment/cbdaff95_219de286 PS1, Line 19: unmock_io How about `io_real.h` (and `io_real.c`)? this aligns with `io_mock` that we already have. Function names are all fine, I am specifically about file names
https://review.coreboot.org/c/flashrom/+/69539/comment/eefc0c06_762ea4ef PS1, Line 25: (void)state; Just drop this line, none other custom mocks are using it. This line is used in test methods (there are none in this file).
https://review.coreboot.org/c/flashrom/+/69539/comment/4a6d12f9_310934f6 PS1, Line 43: // Mock ios that defer to the real io functions. : // These exist so that code coverage can print to real files on disk. Please format the comment as /* */ and same below
https://review.coreboot.org/c/flashrom/+/69539/comment/bc915c46_9502c822 PS1, Line 61: maybe_unmock_io Let's add a comment for this function:
Detects a coverage run and registers real I/O functions instead of mocks so that coverage tools can create and write real files and generate a coverage report.