this is the problem : #include "Foo.h" you should set the right path
// test/test_desktop/foo_test.cpp #include <gtest/gtest.h> #include "../../src/Foo.h" TEST(Foo, test_bar) { Foo foo; ASSERT_EQ(foo.bar(), 0); }