Hi David,
What I've done so far is basically take our own source file (button.c or something like that) that was including the zephyr/driver/gpio.h in order to use their GPIO API directly, and add one more level of abstraction. It originally looked like button.c-->zephyr/drivers/gpio.h, which was not mocking properly due to a bunch of other includes that were in gpio.h for Zephyr. Now it would be something like button.c-->gpio.h(mine)-->gpio.c(mine)-->zephyr/drivers/gpio.h and I can mock gpio.h(mine) since I removed the Zephyr API dependencies. You are correct in that I would run into the same issue if I wanted to unit test the gpio.c(mine) since it does include zephyr/drivers/gpio.h.
I guess I don't see how creating a separate header zephyr_gpio.h(mine) where I cherry pick functions, which may need some of the problematic headers, would be helpful? Sounds like I'd end up with an extra header for every driver I want to use, which isn't necessarily a bad thing, but I guess I'm still not seeing how this would solve the mocking issue?
I'm very open to ideas and suggestions so I appreciate your response!
Thanks,
Ben