snitch-org / snitch

Lightweight C++20 testing framework.
Boost Software License 1.0
252 stars 7 forks source link

mocking support #152

Closed zhuoqiang closed 6 months ago

zhuoqiang commented 6 months ago

I wonder if snitch support any mocking framework, like trompeloeil, etc. I could not find any doc on this topic.

cschreib commented 6 months ago

Hi! Indeed this in not supported by snitch, and isn't on the roadmap.

zhuoqiang commented 6 months ago

Hi! Indeed this in not supported by snitch, and isn't on the roadmap.

thanks for the reply.

Trompeloeil says

By default, Trompeloeil reports violations by throwing an exception, explaining the problem in the what() string.

Does snitch play well with this reporting mechinism? My gut feeling is that trompeloeil could be used in snitch by default without problem, but I'm not sure on this.

anything possible in snitch could prevent itself from working with Trompeloeil?

cschreib commented 6 months ago

That's absolutely fine. Snitch also uses exceptions to report failures in the REQUIRE(...) checks, for example. Just make sure that snitch is configured to support exceptions (which is the default configuration). See the readme sectioned about exceptions if you want to know more.

cschreib commented 6 months ago

I'll close this, please re-open if you are having difficulties.