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
c211f219
Unverified
Commit
c211f219
authored
Feb 09, 2018
by
Gennadiy Civil
Committed by
GitHub
Feb 09, 2018
Browse files
Merge pull request #1448 from gennadiycivil/master
merges
parents
a3c73ed2
ec7faa94
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
23 deletions
+33
-23
googlemock/test/gmock_output_test.py
googlemock/test/gmock_output_test.py
+8
-5
googlemock/test/gmock_test_utils.py
googlemock/test/gmock_test_utils.py
+3
-3
googletest/include/gtest/internal/gtest-port.h
googletest/include/gtest/internal/gtest-port.h
+14
-13
googletest/src/gtest-death-test.cc
googletest/src/gtest-death-test.cc
+7
-1
googletest/test/gtest_env_var_test.py
googletest/test/gtest_env_var_test.py
+1
-1
No files found.
googlemock/test/gmock_output_test.py
View file @
c211f219
...
...
@@ -31,11 +31,11 @@
"""Tests the text output of Google C++ Mocking Framework.
SYNOPSIS
gmock_output_test.py --build_dir=BUILD/DIR --gengolden
# where BUILD/DIR contains the built gmock_output_test_ file.
gmock_output_test.py --gengolden
gmock_output_test.py
To update the golden file:
gmock_output_test.py --build_dir=BUILD/DIR --gengolden
# where BUILD/DIR contains the built gmock_output_test_ file.
gmock_output_test.py --gengolden
gmock_output_test.py
"""
__author__
=
'wan@google.com (Zhanyong Wan)'
...
...
@@ -176,5 +176,8 @@ if __name__ == '__main__':
golden_file
=
open
(
GOLDEN_PATH
,
'wb'
)
golden_file
.
write
(
output
)
golden_file
.
close
()
# Suppress the error "googletest was imported but a call to its main()
# was never detected."
os
.
_exit
(
0
)
else
:
gmock_test_utils
.
Main
()
googlemock/test/gmock_test_utils.py
View file @
c211f219
...
...
@@ -34,7 +34,6 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
import
os
import
sys
# Determines path to gtest_test_utils and imports it.
SCRIPT_DIR
=
os
.
path
.
dirname
(
__file__
)
or
'.'
...
...
@@ -44,9 +43,10 @@ if os.path.isdir(gtest_tests_util_dir):
GTEST_TESTS_UTIL_DIR
=
gtest_tests_util_dir
else
:
GTEST_TESTS_UTIL_DIR
=
os
.
path
.
join
(
SCRIPT_DIR
,
'../../googletest/test'
)
sys
.
path
.
append
(
GTEST_TESTS_UTIL_DIR
)
import
gtest_test_utils
# pylint: disable-msg=C6204
# pylint: disable=C6204
import
gtest_test_utils
def
GetSourceDir
():
...
...
googletest/include/gtest/internal/gtest-port.h
View file @
c211f219
...
...
@@ -73,11 +73,9 @@
// GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
// are enabled.
// GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
// is/isn't available (some systems define
// ::string, which is different to std::string).
// GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
// is/isn't available (some systems define
// ::wstring, which is different to std::wstring).
// is/isn't available
// GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::wstring
// is/isn't available
// GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
// expressions are/aren't available.
// GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
...
...
@@ -178,7 +176,7 @@
// GTEST_HAS_POSIX_RE (see above) which users can
// define themselves.
// GTEST_USES_SIMPLE_RE - our own simple regex is used;
// the above
two
are mutually exclusive.
// the above
_RE(s)
are mutually exclusive.
// GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
// Misc public macros
...
...
@@ -272,10 +270,12 @@
# include <TargetConditionals.h>
#endif
// Brings in the definition of HAS_GLOBAL_STRING. This must be done
// BEFORE we test HAS_GLOBAL_STRING.
#include <string> // NOLINT
#include <algorithm> // NOLINT
#include <iostream> // NOLINT
#include <sstream> // NOLINT
#include <string> // NOLINT
#include <utility>
#include <vector> // NOLINT
...
...
@@ -806,9 +806,9 @@ using ::std::tuple_size;
// Google Test does not support death tests for VC 7.1 and earlier as
// abort() in a VC 7.1 application compiled as GUI in debug config
// pops up a dialog window that cannot be suppressed programmatically.
#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
(GTEST_OS_MAC && !GTEST_OS_IOS) || \
(GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS ||
\
(GTEST_OS_MAC && !GTEST_OS_IOS) ||
\
(GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) ||
\
GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD || GTEST_OS_NETBSD)
# define GTEST_HAS_DEATH_TEST 1
...
...
@@ -824,9 +824,10 @@ using ::std::tuple_size;
# define GTEST_HAS_TYPED_TEST_P 1
#endif
// Determines whether to support Combine().
// The implementation doesn't work on Sun Studio since it doesn't
// understand templated conversion operators.
// Determines whether to support Combine(). This only makes sense when
// value-parameterized tests are enabled. The implementation doesn't
// work on Sun Studio since it doesn't understand templated conversion
// operators.
#if (GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_) && !defined(__SUNPRO_CC)
# define GTEST_HAS_COMBINE 1
#endif
...
...
googletest/src/gtest-death-test.cc
View file @
c211f219
...
...
@@ -73,7 +73,7 @@ namespace testing {
// Constants.
// The default death test style.
static
const
char
kDefaultDeathTestStyle
[]
=
"
fast
"
;
static
const
char
kDefaultDeathTestStyle
[]
=
"
threadsafe
"
;
GTEST_DEFINE_string_
(
death_test_style
,
...
...
@@ -555,7 +555,13 @@ bool DeathTestImpl::Passed(bool status_ok) {
break
;
case
DIED
:
if
(
status_ok
)
{
# if GTEST_USES_PCRE
// PCRE regexes support embedded NULs.
// GTEST_USES_PCRE is defined only in google3 mode
const
bool
matched
=
RE
::
PartialMatch
(
error_message
,
*
regex
());
# else
const
bool
matched
=
RE
::
PartialMatch
(
error_message
.
c_str
(),
*
regex
());
# endif // GTEST_USES_PCRE
if
(
matched
)
{
success
=
true
;
}
else
{
...
...
googletest/test/gtest_env_var_test.py
View file @
c211f219
...
...
@@ -92,7 +92,7 @@ class GTestEnvVarTest(gtest_test_utils.TestCase):
TestFlag
(
'print_time'
,
'0'
,
'1'
)
TestFlag
(
'repeat'
,
'999'
,
'1'
)
TestFlag
(
'throw_on_failure'
,
'1'
,
'0'
)
TestFlag
(
'death_test_style'
,
'threadsafe'
,
'fast'
)
TestFlag
(
'death_test_style'
,
'fast'
,
'threadsafe'
)
TestFlag
(
'catch_exceptions'
,
'0'
,
'1'
)
if
IS_LINUX
:
...
...
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