Skip to content

Commit 4f05313

Browse files
committed
update googletest.
1 parent 688e4df commit 4f05313

File tree

328 files changed

+72593
-96043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

328 files changed

+72593
-96043
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,5 @@ matrix:
3030
compiler: gcc
3131
env: ANALYZE=ON
3232

33-
before_script:
34-
- cd build && cmake -G "Unix Makefiles" && cd ..
35-
3633
script:
3734
- . ./.travis.sh

build/CMakeLists.txt renamed to CMakeLists.txt

Lines changed: 53 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ add_definitions( -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1)
2929

3030
INCLUDE_DIRECTORIES( BEFORE
3131
${CMAKE_HOME_DIRECTORY}/..
32-
${CMAKE_HOME_DIRECTORY}/../include/
33-
${CMAKE_HOME_DIRECTORY}/../contrib/gtest-1.7.0/include
34-
${CMAKE_HOME_DIRECTORY}/../contrib/gtest-1.7.0/
32+
${CMAKE_HOME_DIRECTORY}/include/
33+
${CMAKE_HOME_DIRECTORY}/contrib/googletest-1.10.0/gtest/include
34+
${CMAKE_HOME_DIRECTORY}/contrib/googletest-1.10.0/gtest
3535
)
3636

3737
link_directories(
38-
${CMAKE_HOME_DIRECTORY}/../
38+
${CMAKE_HOME_DIRECTORY}/
3939
)
4040

4141
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/lib )
@@ -69,40 +69,40 @@ IF (ASSIMP_UBSAN)
6969
ENDIF()
7070

7171
SET ( cppcore_src
72-
../code/cppcore.cpp
73-
../include/cppcore/CPPCoreCommon.h
72+
code/cppcore.cpp
73+
include/cppcore/CPPCoreCommon.h
7474
)
7575

7676
SET ( cppcore_common_src
77-
../include/cppcore/Common/Hash.h
78-
../include/cppcore/Common/TStringBase.h
79-
../include/cppcore/Common/TSharedPtr.h
80-
../include/cppcore/Common/Variant.h
77+
include/cppcore/Common/Hash.h
78+
include/cppcore/Common/TStringBase.h
79+
include/cppcore/Common/TSharedPtr.h
80+
include/cppcore/Common/Variant.h
8181
)
8282

8383
SET( cppcore_random_src
84-
../include/cppcore/Random/RandomGenerator.h
85-
../code/Random/RandomGenerator.cpp
84+
include/cppcore/Random/RandomGenerator.h
85+
code/Random/RandomGenerator.cpp
8686
)
8787

8888
SET ( cppcore_container_src
89-
../include/cppcore/Container/THashMap.h
90-
../include/cppcore/Container/TArray.h
91-
../include/cppcore/Container/TStaticArray.h
92-
../include/cppcore/Container/TList.h
93-
../include/cppcore/Container/TQueue.h
94-
../include/cppcore/Container/TStaticArray.h
89+
include/cppcore/Container/THashMap.h
90+
include/cppcore/Container/TArray.h
91+
include/cppcore/Container/TStaticArray.h
92+
include/cppcore/Container/TList.h
93+
include/cppcore/Container/TQueue.h
94+
include/cppcore/Container/TStaticArray.h
9595
)
9696

9797
SET ( cppcore_memory_src
98-
../include/cppcore/Memory/MemUtils.h
99-
../include/cppcore/Memory/TStackAllocator.h
100-
../include/cppcore/Memory/TPoolAllocator.h
101-
../code/Memory/MemUtils.cpp
98+
include/cppcore/Memory/MemUtils.h
99+
include/cppcore/Memory/TStackAllocator.h
100+
include/cppcore/Memory/TPoolAllocator.h
101+
code/Memory/MemUtils.cpp
102102
)
103103

104104
SET( cppcore_io_src
105-
../include/cppcore/IO/FileSystem.h
105+
include/cppcore/IO/FileSystem.h
106106
)
107107

108108
SOURCE_GROUP( code FILES ${cppcore_src} )
@@ -116,74 +116,64 @@ ADD_LIBRARY( cppcore SHARED
116116
${cppcore_container_src}
117117
${cppcore_common_src}
118118
${cppcore_memory_src}
119-
${cppcore_random_src}
119+
${cppcore_random_src}
120120
${cppcore_io_src}
121121
${cppcore_src}
122122
)
123123

124124

125125
IF( BUILD_UNITTESTS )
126126
SET( cppcore_test_src
127-
../test/CPPCoreCommonTest.cpp
127+
test/CPPCoreCommonTest.cpp
128128
)
129129

130130
SET( cppcore_common_test_src
131-
../test/common/HashTest.cpp
132-
../test/common/VariantTest.cpp
133-
../test/common/TSharedPtrTest.cpp
131+
test/common/HashTest.cpp
132+
test/common/VariantTest.cpp
133+
test/common/TSharedPtrTest.cpp
134134
)
135135

136136
SET( cppcore_container_test_src
137-
../test/container/TArrayTest.cpp
138-
../test/container/THashMapTest.cpp
139-
../test/container/TListTest.cpp
140-
../test/container/TQueueTest.cpp
141-
../test/container/TStaticArrayTest.cpp
137+
test/container/TArrayTest.cpp
138+
test/container/THashMapTest.cpp
139+
test/container/TListTest.cpp
140+
test/container/TQueueTest.cpp
141+
test/container/TStaticArrayTest.cpp
142142
)
143143

144144
SET( cppcore_memory_test_src
145-
../test/memory/TStackAllocatorTest.cpp
146-
../test/memory/TPoolAllocatorTest.cpp
145+
test/memory/TStackAllocatorTest.cpp
146+
test/memory/TPoolAllocatorTest.cpp
147147
)
148148

149-
SET( cppcore_random_test_src
150-
../test/Random/RandomGeneratorTest.cpp
151-
)
152-
153-
SET ( GTEST_PATH ../contrib/gtest-1.7.0 )
154-
155-
SET ( gtest_src
156-
${GTEST_PATH}/src/gtest-death-test.cc
157-
${GTEST_PATH}/src/gtest-filepath.cc
158-
${GTEST_PATH}/src/gtest-internal-inl.h
159-
${GTEST_PATH}/src/gtest-port.cc
160-
${GTEST_PATH}/src/gtest-printers.cc
161-
${GTEST_PATH}/src/gtest-test-part.cc
162-
${GTEST_PATH}/src/gtest-typed-test.cc
163-
${GTEST_PATH}/src/gtest.cc
164-
${GTEST_PATH}/src/gtest_main.cc
149+
SET( cppcore_random_test_src
150+
test/Random/RandomGeneratorTest.cpp
165151
)
152+
153+
SET ( GTEST_PATH ../contrib/googletest-1.10.0 )
154+
166155
SOURCE_GROUP( code FILES ${cppcore_test_src} )
167156
SOURCE_GROUP( code\\common FILES ${cppcore_common_test_src} )
168157
SOURCE_GROUP( code\\container FILES ${cppcore_container_test_src} )
169158
SOURCE_GROUP( code\\memory FILES ${cppcore_memory_test_src} )
170-
SOURCE_GROUP( code\\random FILES ${cppcore_random_test_src} )
171-
SOURCE_GROUP( contrib\\gtest FILES ${gtest_src} )
159+
SOURCE_GROUP( code\\random FILES ${cppcore_random_test_src} )
160+
161+
# Prevent overriding the parent project's compiler/linker
162+
# settings on Windows
163+
SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
164+
ADD_SUBDIRECTORY( contrib/googletest-1.10.x/googletest )
172165
ADD_EXECUTABLE( cppcore_unittest
173-
${gtest_src}
174166
${cppcore_test_src}
175167
${cppcore_common_test_src}
176168
${cppcore_memory_test_src}
177-
${cppcore_random_test_src}
169+
${cppcore_random_test_src}
178170
${cppcore_container_test_src}
179171
)
180172

181-
IF( WIN32 )
182-
SET( platform_libs )
183-
ELSE( WIN32 )
184-
SET( platform_libs pthread )
185-
ENDIF( WIN32 )
186-
target_link_libraries( cppcore_unittest cppcore ${CMAKE_THREAD_LIBS_INIT} ${platform_libs} )
187-
188-
173+
IF( WIN32 )
174+
SET( platform_libs )
175+
ELSE( WIN32 )
176+
SET( platform_libs pthread )
177+
ENDIF( WIN32 )
178+
target_link_libraries( cppcore_unittest cppcore ${CMAKE_THREAD_LIBS_INIT} gtest_main ${platform_libs} )
189179
ENDIF( BUILD_UNITTESTS )

build/ClangOverrides.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Run manually to reformat a file:
2+
# clang-format -i --style=file <file>
3+
Language: Cpp
4+
BasedOnStyle: Google

contrib/googletest-1.10.x/.gitignore

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Ignore CI build directory
2+
build/
3+
xcuserdata
4+
cmake-build-debug/
5+
.idea/
6+
bazel-bin
7+
bazel-genfiles
8+
bazel-googletest
9+
bazel-out
10+
bazel-testlogs
11+
# python
12+
*.pyc
13+
14+
# Visual Studio files
15+
.vs
16+
*.sdf
17+
*.opensdf
18+
*.VC.opendb
19+
*.suo
20+
*.user
21+
_ReSharper.Caches/
22+
Win32-Debug/
23+
Win32-Release/
24+
x64-Debug/
25+
x64-Release/
26+
27+
# Ignore autoconf / automake files
28+
Makefile.in
29+
aclocal.m4
30+
configure
31+
build-aux/
32+
autom4te.cache/
33+
googletest/m4/libtool.m4
34+
googletest/m4/ltoptions.m4
35+
googletest/m4/ltsugar.m4
36+
googletest/m4/ltversion.m4
37+
googletest/m4/lt~obsolete.m4
38+
googlemock/m4
39+
40+
# Ignore generated directories.
41+
googlemock/fused-src/
42+
googletest/fused-src/
43+
44+
# macOS files
45+
.DS_Store
46+
googletest/.DS_Store
47+
googletest/xcode/.DS_Store
48+
49+
# Ignore cmake generated directories and files.
50+
CMakeFiles
51+
CTestTestfile.cmake
52+
Makefile
53+
cmake_install.cmake
54+
googlemock/CMakeFiles
55+
googlemock/CTestTestfile.cmake
56+
googlemock/Makefile
57+
googlemock/cmake_install.cmake
58+
googlemock/gtest
59+
/bin
60+
/googlemock/gmock.dir
61+
/googlemock/gmock_main.dir
62+
/googlemock/RUN_TESTS.vcxproj.filters
63+
/googlemock/RUN_TESTS.vcxproj
64+
/googlemock/INSTALL.vcxproj.filters
65+
/googlemock/INSTALL.vcxproj
66+
/googlemock/gmock_main.vcxproj.filters
67+
/googlemock/gmock_main.vcxproj
68+
/googlemock/gmock.vcxproj.filters
69+
/googlemock/gmock.vcxproj
70+
/googlemock/gmock.sln
71+
/googlemock/ALL_BUILD.vcxproj.filters
72+
/googlemock/ALL_BUILD.vcxproj
73+
/lib
74+
/Win32
75+
/ZERO_CHECK.vcxproj.filters
76+
/ZERO_CHECK.vcxproj
77+
/RUN_TESTS.vcxproj.filters
78+
/RUN_TESTS.vcxproj
79+
/INSTALL.vcxproj.filters
80+
/INSTALL.vcxproj
81+
/googletest-distribution.sln
82+
/CMakeCache.txt
83+
/ALL_BUILD.vcxproj.filters
84+
/ALL_BUILD.vcxproj

contrib/googletest-1.10.x/.travis.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Build matrix / environment variable are explained on:
2+
# https://docs.travis-ci.com/user/customizing-the-build/
3+
# This file can be validated on:
4+
# http://lint.travis-ci.org/
5+
6+
language: cpp
7+
8+
# Define the matrix explicitly, manually expanding the combinations of (os, compiler, env).
9+
# It is more tedious, but grants us far more flexibility.
10+
matrix:
11+
include:
12+
- os: linux
13+
before_install: chmod -R +x ./ci/*platformio.sh
14+
install: ./ci/install-platformio.sh
15+
script: ./ci/build-platformio.sh
16+
- os: linux
17+
dist: xenial
18+
compiler: gcc
19+
install: ./ci/install-linux.sh && ./ci/log-config.sh
20+
script: ./ci/build-linux-bazel.sh
21+
- os: linux
22+
dist: xenial
23+
compiler: clang
24+
install: ./ci/install-linux.sh && ./ci/log-config.sh
25+
script: ./ci/build-linux-bazel.sh
26+
- os: linux
27+
compiler: gcc
28+
env: BUILD_TYPE=Debug VERBOSE=1 CXX_FLAGS=-std=c++11
29+
- os: linux
30+
compiler: clang
31+
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 -Wgnu-zero-variadic-macro-arguments
32+
- os: linux
33+
compiler: clang
34+
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 NO_EXCEPTION=ON NO_RTTI=ON COMPILER_IS_GNUCXX=ON
35+
- os: osx
36+
compiler: gcc
37+
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 HOMEBREW_LOGS=~/homebrew-logs HOMEBREW_TEMP=~/homebrew-temp
38+
- os: osx
39+
compiler: clang
40+
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 HOMEBREW_LOGS=~/homebrew-logs HOMEBREW_TEMP=~/homebrew-temp
41+
42+
# These are the install and build (script) phases for the most common entries in the matrix. They could be included
43+
# in each entry in the matrix, but that is just repetitive.
44+
install:
45+
- ./ci/install-${TRAVIS_OS_NAME}.sh
46+
- . ./ci/env-${TRAVIS_OS_NAME}.sh
47+
- ./ci/log-config.sh
48+
49+
script: ./ci/travis.sh
50+
51+
# This section installs the necessary dependencies.
52+
addons:
53+
apt:
54+
# List of whitelisted in travis packages for ubuntu-precise can be found here:
55+
# https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
56+
# List of whitelisted in travis apt-sources:
57+
# https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
58+
sources:
59+
- ubuntu-toolchain-r-test
60+
- llvm-toolchain-precise-3.9
61+
packages:
62+
- g++-4.9
63+
- clang-3.9
64+
update: true
65+
homebrew:
66+
packages:
67+
- ccache
68+
69+
- llvm@4
70+
update: true
71+
72+
notifications:
73+
email: false

0 commit comments

Comments
 (0)