Open Timidger opened 7 years ago
I already run into this, when I tried to program tests for fireplace and ultimately gave up for now.
I would actually like to have any mocking in a separate project (the exact repo is not important to me), so we can just do: extern crate wlc-mock as wlc;
or something similar.
Of course with our new project this be most likely be obsolete, because weston offers a headless mode, which should be very helpful for testing.
Still leaving this issue open in case somebody wants to tackle this anyway.
I must say, this is a very interesting project that seemed to come out of no where. You did a very good job wrapping wlc. I've been meaning to go back and fix some of things you have already addressed with this project (the ugly
lazy_statics!
being the main thing). Seems I don't have to now :).I want to look into using this for Way Cooler, but it seems like you don't have any way to mock the objects yet. I would be more than happy to add this feature to this project. Do you have any particular way you would like it to be done? Behind a feature flag? In a separate repo?
While it looks ugly, I suggest using a different repo. If it is behind a feature flag, then when using mocks in test you run into this problem with cargo.