mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Add googletest as submodule
This commit is contained in:
		
							
								
								
									
										3
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| [submodule "test/googletest"] | ||||
| 	path = test/googletest | ||||
| 	url = https://github.com/google/googletest | ||||
| @@ -17,17 +17,16 @@ matrix: | ||||
|   - os: linux | ||||
|     compiler: clang | ||||
|     env: VCMI_PLATFORM='linux' REAL_CC=clang-3.6 REAL_CXX=clang++-3.6 PACKAGE=clang-3.6 | ||||
|       SUPPORT=libstdc++-4.8-dev VCMI_CMAKE_FLAGS='-DENABLE_TEST=0' | ||||
|       SUPPORT=libstdc++-4.8-dev | ||||
|   - os: linux | ||||
|     compiler: clang | ||||
|     env: VCMI_PLATFORM='linux' REAL_CC=clang-3.4 REAL_CXX=clang++-3.4 PACKAGE=clang-3.4 | ||||
|       SUPPORT=libstdc++-4.8-dev VCMI_CMAKE_FLAGS='-DENABLE_TEST=0' | ||||
|       SUPPORT=libstdc++-4.8-dev | ||||
|   - os: linux | ||||
|     compiler: gcc | ||||
|     env: VCMI_PLATFORM='linux' REAL_CC=gcc-4.8   REAL_CXX=g++-4.8     PACKAGE=g++-4.8   SUPPORT= | ||||
|       VCMI_CMAKE_FLAGS='-DENABLE_TEST=0' | ||||
|   - os: linux | ||||
|     env: VCMI_PLATFORM='mxe' MXE_TARGET=i686-w64-mingw32.shared VCMI_CMAKE_FLAGS='-DENABLE_TEST=0' | ||||
|     env: VCMI_PLATFORM='mxe' MXE_TARGET=i686-w64-mingw32.shared | ||||
|     sudo: required | ||||
|   - os: osx | ||||
|     env: VCMI_PLATFORM='mac' | ||||
| @@ -40,7 +39,7 @@ addons: | ||||
|     notification_email: coverity@arseniyshestakov.com | ||||
|     build_command_prepend: cov-configure --compiler clang-3.6 --comptype clangcc && | ||||
|       cov-configure --comptype clangcxx --compiler clang++-3.6 && cmake -G Ninja .. | ||||
|       -DCMAKE_BUILD_TYPE=DEBUG -DENABLE_LAUNCHER=0 -DENABLE_TEST=0 | ||||
|       -DCMAKE_BUILD_TYPE=DEBUG -DENABLE_LAUNCHER=0 | ||||
|     build_command: ninja -j 3 | ||||
|     branch_pattern: coverity_scan | ||||
|  | ||||
|   | ||||
| @@ -1,10 +1,19 @@ | ||||
| cmake_minimum_required(VERSION 2.8.7) | ||||
|  | ||||
| project(test) | ||||
|  | ||||
| enable_testing() | ||||
|  | ||||
| set(googleTest_Dir ${CMAKE_CURRENT_SOURCE_DIR}/googletest) | ||||
| if (EXISTS ${googleTest_Dir}) | ||||
|     SET(GTestSrc ${googleTest_Dir}/googletest) | ||||
|     SET(GMockSrc ${googleTest_Dir}/googlemock) | ||||
| else () | ||||
|     message( FATAL_ERROR "No googletest src dir found!") | ||||
| endif () | ||||
| include_directories(${GTestSrc} ${GTestSrc}/include ${GMockSrc} ${GMockSrc}/include) | ||||
| include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_HOME_DIRECTORY}/include ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/test) | ||||
| include_directories(${Boost_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) | ||||
| find_package(GTest REQUIRED) | ||||
| include_directories(${GTEST_INCLUDE_DIRS}) | ||||
|  | ||||
| set(test_SRCS | ||||
|  		StdInc.cpp | ||||
| @@ -27,8 +36,10 @@ set(test_HEADERS | ||||
|  		map/MapComparer.h | ||||
| ) | ||||
|  | ||||
| add_executable(vcmitest ${test_SRCS} ${test_HEADERS}) | ||||
| target_link_libraries(vcmitest vcmi gtest ${RT_LIB} ${DL_LIB}) | ||||
| add_subdirectory(googletest) | ||||
|  | ||||
| add_executable(vcmitest ${test_SRCS} ${test_HEADERS} ${GTestSrc}/src/gtest-all.cc ${GMockSrc}/src/gmock-all.cc) | ||||
| target_link_libraries(vcmitest vcmi ${RT_LIB} ${DL_LIB}) | ||||
| add_test(vcmitest vcmitest) | ||||
|  | ||||
| vcmi_set_output_dir(vcmitest "") | ||||
|   | ||||
| @@ -8,6 +8,6 @@ | ||||
|  * | ||||
|  */ | ||||
| #pragma once | ||||
| #include <gtest/gtest.h> | ||||
| #include <gmock/gmock.h> | ||||
| #include "gtest/gtest.h" | ||||
| #include "gmock/gmock.h" | ||||
| #include "Global.h" | ||||
|   | ||||
							
								
								
									
										1
									
								
								test/googletest
									
									
									
									
									
										Submodule
									
								
							
							
								
								
								
								
								
							
						
						
									
										1
									
								
								test/googletest
									
									
									
									
									
										Submodule
									
								
							 Submodule test/googletest added at 4bab34d208
									
								
							
		Reference in New Issue
	
	Block a user