Unverified Commit 47b57ff1 by Gennadiy Civil Committed by GitHub

Merge branch 'master' into cross-testing-patch-1

parents 11f5a274 7800ba3e
...@@ -4,6 +4,12 @@ ...@@ -4,6 +4,12 @@
[![Build Status](https://travis-ci.org/google/googletest.svg?branch=master)](https://travis-ci.org/google/googletest) [![Build Status](https://travis-ci.org/google/googletest.svg?branch=master)](https://travis-ci.org/google/googletest)
[![Build status](https://ci.appveyor.com/api/projects/status/4o38plt0xbo1ubc8/branch/master?svg=true)](https://ci.appveyor.com/project/GoogleTestAppVeyor/googletest/branch/master) [![Build status](https://ci.appveyor.com/api/projects/status/4o38plt0xbo1ubc8/branch/master?svg=true)](https://ci.appveyor.com/project/GoogleTestAppVeyor/googletest/branch/master)
**Future Plans**:
* 1.8.x Release - the 1.8.x will be the last release that works with pre-C++11 compilers. The 1.8.1 will not accept any requests for any new features and any bugfix requests will only be accepted if proven "critical"
* Post 1.8.x - work to improve/cleanup/pay technical debt. When this work is completed there will be a 1.9.x tagged release
* Post 1.9.x googletest will follow [Abseil Live at Head philosophy](https://abseil.io/about/philosophy)
Welcome to **Google Test**, Google's C++ test framework! Welcome to **Google Test**, Google's C++ test framework!
This repository is a merger of the formerly separate GoogleTest and This repository is a merger of the formerly separate GoogleTest and
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
// An installation-specific extension point for gmock-matchers.h. // An installation-specific extension point for gmock-matchers.h.
// ============================================================ // ============================================================
// //
// Adds google3 callback support to CallableTraits.
// GOOGLETEST_CM0002 DO NOT DELETE // GOOGLETEST_CM0002 DO NOT DELETE
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_ #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
......
...@@ -29,13 +29,14 @@ ...@@ -29,13 +29,14 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Tests the text output of Google C++ Mocking Framework. r"""Tests the text output of Google C++ Mocking Framework.
To update the golden file: To update the golden file:
gmock_output_test.py --build_dir=BUILD/DIR --gengolden gmock_output_test.py --build_dir=BUILD/DIR --gengolden
# where BUILD/DIR contains the built gmock_output_test_ file. where BUILD/DIR contains the built gmock_output_test_ file.
gmock_output_test.py --gengolden gmock_output_test.py --gengolden
gmock_output_test.py gmock_output_test.py
""" """
__author__ = 'wan@google.com (Zhanyong Wan)' __author__ = 'wan@google.com (Zhanyong Wan)'
......
...@@ -707,8 +707,9 @@ In general, the recommended way to cause the code to behave differently under ...@@ -707,8 +707,9 @@ In general, the recommended way to cause the code to behave differently under
test is [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection). You can inject test is [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection). You can inject
different functionality from the test and from the production code. Since your different functionality from the test and from the production code. Since your
production code doesn't link in the for-test logic at all (the production code doesn't link in the for-test logic at all (the
[`testonly`](http://go/testonly) attribute for BUILD targets helps to ensure [`testonly`](https://docs.bazel.build/versions/master/be/common-definitions.html#common.testonly)
that), there is no danger in accidentally running it. attribute for BUILD targets helps to ensure that), there is no danger in
accidentally running it.
However, if you *really*, *really*, *really* have no choice, and if you follow However, if you *really*, *really*, *really* have no choice, and if you follow
the rule of ending your test program names with `_test`, you can use the the rule of ending your test program names with `_test`, you can use the
......
...@@ -180,6 +180,7 @@ ...@@ -180,6 +180,7 @@
// GTEST_HAS_TYPED_TEST - typed tests // GTEST_HAS_TYPED_TEST - typed tests
// GTEST_HAS_TYPED_TEST_P - type-parameterized tests // GTEST_HAS_TYPED_TEST_P - type-parameterized tests
// GTEST_IS_THREADSAFE - Google Test is thread-safe. // GTEST_IS_THREADSAFE - Google Test is thread-safe.
// GOOGLETEST_CM0007 DO NOT DELETE
// GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with // GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
// GTEST_HAS_POSIX_RE (see above) which users can // GTEST_HAS_POSIX_RE (see above) which users can
// define themselves. // define themselves.
...@@ -231,6 +232,7 @@ ...@@ -231,6 +232,7 @@
// Regular expressions: // Regular expressions:
// RE - a simple regular expression class using the POSIX // RE - a simple regular expression class using the POSIX
// Extended Regular Expression syntax on UNIX-like platforms // Extended Regular Expression syntax on UNIX-like platforms
// GOOGLETEST_CM0008 DO NOT DELETE
// or a reduced regular exception syntax on other // or a reduced regular exception syntax on other
// platforms, including Windows. // platforms, including Windows.
// Logging: // Logging:
......
...@@ -233,11 +233,14 @@ static std::string DeathTestThreadWarning(size_t thread_count) { ...@@ -233,11 +233,14 @@ static std::string DeathTestThreadWarning(size_t thread_count) {
Message msg; Message msg;
msg << "Death tests use fork(), which is unsafe particularly" msg << "Death tests use fork(), which is unsafe particularly"
<< " in a threaded context. For this test, " << GTEST_NAME_ << " "; << " in a threaded context. For this test, " << GTEST_NAME_ << " ";
if (thread_count == 0) if (thread_count == 0) {
msg << "couldn't detect the number of threads."; msg << "couldn't detect the number of threads.";
else } else {
msg << "detected " << thread_count << " threads."; msg << "detected " << thread_count << " threads.";
msg << " See https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#death-tests-and-threads" }
msg << " See "
"https://github.com/google/googletest/blob/master/googletest/docs/"
"advanced.md#death-tests-and-threads"
<< " for more explanation and suggested solutions, especially if" << " for more explanation and suggested solutions, especially if"
<< " this is the last message you see before your test times out."; << " this is the last message you see before your test times out.";
return msg.GetString(); return msg.GetString();
......
...@@ -3590,6 +3590,7 @@ std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters( ...@@ -3590,6 +3590,7 @@ std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(
// The following routines generate an XML representation of a UnitTest // The following routines generate an XML representation of a UnitTest
// object. // object.
// GOOGLETEST_CM0009 DO NOT DELETE
// //
// This is how Google Test concepts map to the DTD: // This is how Google Test concepts map to the DTD:
// //
......
...@@ -33,11 +33,11 @@ ...@@ -33,11 +33,11 @@
// exceptions, and the output is verified by // exceptions, and the output is verified by
// googletest-catch-exceptions-test.py. // googletest-catch-exceptions-test.py.
#include "gtest/gtest.h"
#include <stdio.h> // NOLINT #include <stdio.h> // NOLINT
#include <stdlib.h> // For exit(). #include <stdlib.h> // For exit().
#include "gtest/gtest.h"
#if GTEST_HAS_SEH #if GTEST_HAS_SEH
# include <windows.h> # include <windows.h>
#endif #endif
......
...@@ -32,10 +32,9 @@ ...@@ -32,10 +32,9 @@
// A helper program for testing that Google Test parses the environment // A helper program for testing that Google Test parses the environment
// variables correctly. // variables correctly.
#include "gtest/gtest.h"
#include <iostream> #include <iostream>
#include "gtest/gtest.h"
#include "src/gtest-internal-inl.h" #include "src/gtest-internal-inl.h"
using ::std::cout; using ::std::cout;
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
// Authors: Dan Egnor (egnor@google.com) // Authors: Dan Egnor (egnor@google.com)
// Ported to Windows: Vadim Berman (vadimb@google.com) // Ported to Windows: Vadim Berman (vadimb@google.com)
#include "gtest/internal/gtest-linked_ptr.h"
#include <stdlib.h> #include <stdlib.h>
#include "gtest/internal/gtest-linked_ptr.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
namespace { namespace {
......
...@@ -33,9 +33,10 @@ ...@@ -33,9 +33,10 @@
// This file verifies Google Test event listeners receive events at the // This file verifies Google Test event listeners receive events at the
// right times. // right times.
#include "gtest/gtest.h"
#include <vector> #include <vector>
#include "gtest/gtest.h"
using ::testing::AddGlobalTestEnvironment; using ::testing::AddGlobalTestEnvironment;
using ::testing::Environment; using ::testing::Environment;
using ::testing::InitGoogleTest; using ::testing::InitGoogleTest;
......
...@@ -31,12 +31,11 @@ ...@@ -31,12 +31,11 @@
"""Tests the text output of Google C++ Testing and Mocking Framework. """Tests the text output of Google C++ Testing and Mocking Framework.
To update the golden file:
SYNOPSIS googletest_output_test.py --build_dir=BUILD/DIR --gengolden
googletest_output_test.py --build_dir=BUILD/DIR --gengolden where BUILD/DIR contains the built googletest-output-test_ file.
# where BUILD/DIR contains the built googletest-output-test_ file. googletest_output_test.py --gengolden
googletest_output_test.py --gengolden googletest_output_test.py
googletest_output_test.py
""" """
__author__ = 'wan@google.com (Zhanyong Wan)' __author__ = 'wan@google.com (Zhanyong Wan)'
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
// Google Test work. // Google Test work.
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "googletest-param-test-test.h" #include "test/googletest-param-test-test.h"
using ::testing::Values; using ::testing::Values;
using ::testing::internal::ParamGenerator; using ::testing::internal::ParamGenerator;
......
...@@ -30,11 +30,10 @@ ...@@ -30,11 +30,10 @@
// Authors: vladl@google.com (Vlad Losev), wan@google.com (Zhanyong Wan) // Authors: vladl@google.com (Vlad Losev), wan@google.com (Zhanyong Wan)
// //
// This file tests the internal cross-platform support utilities. // This file tests the internal cross-platform support utilities.
#include <stdio.h>
#include "gtest/internal/gtest-port.h" #include "gtest/internal/gtest-port.h"
#include <stdio.h>
#if GTEST_OS_MAC #if GTEST_OS_MAC
# include <time.h> # include <time.h>
#endif // GTEST_OS_MAC #endif // GTEST_OS_MAC
......
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
// //
// This file tests the universal value printer. // This file tests the universal value printer.
#include "gtest/gtest-printers.h"
#include <ctype.h> #include <ctype.h>
#include <limits.h> #include <limits.h>
#include <string.h> #include <string.h>
...@@ -48,6 +46,7 @@ ...@@ -48,6 +46,7 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "gtest/gtest-printers.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#if GTEST_HAS_UNORDERED_MAP_ #if GTEST_HAS_UNORDERED_MAP_
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <vector> #include <vector>
#include "gtest-typed-test_test.h" #include "test/gtest-typed-test_test.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#if GTEST_HAS_TYPED_TEST_P #if GTEST_HAS_TYPED_TEST_P
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
// //
// Author: wan@google.com (Zhanyong Wan) // Author: wan@google.com (Zhanyong Wan)
#include "gtest-typed-test_test.h" #include "test/gtest-typed-test_test.h"
#include <set> #include <set>
#include <vector> #include <vector>
......
...@@ -33,15 +33,15 @@ ...@@ -33,15 +33,15 @@
// //
// Sometimes it's desirable to build most of Google Test's own tests // Sometimes it's desirable to build most of Google Test's own tests
// by compiling a single file. This file serves this purpose. // by compiling a single file. This file serves this purpose.
#include "googletest-filepath-test.cc" #include "test/googletest-filepath-test.cc"
#include "googletest-linked-ptr-test.cc" #include "test/googletest-linked-ptr-test.cc"
#include "googletest-message-test.cc" #include "test/googletest-message-test.cc"
#include "googletest-options-test.cc" #include "test/googletest-options-test.cc"
#include "googletest-port-test.cc" #include "test/googletest-port-test.cc"
#include "gtest_pred_impl_unittest.cc" #include "test/gtest_pred_impl_unittest.cc"
#include "gtest_prod_test.cc" #include "test/gtest_prod_test.cc"
#include "googletest-test-part-test.cc" #include "test/googletest-test-part-test.cc"
#include "gtest-typed-test_test.cc" #include "test/gtest-typed-test_test.cc"
#include "gtest-typed-test2_test.cc" #include "test/gtest-typed-test2_test.cc"
#include "gtest_unittest.cc" #include "test/gtest_unittest.cc"
#include "production.cc" #include "test/production.cc"
...@@ -36,15 +36,13 @@ __author__ = 'wan@google.com (Zhanyong Wan)' ...@@ -36,15 +36,13 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
import os import os
import sys import sys
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_WINDOWS = os.name == 'nt' IS_WINDOWS = os.name == 'nt'
IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0] IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
import atexit import atexit
import shutil import shutil
import tempfile import tempfile
import unittest import unittest as _test_module
_test_module = unittest
try: try:
import subprocess import subprocess
...@@ -74,7 +72,7 @@ def SetEnvVar(env_var, value): ...@@ -74,7 +72,7 @@ def SetEnvVar(env_var, value):
# Here we expose a class from a particular module, depending on the # Here we expose a class from a particular module, depending on the
# environment. The comment suppresses the 'Invalid variable name' lint # environment. The comment suppresses the 'Invalid variable name' lint
# complaint. # complaint.
TestCase = _test_module.TestCase # pylint: disable-msg=C6409 TestCase = _test_module.TestCase # pylint: disable=C6409
# Initially maps a flag to its default value. After # Initially maps a flag to its default value. After
# _ParseAndStripGTestFlags() is called, maps a flag to its actual value. # _ParseAndStripGTestFlags() is called, maps a flag to its actual value.
...@@ -88,7 +86,7 @@ def _ParseAndStripGTestFlags(argv): ...@@ -88,7 +86,7 @@ def _ParseAndStripGTestFlags(argv):
# Suppresses the lint complaint about a global variable since we need it # Suppresses the lint complaint about a global variable since we need it
# here to maintain module-wide state. # here to maintain module-wide state.
global _gtest_flags_are_parsed # pylint: disable-msg=W0603 global _gtest_flags_are_parsed # pylint: disable=W0603
if _gtest_flags_are_parsed: if _gtest_flags_are_parsed:
return return
......
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment