Unverified Commit af8c9abf authored by Jesse Mapel's avatar Jesse Mapel Committed by GitHub
Browse files

Update googletest setup (#4978)

* Use built in gtest cmake

* Update gtest

* Roll back to last release

* Roll back to gtest 1.10
parent 23bb827b
Loading
Loading
Loading
Loading
Compare e588eb1f to 703bd9ca
Original line number Diff line number Diff line
Subproject commit e588eb1ff9ff6598666279b737b27f983156ad85
Subproject commit 703bd9caab50b139428cea1aaff9974ebee5742e
+0 −2
Original line number Diff line number Diff line
@@ -17,8 +17,6 @@ include(AddIsisModule)
include(Utilities)
include(TestSetup)
include(InstallThirdParty)
include(cmake/gtest.cmake)
include(GoogleTest)

include(CMakePrintHelpers)

isis/cmake/gtest.cmake

deleted100644 → 0
+0 −39
Original line number Diff line number Diff line
if (NOT TARGET gtest)
  set(GOOGLETEST_ROOT ${CMAKE_SOURCE_DIR}/../gtest/googletest CACHE STRING "Google Test source root")

  include_directories(SYSTEM
      ${GOOGLETEST_ROOT}
      ${GOOGLETEST_ROOT}/include
      )

  set(GOOGLETEST_SOURCES
      ${GOOGLETEST_ROOT}/src/gtest-all.cc
      ${GOOGLETEST_ROOT}/src/gtest_main.cc
      )

  foreach(_source ${GOOGLETEST_SOURCES})
      set_source_files_properties(${_source} PROPERTIES GENERATED 1)
  endforeach()

  add_library(gtest ${GOOGLETEST_SOURCES})
endif()

if (NOT TARGET gmock)
  set(GOOGLEMOCK_ROOT ${CMAKE_SOURCE_DIR}/../gtest/googlemock CACHE STRING "Google Mock source root")

  include_directories(SYSTEM
      ${GOOGLEMOCK_ROOT}
      ${GOOGLEMOCK_ROOT}/include
      )

  set(GOOGLEMOCK_SOURCES
      ${GOOGLEMOCK_ROOT}/src/gmock-all.cc
      ${GOOGLEMOCK_ROOT}/src/gmock_main.cc
      )

  foreach(_source ${GOOGLEMOCK_SOURCES})
      set_source_files_properties(${_source} PROPERTIES GENERATED 1)
  endforeach()

  add_library(gmock ${GOOGLEMOCK_SOURCES})
endif()
+5 −1
Original line number Diff line number Diff line
cmake_minimum_required(VERSION 3.10)

set(INSTALL_GTEST OFF)
add_subdirectory(../../gtest gtest)
include(GoogleTest)

add_dependencies(isis isis)

file(GLOB test_source "${CMAKE_SOURCE_DIR}/tests/*.cpp")
@@ -43,6 +47,6 @@ add_executable(runISISTests
               IsisTestMain.cpp
               ${test_source})

target_link_libraries(runISISTests isis ${MISSION_LIBS} ${ALLLIBS} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} Threads::Threads)
target_link_libraries(runISISTests isis ${MISSION_LIBS} ${ALLLIBS} gmock_main)

gtest_discover_tests(runISISTests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests PROPERTIES DISCOVERY_TIMEOUT 6000)