Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is gtest necessary in the CMakeLists.txt for the unit tests? #296

Closed
cesss opened this issue May 2, 2020 · 3 comments
Closed

Is gtest necessary in the CMakeLists.txt for the unit tests? #296

cesss opened this issue May 2, 2020 · 3 comments
Assignees
Labels

Comments

@cesss
Copy link

cesss commented May 2, 2020

The CMakeLists.txt for the unit tests specifies to link both with gmock and with gtest. When building them static, I got a duplicate symbol in some OSs.

But then I realize that if you link with gmock only, it works fine. So, is the gtest library really needed?

@doyubkim
Copy link
Owner

doyubkim commented May 3, 2020

Good point. I also noticed a similar issue from other projects. Will post a PR soon!

@doyubkim doyubkim added the build label May 3, 2020
@doyubkim doyubkim self-assigned this May 3, 2020
@cesss
Copy link
Author

cesss commented May 3, 2020

Actually, I'm not sure of how gtest/gmock should be linked. I never used them before, and, honestly, I don't like how their code looks (it looks like a pretty untidy design, at least at first glance).

@doyubkim
Copy link
Owner

doyubkim commented May 4, 2020

There are other alternatives like Catch which is also quite popular. I chose gtest since love it or not it's widely used and supported by a variety of IDEs (such as VSCode via extension, CLion, etc). But it is true that it's been one of the major sources of breaking the builds whenever a new version of a compiler is introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants