Robotics StackExchange | Archived questions

gtest is failing under fuerte

Hi,

When attempting to perform a "make test" using gtest and an EXPECT_* macro I get:

undefined reference to `testing::internal::AssertHelper::AssertHelper(testing::TestPartResultType, char const, int, char const)'

otherwise, if I comment those checks out then the tests run.

When searching google, it seems that this can happen when trying to use a pre-installed version of gtest. I believe the source is being used in /usr/src/gtest however.

I am using rosbuildaddgtest(unittests test/unittests.cpp) to specify compilation in CMakeLists.txt

Any ideas?

Edit: I tried compiling the test by hand with g++. I figured out that somehow I had ended up with a mismatch between the /usr/src/gtest and /usr/include/gtest. I replaced the /usr/include/gtest folder /usr/src/gtest/include/gtest folder and it works now. For anyone that experiences a similar problem, it is still more likely to be that gtest was pre-compiled with the wrong flags, or you are accidentally linking against a pre-compiled library in /usr/lib.

Thanks

Asked by guitardude012 on 2013-04-04 09:26:46 UTC

Comments

I tried to close this, but I don't have enough reputation.

Asked by guitardude012 on 2013-04-05 07:08:47 UTC

Answers

hi, how do you run the test ? with "make test" , "make tests" or run the binary directly with e.g. test/bin/unit_tests ? Try run the test directly, what does this do?

Asked by inflo on 2013-04-05 06:58:55 UTC

Comments