I searched for googletests using muon, but it looks like ubuntu doesn't have packages for it. Do I need to install using sources?
I searched for googletests using muon, but it looks like ubuntu doesn't have packages for it. Do I need to install using sources?
New information:
It is worth noting libgtest0 no longer exists. As of 2013 or so (I am not sure of the date of the change) see this question:
Why no library files installed for google test?
Old answer prior to 2012:
It is in the Ubuntu repositories
See also man gtest-config
Minimal runnable example
Since Debian/Ubuntu refuse to pack a prebuilt as mentioned at: Why no library files installed for google test? I'll just clone and build it myself (or in a real project, add it as a submodule):
then I use it with my test file
main.cpp
:main.cpp
to get the expected output:
Alternatively, you can also remove the
main
function from themain.cpp
file and instead use the default one provided bylibgtest_main.a
:Tested on Ubuntu 20.04.