Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
4005388b
Unverified
Commit
4005388b
authored
Aug 31, 2018
by
Gennadiy Civil
Committed by
GitHub
Aug 31, 2018
Browse files
Merge pull request #1799 from google/9A681768AABE08D1EFA5CA77528236A4
Googletest export
parents
b8e25620
6dd60ec4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
44 deletions
+45
-44
googlemock/include/gmock/gmock-matchers.h
googlemock/include/gmock/gmock-matchers.h
+4
-3
googletest/include/gtest/gtest-typed-test.h
googletest/include/gtest/gtest-typed-test.h
+1
-1
googletest/test/googletest-output-test-golden-lin.txt
googletest/test/googletest-output-test-golden-lin.txt
+24
-24
googletest/test/googletest-output-test_.cc
googletest/test/googletest-output-test_.cc
+8
-8
googletest/test/gtest-typed-test_test.cc
googletest/test/gtest-typed-test_test.cc
+8
-8
No files found.
googlemock/include/gmock/gmock-matchers.h
View file @
4005388b
...
@@ -56,9 +56,10 @@
...
@@ -56,9 +56,10 @@
# include <initializer_list> // NOLINT -- must be after gtest.h
# include <initializer_list> // NOLINT -- must be after gtest.h
#endif
#endif
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4251
5046
\
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
/* class A needs to have dll-interface to be used by clients of class B */
\
4251
5046
/* class A needs to have dll-interface to be used by clients of
/* Symbol involving type with internal linkage not defined */
)
class B */
/* Symbol involving type with internal linkage not defined */
)
namespace
testing
{
namespace
testing
{
...
...
googletest/include/gtest/gtest-typed-test.h
View file @
4005388b
...
@@ -96,7 +96,7 @@ TYPED_TEST(FooTest, HasPropertyA) { ... }
...
@@ -96,7 +96,7 @@ TYPED_TEST(FooTest, HasPropertyA) { ... }
// static std::string GetName(int) {
// static std::string GetName(int) {
// if (std::is_same<T, char>()) return "char";
// if (std::is_same<T, char>()) return "char";
// if (std::is_same<T, int>()) return "int";
// if (std::is_same<T, int>()) return "int";
// if (std::is_same<T, unsigned int>()) return "unsigned
_i
nt";
// if (std::is_same<T, unsigned int>()) return "unsigned
I
nt";
// }
// }
// };
// };
// TYPED_TEST_CASE(FooTest, MyTypes, MyTypeNames);
// TYPED_TEST_CASE(FooTest, MyTypes, MyTypeNames);
...
...
googletest/test/googletest-output-test-golden-lin.txt
View file @
4005388b
...
@@ -606,24 +606,24 @@ Expected failure
...
@@ -606,24 +606,24 @@ Expected failure
Stack trace: (omitted)
Stack trace: (omitted)
[0;31m[ FAILED ] [mTypedTest/0.Failure, where TypeParam = int
[0;31m[ FAILED ] [mTypedTest/0.Failure, where TypeParam = int
[0;32m[----------] [m2 tests from TypedTestWithNames/char
_
0, where TypeParam = char
[0;32m[----------] [m2 tests from TypedTestWithNames/char0, where TypeParam = char
[0;32m[ RUN ] [mTypedTestWithNames/char
_
0.Success
[0;32m[ RUN ] [mTypedTestWithNames/char0.Success
[0;32m[ OK ] [mTypedTestWithNames/char
_
0.Success
[0;32m[ OK ] [mTypedTestWithNames/char0.Success
[0;32m[ RUN ] [mTypedTestWithNames/char
_
0.Failure
[0;32m[ RUN ] [mTypedTestWithNames/char0.Failure
googletest-output-test_.cc:#: Failure
googletest-output-test_.cc:#: Failure
Failed
Failed
Stack trace: (omitted)
Stack trace: (omitted)
[0;31m[ FAILED ] [mTypedTestWithNames/char
_
0.Failure, where TypeParam = char
[0;31m[ FAILED ] [mTypedTestWithNames/char0.Failure, where TypeParam = char
[0;32m[----------] [m2 tests from TypedTestWithNames/int
_
1, where TypeParam = int
[0;32m[----------] [m2 tests from TypedTestWithNames/int1, where TypeParam = int
[0;32m[ RUN ] [mTypedTestWithNames/int
_
1.Success
[0;32m[ RUN ] [mTypedTestWithNames/int1.Success
[0;32m[ OK ] [mTypedTestWithNames/int
_
1.Success
[0;32m[ OK ] [mTypedTestWithNames/int1.Success
[0;32m[ RUN ] [mTypedTestWithNames/int
_
1.Failure
[0;32m[ RUN ] [mTypedTestWithNames/int1.Failure
googletest-output-test_.cc:#: Failure
googletest-output-test_.cc:#: Failure
Failed
Failed
Stack trace: (omitted)
Stack trace: (omitted)
[0;31m[ FAILED ] [mTypedTestWithNames/int
_
1.Failure, where TypeParam = int
[0;31m[ FAILED ] [mTypedTestWithNames/int1.Failure, where TypeParam = int
[0;32m[----------] [m2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char
[0;32m[----------] [m2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char
[0;32m[ RUN ] [mUnsigned/TypedTestP/0.Success
[0;32m[ RUN ] [mUnsigned/TypedTestP/0.Success
[0;32m[ OK ] [mUnsigned/TypedTestP/0.Success
[0;32m[ OK ] [mUnsigned/TypedTestP/0.Success
...
@@ -652,10 +652,10 @@ Expected failure
...
@@ -652,10 +652,10 @@ Expected failure
Stack trace: (omitted)
Stack trace: (omitted)
[0;31m[ FAILED ] [mUnsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
[0;31m[ FAILED ] [mUnsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
[0;32m[----------] [m2 tests from UnsignedCustomName/TypedTestP/unsigned
_c
har
_
0, where TypeParam = unsigned char
[0;32m[----------] [m2 tests from UnsignedCustomName/TypedTestP/unsigned
C
har0, where TypeParam = unsigned char
[0;32m[ RUN ] [mUnsignedCustomName/TypedTestP/unsigned
_c
har
_
0.Success
[0;32m[ RUN ] [mUnsignedCustomName/TypedTestP/unsigned
C
har0.Success
[0;32m[ OK ] [mUnsignedCustomName/TypedTestP/unsigned
_c
har
_
0.Success
[0;32m[ OK ] [mUnsignedCustomName/TypedTestP/unsigned
C
har0.Success
[0;32m[ RUN ] [mUnsignedCustomName/TypedTestP/unsigned
_c
har
_
0.Failure
[0;32m[ RUN ] [mUnsignedCustomName/TypedTestP/unsigned
C
har0.Failure
googletest-output-test_.cc:#: Failure
googletest-output-test_.cc:#: Failure
Expected equality of these values:
Expected equality of these values:
1U
1U
...
@@ -665,11 +665,11 @@ Expected equality of these values:
...
@@ -665,11 +665,11 @@ Expected equality of these values:
Expected failure
Expected failure
Stack trace: (omitted)
Stack trace: (omitted)
[0;31m[ FAILED ] [mUnsignedCustomName/TypedTestP/unsigned
_c
har
_
0.Failure, where TypeParam = unsigned char
[0;31m[ FAILED ] [mUnsignedCustomName/TypedTestP/unsigned
C
har0.Failure, where TypeParam = unsigned char
[0;32m[----------] [m2 tests from UnsignedCustomName/TypedTestP/unsigned
_i
nt
_
1, where TypeParam = unsigned int
[0;32m[----------] [m2 tests from UnsignedCustomName/TypedTestP/unsigned
I
nt1, where TypeParam = unsigned int
[0;32m[ RUN ] [mUnsignedCustomName/TypedTestP/unsigned
_i
nt
_
1.Success
[0;32m[ RUN ] [mUnsignedCustomName/TypedTestP/unsigned
I
nt1.Success
[0;32m[ OK ] [mUnsignedCustomName/TypedTestP/unsigned
_i
nt
_
1.Success
[0;32m[ OK ] [mUnsignedCustomName/TypedTestP/unsigned
I
nt1.Success
[0;32m[ RUN ] [mUnsignedCustomName/TypedTestP/unsigned
_i
nt
_
1.Failure
[0;32m[ RUN ] [mUnsignedCustomName/TypedTestP/unsigned
I
nt1.Failure
googletest-output-test_.cc:#: Failure
googletest-output-test_.cc:#: Failure
Expected equality of these values:
Expected equality of these values:
1U
1U
...
@@ -679,7 +679,7 @@ Expected equality of these values:
...
@@ -679,7 +679,7 @@ Expected equality of these values:
Expected failure
Expected failure
Stack trace: (omitted)
Stack trace: (omitted)
[0;31m[ FAILED ] [mUnsignedCustomName/TypedTestP/unsigned
_i
nt
_
1.Failure, where TypeParam = unsigned int
[0;31m[ FAILED ] [mUnsignedCustomName/TypedTestP/unsigned
I
nt1.Failure, where TypeParam = unsigned int
[0;32m[----------] [m4 tests from ExpectFailureTest
[0;32m[----------] [m4 tests from ExpectFailureTest
[0;32m[ RUN ] [mExpectFailureTest.ExpectFatalFailure
[0;32m[ RUN ] [mExpectFailureTest.ExpectFatalFailure
(expecting 1 failure)
(expecting 1 failure)
...
@@ -944,12 +944,12 @@ Stack trace: (omitted)
...
@@ -944,12 +944,12 @@ Stack trace: (omitted)
[0;31m[ FAILED ] [mExpectFatalFailureTest.FailsWhenStatementReturns
[0;31m[ FAILED ] [mExpectFatalFailureTest.FailsWhenStatementReturns
[0;31m[ FAILED ] [mExpectFatalFailureTest.FailsWhenStatementThrows
[0;31m[ FAILED ] [mExpectFatalFailureTest.FailsWhenStatementThrows
[0;31m[ FAILED ] [mTypedTest/0.Failure, where TypeParam = int
[0;31m[ FAILED ] [mTypedTest/0.Failure, where TypeParam = int
[0;31m[ FAILED ] [mTypedTestWithNames/char
_
0.Failure, where TypeParam = char
[0;31m[ FAILED ] [mTypedTestWithNames/char0.Failure, where TypeParam = char
[0;31m[ FAILED ] [mTypedTestWithNames/int
_
1.Failure, where TypeParam = int
[0;31m[ FAILED ] [mTypedTestWithNames/int1.Failure, where TypeParam = int
[0;31m[ FAILED ] [mUnsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
[0;31m[ FAILED ] [mUnsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
[0;31m[ FAILED ] [mUnsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
[0;31m[ FAILED ] [mUnsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
[0;31m[ FAILED ] [mUnsignedCustomName/TypedTestP/unsigned
_c
har
_
0.Failure, where TypeParam = unsigned char
[0;31m[ FAILED ] [mUnsignedCustomName/TypedTestP/unsigned
C
har0.Failure, where TypeParam = unsigned char
[0;31m[ FAILED ] [mUnsignedCustomName/TypedTestP/unsigned
_i
nt
_
1.Failure, where TypeParam = unsigned int
[0;31m[ FAILED ] [mUnsignedCustomName/TypedTestP/unsigned
I
nt1.Failure, where TypeParam = unsigned int
[0;31m[ FAILED ] [mExpectFailureTest.ExpectFatalFailure
[0;31m[ FAILED ] [mExpectFailureTest.ExpectFatalFailure
[0;31m[ FAILED ] [mExpectFailureTest.ExpectNonFatalFailure
[0;31m[ FAILED ] [mExpectFailureTest.ExpectNonFatalFailure
[0;31m[ FAILED ] [mExpectFailureTest.ExpectFatalFailureOnAllThreads
[0;31m[ FAILED ] [mExpectFailureTest.ExpectFatalFailureOnAllThreads
...
...
googletest/test/googletest-output-test_.cc
View file @
4005388b
...
@@ -40,8 +40,8 @@
...
@@ -40,8 +40,8 @@
#include <stdlib.h>
#include <stdlib.h>
#if _MSC_VER
#if _MSC_VER
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4127
/* conditional expression is constant */
)
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4127
/* conditional expression is constant */
)
#endif //
.
_MSC_VER
#endif // _MSC_VER
#if GTEST_IS_THREADSAFE
#if GTEST_IS_THREADSAFE
using
testing
::
ScopedFakeTestPartResultReporter
;
using
testing
::
ScopedFakeTestPartResultReporter
;
...
@@ -815,9 +815,9 @@ class TypedTestNames {
...
@@ -815,9 +815,9 @@ class TypedTestNames {
template
<
typename
T
>
template
<
typename
T
>
static
std
::
string
GetName
(
int
i
)
{
static
std
::
string
GetName
(
int
i
)
{
if
(
testing
::
internal
::
IsSame
<
T
,
char
>::
value
)
if
(
testing
::
internal
::
IsSame
<
T
,
char
>::
value
)
return
std
::
string
(
"char
_
"
)
+
::
testing
::
PrintToString
(
i
);
return
std
::
string
(
"char"
)
+
::
testing
::
PrintToString
(
i
);
if
(
testing
::
internal
::
IsSame
<
T
,
int
>::
value
)
if
(
testing
::
internal
::
IsSame
<
T
,
int
>::
value
)
return
std
::
string
(
"int
_
"
)
+
::
testing
::
PrintToString
(
i
);
return
std
::
string
(
"int"
)
+
::
testing
::
PrintToString
(
i
);
}
}
};
};
...
@@ -856,10 +856,10 @@ class TypedTestPNames {
...
@@ -856,10 +856,10 @@ class TypedTestPNames {
template
<
typename
T
>
template
<
typename
T
>
static
std
::
string
GetName
(
int
i
)
{
static
std
::
string
GetName
(
int
i
)
{
if
(
testing
::
internal
::
IsSame
<
T
,
unsigned
char
>::
value
)
{
if
(
testing
::
internal
::
IsSame
<
T
,
unsigned
char
>::
value
)
{
return
std
::
string
(
"unsigned
_c
har
_
"
)
+
::
testing
::
PrintToString
(
i
);
return
std
::
string
(
"unsigned
C
har"
)
+
::
testing
::
PrintToString
(
i
);
}
}
if
(
testing
::
internal
::
IsSame
<
T
,
unsigned
int
>::
value
)
{
if
(
testing
::
internal
::
IsSame
<
T
,
unsigned
int
>::
value
)
{
return
std
::
string
(
"unsigned
_i
nt
_
"
)
+
::
testing
::
PrintToString
(
i
);
return
std
::
string
(
"unsigned
I
nt"
)
+
::
testing
::
PrintToString
(
i
);
}
}
}
}
};
};
...
@@ -1103,7 +1103,7 @@ int main(int argc, char **argv) {
...
@@ -1103,7 +1103,7 @@ int main(int argc, char **argv) {
testing
::
AddGlobalTestEnvironment
(
new
FooEnvironment
);
testing
::
AddGlobalTestEnvironment
(
new
FooEnvironment
);
testing
::
AddGlobalTestEnvironment
(
new
BarEnvironment
);
testing
::
AddGlobalTestEnvironment
(
new
BarEnvironment
);
#if _MSC_VER
#if _MSC_VER
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4127
GTEST_DISABLE_MSC_WARNINGS_POP_
()
// 4127
#endif //
.
_MSC_VER
#endif // _MSC_VER
return
RunAllTests
();
return
RunAllTests
();
}
}
googletest/test/gtest-typed-test_test.cc
View file @
4005388b
...
@@ -178,10 +178,10 @@ class TypedTestNames {
...
@@ -178,10 +178,10 @@ class TypedTestNames {
template
<
typename
T
>
template
<
typename
T
>
static
std
::
string
GetName
(
int
i
)
{
static
std
::
string
GetName
(
int
i
)
{
if
(
testing
::
internal
::
IsSame
<
T
,
char
>::
value
)
{
if
(
testing
::
internal
::
IsSame
<
T
,
char
>::
value
)
{
return
std
::
string
(
"char
_
"
)
+
::
testing
::
PrintToString
(
i
);
return
std
::
string
(
"char"
)
+
::
testing
::
PrintToString
(
i
);
}
}
if
(
testing
::
internal
::
IsSame
<
T
,
int
>::
value
)
{
if
(
testing
::
internal
::
IsSame
<
T
,
int
>::
value
)
{
return
std
::
string
(
"int
_
"
)
+
::
testing
::
PrintToString
(
i
);
return
std
::
string
(
"int"
)
+
::
testing
::
PrintToString
(
i
);
}
}
}
}
};
};
...
@@ -193,13 +193,13 @@ TYPED_TEST(TypedTestWithNames, TestCaseName) {
...
@@ -193,13 +193,13 @@ TYPED_TEST(TypedTestWithNames, TestCaseName) {
EXPECT_STREQ
(
::
testing
::
UnitTest
::
GetInstance
()
EXPECT_STREQ
(
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
()
->
current_test_info
()
->
test_case_name
(),
->
test_case_name
(),
"TypedTestWithNames/char
_
0"
);
"TypedTestWithNames/char0"
);
}
}
if
(
testing
::
internal
::
IsSame
<
TypeParam
,
int
>::
value
)
{
if
(
testing
::
internal
::
IsSame
<
TypeParam
,
int
>::
value
)
{
EXPECT_STREQ
(
::
testing
::
UnitTest
::
GetInstance
()
EXPECT_STREQ
(
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
()
->
current_test_info
()
->
test_case_name
(),
->
test_case_name
(),
"TypedTestWithNames/int
_
1"
);
"TypedTestWithNames/int1"
);
}
}
}
}
...
@@ -315,13 +315,13 @@ TYPED_TEST_P(TypeParametrizedTestWithNames, TestCaseName) {
...
@@ -315,13 +315,13 @@ TYPED_TEST_P(TypeParametrizedTestWithNames, TestCaseName) {
EXPECT_STREQ
(
::
testing
::
UnitTest
::
GetInstance
()
EXPECT_STREQ
(
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
()
->
current_test_info
()
->
test_case_name
(),
->
test_case_name
(),
"CustomName/TypeParametrizedTestWithNames/p
_c
har
_
0"
);
"CustomName/TypeParametrizedTestWithNames/p
arC
har0"
);
}
}
if
(
testing
::
internal
::
IsSame
<
TypeParam
,
int
>::
value
)
{
if
(
testing
::
internal
::
IsSame
<
TypeParam
,
int
>::
value
)
{
EXPECT_STREQ
(
::
testing
::
UnitTest
::
GetInstance
()
EXPECT_STREQ
(
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
()
->
current_test_info
()
->
test_case_name
(),
->
test_case_name
(),
"CustomName/TypeParametrizedTestWithNames/p
_i
nt
_
1"
);
"CustomName/TypeParametrizedTestWithNames/p
arI
nt1"
);
}
}
}
}
...
@@ -332,10 +332,10 @@ class TypeParametrizedTestNames {
...
@@ -332,10 +332,10 @@ class TypeParametrizedTestNames {
template
<
typename
T
>
template
<
typename
T
>
static
std
::
string
GetName
(
int
i
)
{
static
std
::
string
GetName
(
int
i
)
{
if
(
testing
::
internal
::
IsSame
<
T
,
char
>::
value
)
{
if
(
testing
::
internal
::
IsSame
<
T
,
char
>::
value
)
{
return
std
::
string
(
"p
_c
har
_
"
)
+
::
testing
::
PrintToString
(
i
);
return
std
::
string
(
"p
arC
har"
)
+
::
testing
::
PrintToString
(
i
);
}
}
if
(
testing
::
internal
::
IsSame
<
T
,
int
>::
value
)
{
if
(
testing
::
internal
::
IsSame
<
T
,
int
>::
value
)
{
return
std
::
string
(
"p
_i
nt
_
"
)
+
::
testing
::
PrintToString
(
i
);
return
std
::
string
(
"p
arI
nt"
)
+
::
testing
::
PrintToString
(
i
);
}
}
}
}
};
};
...
...
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