UnitTests: remove GMock which wasn't used anyway, and the gmock headers fail to compile together with gtest on ubuntu 14.04

This commit is contained in:
scrawl 2015-01-09 20:48:36 +01:00
parent ce2cbab402
commit 9d07edda13
4 changed files with 6 additions and 110 deletions

View file

@ -1,14 +1,7 @@
# TODO: This should not be needed, check how it was done in FindGTEST
set(GMOCK_ROOT "/usr/include")
set(GMOCK_BUILD "/usr/lib")
find_package(GTest REQUIRED)
find_package(GMock REQUIRED)
if (GTEST_FOUND AND GMOCK_FOUND)
if (GTEST_FOUND)
include_directories(${GTEST_INCLUDE_DIRS})
include_directories(${GMOCK_INCLUDE_DIRS})
file(GLOB UNITTEST_SRC_FILES
components/misc/test_*.cpp
@ -18,7 +11,7 @@ if (GTEST_FOUND AND GMOCK_FOUND)
add_executable(openmw_test_suite openmw_test_suite.cpp ${UNITTEST_SRC_FILES})
target_link_libraries(openmw_test_suite ${GMOCK_BOTH_LIBRARIES} ${GTEST_BOTH_LIBRARIES} components)
target_link_libraries(openmw_test_suite ${GTEST_BOTH_LIBRARIES} components)
# Fix for not visible pthreads functions for linker with glibc 2.15
if (UNIX AND NOT APPLE)
target_link_libraries(openmw_test_suite ${CMAKE_THREAD_LIBS_INIT})

View file

@ -1,12 +1,6 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
int main(int argc, char** argv) {
// The following line causes Google Mock to throw an exception on failure,
// which will be interpreted by your testing framework as a test failure.
::testing::GTEST_FLAG(throw_on_failure) = false;
::testing::InitGoogleMock(&argc, argv);
return RUN_ALL_TESTS();
GTEST_API_ int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}