I'd be curious to hear thoughts from you guys on adding a mocking framework like mockall for PAC-generation?
Basically, I'd like to be able to rp-pac { version = "0.1.0", features = ["mocking"] } as a dev-dep, and have something like this in the generation (for example):
Which would automatically expand PWM to MockPWM when I'm in test -- this would let me mock registers etc. so that I can more easily test that the registers end up with the correct values (logic-wise, at least) in drivers without needing to involve a board.
Concrete example is working on this PR where via mocks I could manually step through the PWM counter and verify that the correct div/top/compares/etc. are set for each step in a test.
I'd be curious to hear thoughts from you guys on adding a mocking framework like mockall for PAC-generation?
Basically, I'd like to be able to
rp-pac { version = "0.1.0", features = ["mocking"] }
as a dev-dep, and have something like this in the generation (for example):Then, in my code I could use:
Which would automatically expand
PWM
toMockPWM
when I'm intest
-- this would let me mock registers etc. so that I can more easily test that the registers end up with the correct values (logic-wise, at least) in drivers without needing to involve a board.Concrete example is working on this PR where via mocks I could manually step through the PWM counter and verify that the correct div/top/compares/etc. are set for each step in a test.
Thoughts?