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
be6ee26a
Unverified
Commit
be6ee26a
authored
Jan 04, 2018
by
Gennadiy Civil
Committed by
GitHub
Jan 04, 2018
Browse files
Merge pull request #1378 from gennadiycivil/master
upstreaming cl 124976692
parents
a5014476
4216f869
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
11 additions
and
136 deletions
+11
-136
googlemock/test/gmock-internal-utils_test.cc
googlemock/test/gmock-internal-utils_test.cc
+0
-8
googletest/src/gtest-death-test.cc
googletest/src/gtest-death-test.cc
+0
-8
googletest/src/gtest-internal-inl.h
googletest/src/gtest-internal-inl.h
+0
-8
googletest/src/gtest-port.cc
googletest/src/gtest-port.cc
+0
-8
googletest/src/gtest-test-part.cc
googletest/src/gtest-test-part.cc
+0
-8
googletest/src/gtest.cc
googletest/src/gtest.cc
+11
-18
googletest/test/gtest-death-test_test.cc
googletest/test/gtest-death-test_test.cc
+0
-8
googletest/test/gtest-filepath_test.cc
googletest/test/gtest-filepath_test.cc
+0
-8
googletest/test/gtest-options_test.cc
googletest/test/gtest-options_test.cc
+0
-7
googletest/test/gtest-param-test_test.cc
googletest/test/gtest-param-test_test.cc
+0
-4
googletest/test/gtest-port_test.cc
googletest/test/gtest-port_test.cc
+0
-8
googletest/test/gtest_color_test_.cc
googletest/test/gtest_color_test_.cc
+0
-8
googletest/test/gtest_env_var_test_.cc
googletest/test/gtest_env_var_test_.cc
+0
-3
googletest/test/gtest_environment_test.cc
googletest/test/gtest_environment_test.cc
+0
-3
googletest/test/gtest_output_test_.cc
googletest/test/gtest_output_test_.cc
+0
-8
googletest/test/gtest_repeat_test.cc
googletest/test/gtest_repeat_test.cc
+0
-8
googletest/test/gtest_stress_test.cc
googletest/test/gtest_stress_test.cc
+0
-5
googletest/test/gtest_unittest.cc
googletest/test/gtest_unittest.cc
+0
-8
No files found.
googlemock/test/gmock-internal-utils_test.cc
View file @
be6ee26a
...
@@ -44,15 +44,7 @@
...
@@ -44,15 +44,7 @@
#include "gmock/internal/gmock-port.h"
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "gtest/gtest-spi.h"
#include "gtest/gtest-spi.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// their code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
#if GTEST_OS_CYGWIN
#if GTEST_OS_CYGWIN
# include <sys/types.h> // For ssize_t. NOLINT
# include <sys/types.h> // For ssize_t. NOLINT
...
...
googletest/src/gtest-death-test.cc
View file @
be6ee26a
...
@@ -66,15 +66,7 @@
...
@@ -66,15 +66,7 @@
#include "gtest/gtest-message.h"
#include "gtest/gtest-message.h"
#include "gtest/internal/gtest-string.h"
#include "gtest/internal/gtest-string.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick exists to
// prevent the accidental inclusion of gtest-internal-inl.h in the
// user's code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
namespace
testing
{
namespace
testing
{
...
...
googletest/src/gtest-internal-inl.h
View file @
be6ee26a
...
@@ -37,14 +37,6 @@
...
@@ -37,14 +37,6 @@
#ifndef GTEST_SRC_GTEST_INTERNAL_INL_H_
#ifndef GTEST_SRC_GTEST_INTERNAL_INL_H_
#define GTEST_SRC_GTEST_INTERNAL_INL_H_
#define GTEST_SRC_GTEST_INTERNAL_INL_H_
// GTEST_IMPLEMENTATION_ is defined to 1 iff the current translation unit is
// part of Google Test's implementation; otherwise it's undefined.
#if !GTEST_IMPLEMENTATION_
// If this file is included from the user's code, just say no.
# error "gtest-internal-inl.h is part of Google Test's internal implementation."
# error "It must not be included except by Google Test itself."
#endif // GTEST_IMPLEMENTATION_
#ifndef _WIN32_WCE
#ifndef _WIN32_WCE
# include <errno.h>
# include <errno.h>
#endif // !_WIN32_WCE
#endif // !_WIN32_WCE
...
...
googletest/src/gtest-port.cc
View file @
be6ee26a
...
@@ -67,15 +67,7 @@
...
@@ -67,15 +67,7 @@
#include "gtest/gtest-message.h"
#include "gtest/gtest-message.h"
#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-string.h"
#include "gtest/internal/gtest-string.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick exists to
// prevent the accidental inclusion of gtest-internal-inl.h in the
// user's code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
...
googletest/src/gtest-test-part.cc
View file @
be6ee26a
...
@@ -32,15 +32,7 @@
...
@@ -32,15 +32,7 @@
// The Google C++ Testing Framework (Google Test)
// The Google C++ Testing Framework (Google Test)
#include "gtest/gtest-test-part.h"
#include "gtest/gtest-test-part.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick exists to
// prevent the accidental inclusion of gtest-internal-inl.h in the
// user's code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
namespace
testing
{
namespace
testing
{
...
...
googletest/src/gtest.cc
View file @
be6ee26a
...
@@ -133,14 +133,7 @@
...
@@ -133,14 +133,7 @@
# include <sys/types.h> // NOLINT
# include <sys/types.h> // NOLINT
#endif
#endif
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// their code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
#if GTEST_OS_WINDOWS
#if GTEST_OS_WINDOWS
# define vsnprintf _vsnprintf
# define vsnprintf _vsnprintf
...
@@ -2569,7 +2562,7 @@ void ReportInvalidTestCaseType(const char* test_case_name,
...
@@ -2569,7 +2562,7 @@ void ReportInvalidTestCaseType(const char* test_case_name,
<<
"probably rename one of the classes to put the tests into different
\n
"
<<
"probably rename one of the classes to put the tests into different
\n
"
<<
"test cases."
;
<<
"test cases."
;
GTEST_LOG_
(
ERROR
)
GTEST_LOG_
(
ERROR
)
<<
FormatFileLocation
(
code_location
.
file
.
c_str
(),
<<
FormatFileLocation
(
code_location
.
file
.
c_str
(),
code_location
.
line
)
code_location
.
line
)
<<
" "
<<
errors
.
GetString
();
<<
" "
<<
errors
.
GetString
();
...
@@ -2918,7 +2911,7 @@ WORD GetNewColor(GTestColor color, WORD old_color_attrs) {
...
@@ -2918,7 +2911,7 @@ WORD GetNewColor(GTestColor color, WORD old_color_attrs) {
}
}
return
new_color
;
return
new_color
;
}
}
#else
#else
// Returns the ANSI color code for the given color. COLOR_DEFAULT is
// Returns the ANSI color code for the given color. COLOR_DEFAULT is
...
@@ -3005,7 +2998,7 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
...
@@ -3005,7 +2998,7 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
GetConsoleScreenBufferInfo
(
stdout_handle
,
&
buffer_info
);
GetConsoleScreenBufferInfo
(
stdout_handle
,
&
buffer_info
);
const
WORD
old_color_attrs
=
buffer_info
.
wAttributes
;
const
WORD
old_color_attrs
=
buffer_info
.
wAttributes
;
const
WORD
new_color
=
GetNewColor
(
color
,
old_color_attrs
);
const
WORD
new_color
=
GetNewColor
(
color
,
old_color_attrs
);
// We need to flush the stream buffers into the console before each
// We need to flush the stream buffers into the console before each
// SetConsoleTextAttribute call lest it affect the text that is already
// SetConsoleTextAttribute call lest it affect the text that is already
// printed but has not yet reached the console.
// printed but has not yet reached the console.
...
@@ -3471,7 +3464,7 @@ void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
...
@@ -3471,7 +3464,7 @@ void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
// 3. To interpret the meaning of errno in a thread-safe way,
// 3. To interpret the meaning of errno in a thread-safe way,
// we need the strerror_r() function, which is not available on
// we need the strerror_r() function, which is not available on
// Windows.
// Windows.
GTEST_LOG_
(
FATAL
)
<<
"Unable to open file
\"
"
GTEST_LOG_
(
FATAL
)
<<
"Unable to open file
\"
"
<<
output_file_
<<
"
\"
"
;
<<
output_file_
<<
"
\"
"
;
}
}
std
::
stringstream
stream
;
std
::
stringstream
stream
;
...
@@ -4419,8 +4412,8 @@ void UnitTestImpl::ConfigureXmlOutput() {
...
@@ -4419,8 +4412,8 @@ void UnitTestImpl::ConfigureXmlOutput() {
listeners
()
->
SetDefaultXmlGenerator
(
new
XmlUnitTestResultPrinter
(
listeners
()
->
SetDefaultXmlGenerator
(
new
XmlUnitTestResultPrinter
(
UnitTestOptions
::
GetAbsolutePathToOutputFile
().
c_str
()));
UnitTestOptions
::
GetAbsolutePathToOutputFile
().
c_str
()));
}
else
if
(
output_format
!=
""
)
{
}
else
if
(
output_format
!=
""
)
{
GTEST_LOG_
(
WARNING
)
<<
"WARNING: unrecognized output format
\"
"
GTEST_LOG_
(
WARNING
)
<<
"WARNING: unrecognized output format
\"
"
<<
output_format
<<
output_format
<<
"
\"
ignored."
;
<<
"
\"
ignored."
;
}
}
}
}
...
@@ -4436,8 +4429,8 @@ void UnitTestImpl::ConfigureStreamingOutput() {
...
@@ -4436,8 +4429,8 @@ void UnitTestImpl::ConfigureStreamingOutput() {
listeners
()
->
Append
(
new
StreamingListener
(
target
.
substr
(
0
,
pos
),
listeners
()
->
Append
(
new
StreamingListener
(
target
.
substr
(
0
,
pos
),
target
.
substr
(
pos
+
1
)));
target
.
substr
(
pos
+
1
)));
}
else
{
}
else
{
GTEST_LOG_
(
WARNING
)
<<
"unrecognized streaming target
\"
"
GTEST_LOG_
(
WARNING
)
<<
"unrecognized streaming target
\"
"
<<
target
<<
target
<<
"
\"
ignored."
;
<<
"
\"
ignored."
;
}
}
}
}
...
@@ -4567,7 +4560,7 @@ static void TearDownEnvironment(Environment* env) { env->TearDown(); }
...
@@ -4567,7 +4560,7 @@ static void TearDownEnvironment(Environment* env) { env->TearDown(); }
bool
UnitTestImpl
::
RunAllTests
()
{
bool
UnitTestImpl
::
RunAllTests
()
{
// Makes sure InitGoogleTest() was called.
// Makes sure InitGoogleTest() was called.
if
(
!
GTestIsInitialized
())
{
if
(
!
GTestIsInitialized
())
{
GTEST_LOG_
(
ERROR
)
<<
GTEST_LOG_
(
ERROR
)
<<
"
\n
This test program did NOT call ::testing::InitGoogleTest "
"
\n
This test program did NOT call ::testing::InitGoogleTest "
"before calling RUN_ALL_TESTS(). Please fix it."
;
"before calling RUN_ALL_TESTS(). Please fix it."
;
return
false
;
return
false
;
...
@@ -5269,8 +5262,8 @@ bool ParseGoogleTestFlag(const char* const arg) {
...
@@ -5269,8 +5262,8 @@ bool ParseGoogleTestFlag(const char* const arg) {
void
LoadFlagsFromFile
(
const
std
::
string
&
path
)
{
void
LoadFlagsFromFile
(
const
std
::
string
&
path
)
{
FILE
*
flagfile
=
posix
::
FOpen
(
path
.
c_str
(),
"r"
);
FILE
*
flagfile
=
posix
::
FOpen
(
path
.
c_str
(),
"r"
);
if
(
!
flagfile
)
{
if
(
!
flagfile
)
{
GTEST_LOG_
(
FATAL
)
<<
"Unable to open file
\"
"
GTEST_LOG_
(
FATAL
)
<<
"Unable to open file
\"
"
<<
GTEST_FLAG
(
flagfile
)
<<
GTEST_FLAG
(
flagfile
)
<<
"
\"
"
;
<<
"
\"
"
;
}
}
std
::
string
contents
(
ReadEntireFile
(
flagfile
));
std
::
string
contents
(
ReadEntireFile
(
flagfile
));
...
...
googletest/test/gtest-death-test_test.cc
View file @
be6ee26a
...
@@ -56,15 +56,7 @@ using testing::internal::AlwaysTrue;
...
@@ -56,15 +56,7 @@ using testing::internal::AlwaysTrue;
# endif // GTEST_OS_LINUX
# endif // GTEST_OS_LINUX
# include "gtest/gtest-spi.h"
# include "gtest/gtest-spi.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// their code.
# define GTEST_IMPLEMENTATION_ 1
# include "src/gtest-internal-inl.h"
# include "src/gtest-internal-inl.h"
# undef GTEST_IMPLEMENTATION_
namespace
posix
=
::
testing
::
internal
::
posix
;
namespace
posix
=
::
testing
::
internal
::
posix
;
...
...
googletest/test/gtest-filepath_test.cc
View file @
be6ee26a
...
@@ -40,15 +40,7 @@
...
@@ -40,15 +40,7 @@
#include "gtest/internal/gtest-filepath.h"
#include "gtest/internal/gtest-filepath.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// their code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
#if GTEST_OS_WINDOWS_MOBILE
#if GTEST_OS_WINDOWS_MOBILE
# include <windows.h> // NOLINT
# include <windows.h> // NOLINT
...
...
googletest/test/gtest-options_test.cc
View file @
be6ee26a
...
@@ -46,14 +46,7 @@
...
@@ -46,14 +46,7 @@
# include <direct.h>
# include <direct.h>
#endif // GTEST_OS_WINDOWS_MOBILE
#endif // GTEST_OS_WINDOWS_MOBILE
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// their code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
...
googletest/test/gtest-param-test_test.cc
View file @
be6ee26a
...
@@ -41,11 +41,7 @@
...
@@ -41,11 +41,7 @@
# include <sstream>
# include <sstream>
# include <string>
# include <string>
# include <vector>
# include <vector>
// To include gtest-internal-inl.h.
# define GTEST_IMPLEMENTATION_ 1
# include "src/gtest-internal-inl.h" // for UnitTestOptions
# include "src/gtest-internal-inl.h" // for UnitTestOptions
# undef GTEST_IMPLEMENTATION_
# include "test/gtest-param-test_test.h"
# include "test/gtest-param-test_test.h"
...
...
googletest/test/gtest-port_test.cc
View file @
be6ee26a
...
@@ -45,15 +45,7 @@
...
@@ -45,15 +45,7 @@
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "gtest/gtest-spi.h"
#include "gtest/gtest-spi.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// their code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
using
std
::
make_pair
;
using
std
::
make_pair
;
using
std
::
pair
;
using
std
::
pair
;
...
...
googletest/test/gtest_color_test_.cc
View file @
be6ee26a
...
@@ -36,15 +36,7 @@
...
@@ -36,15 +36,7 @@
#include <stdio.h>
#include <stdio.h>
#include "gtest/gtest.h"
#include "gtest/gtest.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// their code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
using
testing
::
internal
::
ShouldUseColor
;
using
testing
::
internal
::
ShouldUseColor
;
...
...
googletest/test/gtest_env_var_test_.cc
View file @
be6ee26a
...
@@ -35,10 +35,7 @@
...
@@ -35,10 +35,7 @@
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include <iostream>
#include <iostream>
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
using
::
std
::
cout
;
using
::
std
::
cout
;
...
...
googletest/test/gtest_environment_test.cc
View file @
be6ee26a
...
@@ -34,10 +34,7 @@
...
@@ -34,10 +34,7 @@
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#define GTEST_IMPLEMENTATION_ 1 // Required for the next #include.
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
namespace
testing
{
namespace
testing
{
GTEST_DECLARE_string_
(
filter
);
GTEST_DECLARE_string_
(
filter
);
...
...
googletest/test/gtest_output_test_.cc
View file @
be6ee26a
...
@@ -37,15 +37,7 @@
...
@@ -37,15 +37,7 @@
#include "gtest/gtest-spi.h"
#include "gtest/gtest-spi.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// their code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
#include <stdlib.h>
#include <stdlib.h>
...
...
googletest/test/gtest_repeat_test.cc
View file @
be6ee26a
...
@@ -34,15 +34,7 @@
...
@@ -34,15 +34,7 @@
#include <stdlib.h>
#include <stdlib.h>
#include <iostream>
#include <iostream>
#include "gtest/gtest.h"
#include "gtest/gtest.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// their code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
namespace
testing
{
namespace
testing
{
...
...
googletest/test/gtest_stress_test.cc
View file @
be6ee26a
...
@@ -37,12 +37,7 @@
...
@@ -37,12 +37,7 @@
#include <iostream>
#include <iostream>
#include <vector>
#include <vector>
// We must define this macro in order to #include
// gtest-internal-inl.h. This is how Google Test prevents a user from
// accidentally depending on its internal implementation.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
#if GTEST_IS_THREADSAFE
#if GTEST_IS_THREADSAFE
...
...
googletest/test/gtest_unittest.cc
View file @
be6ee26a
...
@@ -66,15 +66,7 @@ TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
...
@@ -66,15 +66,7 @@ TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
#include <ostream>
#include <ostream>
#include "gtest/gtest-spi.h"
#include "gtest/gtest-spi.h"
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// their code.
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
...
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