Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
1ae4096b
Commit
1ae4096b
authored
Oct 27, 2017
by
Bryan Zimmerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for VS2017 deprecation of ::tr1::tuple
change static_cast to ImplicitCast_ for consitency fixes for building with path names containing spaces
parent
3121b204
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
22 deletions
+31
-22
CMakeLists.txt
googlemock/CMakeLists.txt
+7
-5
gmock-generated-matchers_test.cc
googlemock/test/gmock-generated-matchers_test.cc
+5
-4
CMakeLists.txt
googletest/CMakeLists.txt
+10
-8
internal_utils.cmake
googletest/cmake/internal_utils.cmake
+2
-1
gtest-port.h
googletest/include/gtest/internal/gtest-port.h
+4
-1
gtest-printers_test.cc
googletest/test/gtest-printers_test.cc
+3
-3
No files found.
googlemock/CMakeLists.txt
View file @
1ae4096b
...
...
@@ -74,6 +74,8 @@ include_directories("${gmock_SOURCE_DIR}/include"
# <= VS 2010 <= 10 <= 1600 Use Google Tests's own tuple.
# VS 2012 11 1700 std::tr1::tuple + _VARIADIC_MAX=10
# VS 2013 12 1800 std::tr1::tuple
# VS 2015 14 1900 std::tuple
# VS 2017 15 1910 std::tuple
if
(
MSVC AND MSVC_VERSION EQUAL 1700
)
add_definitions
(
/D _VARIADIC_MAX=10
)
endif
()
...
...
@@ -110,11 +112,11 @@ endif()
# Install rules
if
(
INSTALL_GMOCK
)
install
(
TARGETS gmock gmock_main
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
install
(
DIRECTORY
${
gmock_SOURCE_DIR
}
/include/gmock
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
)
RUNTIME DESTINATION
"
${
CMAKE_INSTALL_BINDIR
}
"
LIBRARY DESTINATION
"
${
CMAKE_INSTALL_LIBDIR
}
"
ARCHIVE DESTINATION
"
${
CMAKE_INSTALL_LIBDIR
}
"
)
install
(
DIRECTORY
"
${
gmock_SOURCE_DIR
}
/include/gmock"
DESTINATION
"
${
CMAKE_INSTALL_INCLUDEDIR
}
"
)
# configure and install pkgconfig files
configure_file
(
...
...
googlemock/test/gmock-generated-matchers_test.cc
View file @
1ae4096b
...
...
@@ -64,6 +64,7 @@ using testing::ElementsAreArray;
using
testing
::
Eq
;
using
testing
::
Ge
;
using
testing
::
Gt
;
using
testing
::
internal
::
ImplicitCast_
;
using
testing
::
Le
;
using
testing
::
Lt
;
using
testing
::
MakeMatcher
;
...
...
@@ -120,7 +121,7 @@ TEST(ArgsTest, AcceptsOneTemplateArg) {
}
TEST
(
ArgsTest
,
AcceptsTwoTemplateArgs
)
{
const
tuple
<
short
,
int
,
long
>
t
(
static_cast
<
short
>
(
4
),
5
,
6L
);
// NOLINT
const
tuple
<
short
,
int
,
long
>
t
(
ImplicitCast_
<
short
>
(
4
),
5
,
6L
);
// NOLINT
EXPECT_THAT
(
t
,
(
Args
<
0
,
1
>
(
Lt
())));
EXPECT_THAT
(
t
,
(
Args
<
1
,
2
>
(
Lt
())));
...
...
@@ -128,13 +129,13 @@ TEST(ArgsTest, AcceptsTwoTemplateArgs) {
}
TEST
(
ArgsTest
,
AcceptsRepeatedTemplateArgs
)
{
const
tuple
<
short
,
int
,
long
>
t
(
static_cast
<
short
>
(
4
),
5
,
6L
);
// NOLINT
const
tuple
<
short
,
int
,
long
>
t
(
ImplicitCast_
<
short
>
(
4
),
5
,
6L
);
// NOLINT
EXPECT_THAT
(
t
,
(
Args
<
0
,
0
>
(
Eq
())));
EXPECT_THAT
(
t
,
Not
(
Args
<
1
,
1
>
(
Ne
())));
}
TEST
(
ArgsTest
,
AcceptsDecreasingTemplateArgs
)
{
const
tuple
<
short
,
int
,
long
>
t
(
static_cast
<
short
>
(
4
),
5
,
6L
);
// NOLINT
const
tuple
<
short
,
int
,
long
>
t
(
ImplicitCast_
<
short
>
(
4
),
5
,
6L
);
// NOLINT
EXPECT_THAT
(
t
,
(
Args
<
2
,
0
>
(
Gt
())));
EXPECT_THAT
(
t
,
Not
(
Args
<
2
,
1
>
(
Lt
())));
}
...
...
@@ -159,7 +160,7 @@ TEST(ArgsTest, AcceptsMoreTemplateArgsThanArityOfOriginalTuple) {
}
TEST
(
ArgsTest
,
CanBeNested
)
{
const
tuple
<
short
,
int
,
long
,
int
>
t
(
static_cast
<
short
>
(
4
),
5
,
6L
,
6
);
// NOLINT
const
tuple
<
short
,
int
,
long
,
int
>
t
(
ImplicitCast_
<
short
>
(
4
),
5
,
6L
,
6
);
// NOLINT
EXPECT_THAT
(
t
,
(
Args
<
1
,
2
,
3
>
(
Args
<
1
,
2
>
(
Eq
()))));
EXPECT_THAT
(
t
,
(
Args
<
0
,
1
,
3
>
(
Args
<
0
,
2
>
(
Lt
()))));
}
...
...
googletest/CMakeLists.txt
View file @
1ae4096b
...
...
@@ -74,8 +74,8 @@ config_compiler_and_linker() # Defined in internal_utils.cmake.
# Where Google Test's .h files can be found.
include_directories
(
${
gtest_SOURCE_DIR
}
/include
${
gtest_SOURCE_DIR
}
)
"
${
gtest_SOURCE_DIR
}
/include"
"
${
gtest_SOURCE_DIR
}
"
)
# Summary of tuple support for Microsoft Visual Studio:
# Compiler version(MS) version(cmake) Support
...
...
@@ -83,10 +83,12 @@ include_directories(
# <= VS 2010 <= 10 <= 1600 Use Google Tests's own tuple.
# VS 2012 11 1700 std::tr1::tuple + _VARIADIC_MAX=10
# VS 2013 12 1800 std::tr1::tuple
# VS 2015 14 1900 std::tuple
# VS 2017 15 1910 std::tuple
if
(
MSVC AND MSVC_VERSION EQUAL 1700
)
add_definitions
(
/D _VARIADIC_MAX=10
)
endif
()
########################################################################
#
# Defines the gtest & gtest_main libraries. User tests should link
...
...
@@ -112,11 +114,11 @@ endif()
# Install rules
if
(
INSTALL_GTEST
)
install
(
TARGETS gtest gtest_main
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
install
(
DIRECTORY
${
gtest_SOURCE_DIR
}
/include/gtest
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
)
RUNTIME DESTINATION
"
${
CMAKE_INSTALL_BINDIR
}
"
ARCHIVE DESTINATION
"
${
CMAKE_INSTALL_LIBDIR
}
"
LIBRARY DESTINATION
"
${
CMAKE_INSTALL_LIBDIR
}
"
)
install
(
DIRECTORY
"
${
gtest_SOURCE_DIR
}
/include/gtest"
DESTINATION
"
${
CMAKE_INSTALL_INCLUDEDIR
}
"
)
# configure and install pkgconfig files
configure_file
(
...
...
googletest/cmake/internal_utils.cmake
View file @
1ae4096b
...
...
@@ -62,7 +62,8 @@ macro(config_compiler_and_linker)
if
(
MSVC
)
# Newlines inside flags variables break CMake's NMake generator.
# TODO(vladl@google.com): Add -RTCs and -RTCu to debug builds.
set
(
cxx_base_flags
"-GS -W4 -WX -wd4251 -wd4275 -nologo -J -Zi"
)
# -J does not set path correctly for pdb with spaces
set
(
cxx_base_flags
"-GS -W4 -WX -wd4251 -wd4275 -nologo -Zi"
)
if
(
MSVC_VERSION LESS 1400
)
# 1400 is Visual Studio 2005
# Suppress spurious warnings MSVC 7.1 sometimes issues.
# Forcing value to bool.
...
...
googletest/include/gtest/internal/gtest-port.h
View file @
1ae4096b
...
...
@@ -642,8 +642,11 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
// STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
# define GTEST_HAS_TR1_TUPLE 0
# elif _MSC_VER >= 1910
// VS2017 deprecated ::tr1::tuple
# define GTEST_HAS_TR1_TUPLE 0
# else
// The user didn't tell us not to do it, so we assume it's OK.
// The user didn't tell us not to do it, so we assume it's OK.
# define GTEST_HAS_TR1_TUPLE 1
# endif
#endif // GTEST_HAS_TR1_TUPLE
...
...
googletest/test/gtest-printers_test.cc
View file @
1ae4096b
...
...
@@ -1092,8 +1092,8 @@ TEST(PrintTr1TupleTest, VariousSizes) {
::
std
::
tr1
::
tuple
<
bool
,
char
,
short
,
testing
::
internal
::
Int32
,
// NOLINT
testing
::
internal
::
Int64
,
float
,
double
,
const
char
*
,
void
*
,
std
::
string
>
t10
(
false
,
'a'
,
static_cast
<
short
>
(
3
),
4
,
5
,
1.5
F
,
-
2.5
,
str
,
ImplicitCast_
<
void
*>
(
NULL
),
"10"
);
t10
(
false
,
'a'
,
3
,
4
,
5
,
1.5
F
,
-
2.5
,
str
,
ImplicitCast_
<
void
*>
(
NULL
),
"10"
);
EXPECT_EQ
(
"(false, 'a' (97, 0x61), 3, 4, 5, 1.5, -2.5, "
+
PrintPointer
(
str
)
+
" pointing to
\"
8
\"
, NULL,
\"
10
\"
)"
,
Print
(
t10
));
...
...
@@ -1152,7 +1152,7 @@ TEST(PrintStdTupleTest, VariousSizes) {
::
std
::
tuple
<
bool
,
char
,
short
,
testing
::
internal
::
Int32
,
// NOLINT
testing
::
internal
::
Int64
,
float
,
double
,
const
char
*
,
void
*
,
std
::
string
>
t10
(
false
,
'a'
,
static_cast
<
short
>
(
3
),
4
,
5
,
1.5
F
,
-
2.5
,
str
,
t10
(
false
,
'a'
,
ImplicitCast_
<
short
>
(
3
),
4
,
5
,
1.5
F
,
-
2.5
,
str
,
ImplicitCast_
<
void
*>
(
NULL
),
"10"
);
EXPECT_EQ
(
"(false, 'a' (97, 0x61), 3, 4, 5, 1.5, -2.5, "
+
PrintPointer
(
str
)
+
" pointing to
\"
8
\"
, NULL,
\"
10
\"
)"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment