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/+/57917 )
Change subject: tests: Add wrap for libusb_init and use it in dediprog test ......................................................................
Patch Set 3:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/57917/comment/89015814_13f9000e PS3, Line 15: real libusb_init
Do we ever want to call real libusb functions? If not, I guess, […]
That would be ideal, for the tests not to know of existence of libusb.h. That was the goal on my mind from the very beginning (and still is). I spent a while calculating offsets for libusb structs here https://review.coreboot.org/c/flashrom/+/57918/3/tests/io_mock.h , exactly because I didn't want to include libusb.h into tests. The reason CB:57918 is WIP because code looks a bit odd with all the offsets, I wasn't sure this is ok to have such code - but the test is fully working.
But then I realised, if libusb.h is not present, programmers which include it won't be built anyway... so there is nothing to test? In other words. Say we want to build and run all tests without libusb.h, including the drivers that need it (currently dediprog and raiden), how to build drivers? They all have line `#include <libusb.h>`, that won't compile?