eranpeer / FakeIt

C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking.
MIT License
1.25k stars 175 forks source link

inline catch #87

Closed dvirtz closed 7 years ago

dvirtz commented 7 years ago

First, grate library.

Can you tell me why is Catch framework inlined on the single header while other, like gtest, are not? It causes collisions with the standalone Catch I use.

eranpeer commented 7 years ago

Oops, looks like a mistake. Fixed it. Please try the latest commit. Thanks,

dvirtz commented 7 years ago

Thanks. When do you plan to release it?

eranpeer commented 7 years ago

Did you try it? If yes I will create a release.

eranpeer commented 7 years ago

The new single header for fakeit for catch is already on master and can be used.

dvirtz commented 7 years ago

I can't reproduce the original problem I had (something with Catch::Matcher) but my code is working well with the new version. I now have to include catch.hpp before fakeit.hpp, however. Wouldn't it be better to include it from fakeit?

eranpeer commented 7 years ago

I think it is better to let the user define the include path. Not sure it is right to assume catch is directly on the include path. What if the user puts catch in a sub folder of a folder in the path and uses the line "include somefolder/catch.hpp" in the tests code? Not sure, what do you think?

On Mar 30, 2017 10:34 AM, "dvirtz" notifications@github.com wrote:

I can't reproduce the original problem I had (something with Catch::Matcher) but my code is working well with the new version. I now have to include catch.hpp before fakeit.hpp, however. Wouldn't it be better to include it from fakeit?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/eranpeer/FakeIt/issues/87#issuecomment-290327211, or mute the thread https://github.com/notifications/unsubscribe-auth/ACc8ggJIomhmoiiMR0cfG6t_hpW7Ye3Rks5rq1sUgaJpZM4MsJ9K .

dvirtz commented 7 years ago

It's indeed hard for header only libraries to depend on other libraries. I personally use the library through Hunter package manager and there it's very easy to define a dependency which also sorts the include dirs.