Add a way to do mocking for Tor unit tests
|Reported by:||nickm||Owned by:|
|Actual Points:||Parent ID:|
Right now, one of our biggest obstacles to improved test coverage is the fact that we don't have a good way to mock functions during C testing.
There are a big pile of mocking tools for C, but they mostly suck and either want you to split your code up weirdly, litter it with macro salad, or such.
There's another class of solution based on preprocessing C or postprocessing assembly, but both approaches are fragile, and we'd probably need to polish or maintain whatever tool we wound up using. Not a great situation to be in. I've maintained compiler wrappers. (It was a bad scene, man.)http://www.pmg.csail.mit.edu/polyj/
Still, our current low test coverage is worse still; worse even than macro salad; worse even than magic compiler wrappers. So we ought to bite the bullet and figure out the least difficult and least awful option and do it.
(Please don't just post the results of a search on "c mocking tools" or "c unit testing" here: I can do that search too.)
Change History (10)
comment:1 Changed 20 months ago by nickm
- Status changed from new to needs_review
- Summary changed from Add a robust way to do mocking for Tor unit tests to Add a way to do mocking for Tor unit tests