Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) GmockExample1

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./CppGmockExample1/CppGmockExample1.pro

 

include(../../ConsoleApplicationNoEffCpp.pri) #Google Test does not go well together with -weffc++
include(../../Libraries/Boost.pri)


INCLUDEPATH += ../../Libraries/gmock-1.7.0/include
INCLUDEPATH += ../../Libraries/gmock-1.7.0/gtest/include

LIBS += -L../../Libraries/gmock-1.7.0/lib -lgmock
LIBS += -L../../Libraries/gmock-1.7.0/gtest/lib -lgtest

SOURCES += main.cpp

 

 

 

 

 

./CppGmockExample1/main.cpp

 

#include <gmock/gmock.h>

TEST(MyTestCaseName,OneAndOneIsTwo)
{
  ASSERT_THAT(1 + 1,testing::Eq(2));
}

int main(int argc, char* argv[])
{
  testing::InitGoogleMock(&argc,argv);
  return RUN_ALL_TESTS();
}

/* Does not link:

/MyFolder/CppGmockExample1:
error while loading shared libraries: libgmock.so.0:
cannot open shared object file: No such file or directory

*/

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml