refact: Move GTest to third_party folder
This commit is contained in:
parent
7ed762bd87
commit
07cd523514
|
@ -1,5 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.10) # 设置cmake项目需要的cmake最小版本
|
||||
|
||||
add_subdirectory(third_party/GTest)
|
||||
add_subdirectory(test)
|
||||
add_subdirectory(all_test)
|
||||
|
||||
|
|
|
@ -3,10 +3,6 @@ project(bus_test)
|
|||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
add_subdirectory(./GTest)
|
||||
|
||||
include_directories(GTest/googletest/include)
|
||||
include_directories(GTest/googlemock/include)
|
||||
include_directories(../include)
|
||||
|
||||
aux_source_directory("../src/" SRCS)
|
||||
|
|
|
@ -26,7 +26,7 @@ option(BUILD_GMOCK "Builds the googlemock subproject" ON)
|
|||
option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
|
||||
|
||||
if(BUILD_GMOCK)
|
||||
add_subdirectory( googlemock )
|
||||
add_subdirectory(googlemock)
|
||||
else()
|
||||
add_subdirectory( googletest )
|
||||
add_subdirectory(googletest)
|
||||
endif()
|
|
@ -90,13 +90,13 @@ if (MSVC)
|
|||
cxx_library(gmock
|
||||
"${cxx_strict}"
|
||||
"${gtest_dir}/src/gtest-all.cc"
|
||||
src/gmock-all.cc)
|
||||
src/gmock-all.cc)
|
||||
|
||||
cxx_library(gmock_main
|
||||
"${cxx_strict}"
|
||||
"${gtest_dir}/src/gtest-all.cc"
|
||||
src/gmock-all.cc
|
||||
src/gmock_main.cc)
|
||||
src/gmock-all.cc
|
||||
src/gmock_main.cc)
|
||||
else()
|
||||
cxx_library(gmock "${cxx_strict}" src/gmock-all.cc)
|
||||
target_link_libraries(gmock PUBLIC gtest)
|
|
@ -199,21 +199,21 @@ if (gtest_build_tests)
|
|||
cxx_test(gtest_no_test_unittest gtest)
|
||||
cxx_test(googletest-options-test gtest_main)
|
||||
cxx_test(googletest-param-test-test gtest
|
||||
test/googletest-param-test2-test.cc)
|
||||
test/googletest-param-test2-test.cc)
|
||||
cxx_test(googletest-port-test gtest_main)
|
||||
cxx_test(gtest_pred_impl_unittest gtest_main)
|
||||
cxx_test(gtest_premature_exit_test gtest
|
||||
test/gtest_premature_exit_test.cc)
|
||||
test/gtest_premature_exit_test.cc)
|
||||
cxx_test(googletest-printers-test gtest_main)
|
||||
cxx_test(gtest_prod_test gtest_main
|
||||
test/production.cc)
|
||||
test/production.cc)
|
||||
cxx_test(gtest_repeat_test gtest)
|
||||
cxx_test(gtest_sole_header_test gtest_main)
|
||||
cxx_test(gtest_stress_test gtest)
|
||||
cxx_test(googletest-test-part-test gtest_main)
|
||||
cxx_test(gtest_throw_on_failure_ex_test gtest)
|
||||
cxx_test(gtest-typed-test_test gtest_main
|
||||
test/gtest-typed-test2_test.cc)
|
||||
test/gtest-typed-test2_test.cc)
|
||||
cxx_test(gtest_unittest gtest_main)
|
||||
cxx_test(gtest-unittest-api_test gtest)
|
||||
cxx_test(gtest_skip_in_environment_setup_test gtest_main)
|
||||
|
@ -225,12 +225,12 @@ if (gtest_build_tests)
|
|||
# MSVC 7.1 does not support STL with exceptions disabled.
|
||||
if (NOT MSVC OR MSVC_VERSION GREATER 1310)
|
||||
cxx_library(gtest_no_exception "${cxx_no_exception}"
|
||||
src/gtest-all.cc)
|
||||
src/gtest-all.cc)
|
||||
cxx_library(gtest_main_no_exception "${cxx_no_exception}"
|
||||
src/gtest-all.cc src/gtest_main.cc)
|
||||
src/gtest-all.cc src/gtest_main.cc)
|
||||
endif()
|
||||
cxx_library(gtest_main_no_rtti "${cxx_no_rtti}"
|
||||
src/gtest-all.cc src/gtest_main.cc)
|
||||
src/gtest-all.cc src/gtest_main.cc)
|
||||
|
||||
cxx_test_with_flags(gtest-death-test_ex_nocatch_test
|
||||
"${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0"
|
||||
|
@ -243,7 +243,7 @@ if (gtest_build_tests)
|
|||
gtest_main_no_rtti test/gtest_unittest.cc)
|
||||
|
||||
cxx_shared_library(gtest_dll "${cxx_default}"
|
||||
src/gtest-all.cc src/gtest_main.cc)
|
||||
src/gtest-all.cc src/gtest_main.cc)
|
||||
|
||||
cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}"
|
||||
gtest_dll test/gtest_all_test.cc)
|
||||
|
@ -266,14 +266,14 @@ if (gtest_build_tests)
|
|||
googletest-catch-exceptions-no-ex-test_
|
||||
"${cxx_no_exception}"
|
||||
gtest_main_no_exception
|
||||
test/googletest-catch-exceptions-test_.cc)
|
||||
test/googletest-catch-exceptions-test_.cc)
|
||||
endif()
|
||||
|
||||
cxx_executable_with_flags(
|
||||
googletest-catch-exceptions-ex-test_
|
||||
"${cxx_exception}"
|
||||
gtest_main
|
||||
test/googletest-catch-exceptions-test_.cc)
|
||||
test/googletest-catch-exceptions-test_.cc)
|
||||
py_test(googletest-catch-exceptions-test)
|
||||
|
||||
cxx_executable(googletest-color-test_ test gtest)
|
|
@ -312,7 +312,7 @@ endfunction()
|
|||
# Installs the specified targets and configures the associated pkgconfig files.
|
||||
function(install_project)
|
||||
if(INSTALL_GTEST)
|
||||
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
|
||||
install(DIRECTORY "../../../../include"
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
# Install the project targets.
|
||||
install(TARGETS ${ARGN}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user