Unverified Commit 06b97592 authored by Gennadiy Civil's avatar Gennadiy Civil Committed by GitHub
Browse files

Merge branch 'master' into ignore-cmake-generated-files

parents 51b65058 997d343d
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (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.
//
// Author: wan@google.com (Zhanyong Wan)
// //
// Tests for Google C++ Mocking Framework (Google Mock) // Tests for Google C++ Mocking Framework (Google Mock)
// //
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (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.
//
// Author: wan@google.com (Zhanyong Wan)
// Tests Google Mock's functionality that depends on exceptions. // Tests Google Mock's functionality that depends on exceptions.
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
"""Tests that leaked mock objects can be caught be Google Mock.""" """Tests that leaked mock objects can be caught be Google Mock."""
__author__ = 'wan@google.com (Zhanyong Wan)'
import gmock_test_utils import gmock_test_utils
PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_') PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_')
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (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.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes. // Google Mock - a framework for writing C++ mock classes.
// //
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (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.
//
// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
// Google Mock - a framework for writing C++ mock classes. // Google Mock - a framework for writing C++ mock classes.
// //
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (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.
//
// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
// Google Mock - a framework for writing C++ mock classes. // Google Mock - a framework for writing C++ mock classes.
// //
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (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.
//
// Author: vladl@google.com (Vlad Losev)
// Google Mock - a framework for writing C++ mock classes. // Google Mock - a framework for writing C++ mock classes.
// //
......
...@@ -29,16 +29,15 @@ ...@@ -29,16 +29,15 @@
# (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)' """
import os import os
import re import re
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (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.
//
// Author: wan@google.com (Zhanyong Wan)
// Tests Google Mock's output in various scenarios. This ensures that // Tests Google Mock's output in various scenarios. This ensures that
// Google Mock's messages are readable and useful. // Google Mock's messages are readable and useful.
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (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.
//
// Author: wan@google.com (Zhanyong Wan)
// Tests that Google Mock constructs can be used in a large number of // Tests that Google Mock constructs can be used in a large number of
// threads concurrently. // threads concurrently.
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (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.
//
// Author: wan@google.com (Zhanyong Wan)
// Google Mock - a framework for writing C++ mock classes. // Google Mock - a framework for writing C++ mock classes.
// //
......
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
"""Unit test utilities for Google C++ Mocking Framework.""" """Unit test utilities for Google C++ Mocking Framework."""
__author__ = 'wan@google.com (Zhanyong Wan)'
import os import os
import sys import sys
......
...@@ -121,13 +121,13 @@ if(INSTALL_GTEST) ...@@ -121,13 +121,13 @@ if(INSTALL_GTEST)
# configure and install pkgconfig files # configure and install pkgconfig files
configure_file( configure_file(
cmake/gtest.pc.in cmake/gtest.pc.in
"${CMAKE_BINARY_DIR}/gtest.pc" "${gtest_BINARY_DIR}/gtest.pc"
@ONLY) @ONLY)
configure_file( configure_file(
cmake/gtest_main.pc.in cmake/gtest_main.pc.in
"${CMAKE_BINARY_DIR}/gtest_main.pc" "${gtest_BINARY_DIR}/gtest_main.pc"
@ONLY) @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/gtest.pc" "${CMAKE_BINARY_DIR}/gtest_main.pc" install(FILES "${gtest_BINARY_DIR}/gtest.pc" "${gtest_BINARY_DIR}/gtest_main.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif() endif()
......
...@@ -230,7 +230,7 @@ find_package(PythonInterp) ...@@ -230,7 +230,7 @@ find_package(PythonInterp)
# from the given source files with the given compiler flags. # from the given source files with the given compiler flags.
function(cxx_test_with_flags name cxx_flags libs) function(cxx_test_with_flags name cxx_flags libs)
cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN}) cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN})
add_test(${name} ${name}) add_test(NAME ${name} COMMAND ${name})
endfunction() endfunction()
# cxx_test(name libs srcs...) # cxx_test(name libs srcs...)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
## Introduction ## Introduction
Now that you have read the [googletest Primer](primer) and learned how to write Now that you have read the [googletest Primer](primer.md) and learned how to write
tests using googletest, it's time to learn some new tricks. This document will tests using googletest, it's time to learn some new tricks. This document will
show you more assertions as well as how to construct complex failure messages, show you more assertions as well as how to construct complex failure messages,
propagate fatal failures, reuse and speed up your test fixtures, and use various propagate fatal failures, reuse and speed up your test fixtures, and use various
...@@ -104,11 +104,9 @@ can be implicitly converted to `bool`), you can use it in a *predicate ...@@ -104,11 +104,9 @@ can be implicitly converted to `bool`), you can use it in a *predicate
assertion* to get the function arguments printed for free: assertion* to get the function arguments printed for free:
| Fatal assertion | Nonfatal assertion | Verifies | | Fatal assertion | Nonfatal assertion | Verifies |
| -------------------- | -------------------- | --------------------------- | | ---------------------------------- | ---------------------------------- | --------------------------- |
| `ASSERT_PRED1(pred1, | `EXPECT_PRED1(pred1, | `pred1(val1)` is true | | `ASSERT_PRED1(pred1, val1);` | `EXPECT_PRED1(pred1, val1);` | `pred1(val1)` is true |
: val1);` : val1);` : : | `ASSERT_PRED2(pred2, val1, val2);` | `EXPECT_PRED2(pred2, val1, val2);` | `pred2(val1, val2)` is true |
| `ASSERT_PRED2(pred2, | `EXPECT_PRED2(pred2, | `pred2(val1, val2)` is true |
: val1, val2);` : val1, val2);` : :
| `...` | `...` | ... | | `...` | `...` | ... |
In the above, `predn` is an `n`-ary predicate function or functor, where `val1`, In the above, `predn` is an `n`-ary predicate function or functor, where `val1`,
...@@ -120,7 +118,7 @@ either case, the arguments are evaluated exactly once. ...@@ -120,7 +118,7 @@ either case, the arguments are evaluated exactly once.
Here's an example. Given Here's an example. Given
```c++ ```c++
// Returns true iff m and n have no common divisors except 1. // Returns true if m and n have no common divisors except 1.
bool MutuallyPrime(int m, int n) { ... } bool MutuallyPrime(int m, int n) { ... }
const int a = 3; const int a = 3;
...@@ -152,7 +150,7 @@ c is 10 ...@@ -152,7 +150,7 @@ c is 10
> >
> 1. If you see a compiler error "no matching function to call" when using > 1. If you see a compiler error "no matching function to call" when using
> `ASSERT_PRED*` or `EXPECT_PRED*`, please see > `ASSERT_PRED*` or `EXPECT_PRED*`, please see
> [this](faq#OverloadedPredicate) for how to resolve it. > [this](faq.md#OverloadedPredicate) for how to resolve it.
> 1. Currently we only provide predicate assertions of arity <= 5. If you need > 1. Currently we only provide predicate assertions of arity <= 5. If you need
> a higher-arity assertion, let [us](https://github.com/google/googletest/issues) know. > a higher-arity assertion, let [us](https://github.com/google/googletest/issues) know.
...@@ -340,11 +338,9 @@ want to learn more, see ...@@ -340,11 +338,9 @@ want to learn more, see
#### Floating-Point Macros #### Floating-Point Macros
| Fatal assertion | Nonfatal assertion | Verifies | | Fatal assertion | Nonfatal assertion | Verifies |
| ----------------------- | ----------------------- | ----------------------- | | ------------------------------- | ------------------------------ | ---------------------------------------- |
| `ASSERT_FLOAT_EQ(val1, | `EXPECT_FLOAT_EQ(val1, | the two `float` values | | `ASSERT_FLOAT_EQ(val1, val2);` | `EXPECT_FLOAT_EQ(val1,val2);` | the two `float` values are almost equal |
: val2);` : val2);` : are almost equal : | `ASSERT_DOUBLE_EQ(val1, val2);` | `EXPECT_DOUBLE_EQ(val1, val2);`| the two `double` values are almost equal |
| `ASSERT_DOUBLE_EQ(val1, | `EXPECT_DOUBLE_EQ(val1, | the two `double` values |
: val2);` : val2);` : are almost equal :
By "almost equal" we mean the values are within 4 ULP's from each other. By "almost equal" we mean the values are within 4 ULP's from each other.
...@@ -355,11 +351,8 @@ unsafe and has been deprecated. Please don't use it any more. ...@@ -355,11 +351,8 @@ unsafe and has been deprecated. Please don't use it any more.
The following assertions allow you to choose the acceptable error bound: The following assertions allow you to choose the acceptable error bound:
| Fatal assertion | Nonfatal assertion | Verifies | | Fatal assertion | Nonfatal assertion | Verifies |
| ------------------ | ------------------------ | ------------------------- | | ------------------------------------- | ------------------------------------- | ------------------------- |
| `ASSERT_NEAR(val1, | `EXPECT_NEAR(val1, val2, | the difference between | | `ASSERT_NEAR(val1, val2, abs_error);` | `EXPECT_NEAR(val1, val2, abs_error);` | the difference between `val1` and `val2` doesn't exceed the given absolute error |
: val2, abs_error);` : abs_error);` : `val1` and `val2` doesn't :
: : : exceed the given absolute :
: : : error :
**Availability**: Linux, Windows, Mac. **Availability**: Linux, Windows, Mac.
...@@ -388,9 +381,8 @@ library of matchers for validating arguments passed to mock objects. A gMock ...@@ -388,9 +381,8 @@ library of matchers for validating arguments passed to mock objects. A gMock
used in these assertion macros: used in these assertion macros:
| Fatal assertion | Nonfatal assertion | Verifies | | Fatal assertion | Nonfatal assertion | Verifies |
| ------------------- | ------------------------------ | --------------------- | | ------------------------------ | ------------------------------ | --------------------- |
| `ASSERT_THAT(value, | `EXPECT_THAT(value, matcher);` | value matches matcher | | `ASSERT_THAT(value, matcher);` | `EXPECT_THAT(value, matcher);` | value matches matcher |
: matcher);` : : :
For example, `StartsWith(prefix)` is a matcher that matches a string starting For example, `StartsWith(prefix)` is a matcher that matches a string starting
with `prefix`, and you can write: with `prefix`, and you can write:
...@@ -1396,17 +1388,11 @@ namespace: ...@@ -1396,17 +1388,11 @@ namespace:
| Parameter Generator | Behavior | | Parameter Generator | Behavior |
| ---------------------------- | ------------------------------------------- | | ---------------------------- | ------------------------------------------- |
| `Range(begin, end [, step])` | Yields values `{begin, begin+step, | | `Range(begin, end [, step])` | Yields values `{begin, begin+step, begin+step+step, ...}`. The values do not include `end`. `step` defaults to 1. |
: : begin+step+step, ...}`. The values do not :
: : include `end`. `step` defaults to 1. :
| `Values(v1, v2, ..., vN)` | Yields values `{v1, v2, ..., vN}`. | | `Values(v1, v2, ..., vN)` | Yields values `{v1, v2, ..., vN}`. |
| `ValuesIn(container)` and | Yields values from a C-style array, an | | `ValuesIn(container)` and `ValuesIn(begin,end)` | Yields values from a C-style array, an STL-style container, or an iterator range `[begin, end)`. |
: `ValuesIn(begin,end)` : STL-style container, or an iterator range :
: : `[begin, end)`. :
| `Bool()` | Yields sequence `{false, true}`. | | `Bool()` | Yields sequence `{false, true}`. |
| `Combine(g1, g2, ..., gN)` | Yields all combinations (Cartesian product) | | `Combine(g1, g2, ..., gN)` | Yields all combinations (Cartesian product) as std\:\:tuples of the values generated by the `N` generators. |
: : as std\:\:tuples of the values generated by :
: : the `N` generators. :
For more details, see the comments at the definitions of these functions. For more details, see the comments at the definitions of these functions.
...@@ -1726,7 +1712,7 @@ To test them, we use the following special techniques: ...@@ -1726,7 +1712,7 @@ To test them, we use the following special techniques:
```c++ ```c++
// foo.h // foo.h
#include "gtest/gtest_prod.h" #include "gtest/gtest_prod.h"
class Foo { class Foo {
... ...
...@@ -1779,7 +1765,7 @@ To test them, we use the following special techniques: ...@@ -1779,7 +1765,7 @@ To test them, we use the following special techniques:
``` ```
## "Catching" Failures ## "Catching" Failures
If you are building a testing utility on top of googletest, you'll want to test If you are building a testing utility on top of googletest, you'll want to test
your utility. What framework would you use to test it? googletest, of course. your utility. What framework would you use to test it? googletest, of course.
...@@ -2168,23 +2154,22 @@ random seed and re-shuffle the tests in each iteration. ...@@ -2168,23 +2154,22 @@ random seed and re-shuffle the tests in each iteration.
googletest can use colors in its terminal output to make it easier to spot the googletest can use colors in its terminal output to make it easier to spot the
important information: important information:
... ...<br/>
<span style="color:green">[----------]<span style="color:black"> 1 test from FooTest <span style="color:green">[----------]<span style="color:black"> 1 test from FooTest<br/>
<span style="color:green">[ RUN ]<span style="color:black"> FooTest.DoesAbc <span style="color:green">[ RUN ]<span style="color:black"> FooTest.DoesAbc<br/>
<span style="color:green">[ OK ]<span style="color:black"> FooTest.DoesAbc <span style="color:green">[ OK ]<span style="color:black"> FooTest.DoesAbc<br/>
<span style="color:green">[----------]<span style="color:black"> 2 tests from BarTest <span style="color:green">[----------]<span style="color:black"> 2 tests from BarTest<br/>
<span style="color:green">[ RUN ]<span style="color:black"> BarTest.HasXyzProperty <span style="color:green">[ RUN ]<span style="color:black"> BarTest.HasXyzProperty<br/>
<span style="color:green">[ OK ]<span style="color:black"> BarTest.HasXyzProperty <span style="color:green">[ OK ]<span style="color:black"> BarTest.HasXyzProperty<br/>
<span style="color:green">[ RUN ]<span style="color:black"> BarTest.ReturnsTrueOnSuccess <span style="color:green">[ RUN ]<span style="color:black"> BarTest.ReturnsTrueOnSuccess<br/>
... some error messages ... ... some error messages ...<br/>
<span style="color:red">[ FAILED ] <span style="color:black">BarTest.ReturnsTrueOnSuccess <span style="color:red">[ FAILED ] <span style="color:black">BarTest.ReturnsTrueOnSuccess<br/>
... ...<br/>
<span style="color:green">[==========]<span style="color:black"> 30 tests from 14 test cases ran. <span style="color:green">[==========]<span style="color:black"> 30 tests from 14 test cases ran.<br/>
<span style="color:green">[ PASSED ]<span style="color:black"> 28 tests. <span style="color:green">[ PASSED ]<span style="color:black"> 28 tests.<br/>
<span style="color:red">[ FAILED ]<span style="color:black"> 2 tests, listed below: <span style="color:red">[ FAILED ]<span style="color:black"> 2 tests, listed below:<br/>
<span style="color:red">[ FAILED ]<span style="color:black"> BarTest.ReturnsTrueOnSuccess <span style="color:red">[ FAILED ]<span style="color:black"> BarTest.ReturnsTrueOnSuccess<br/>
<span style="color:red">[ FAILED ]<span style="color:black"> AnotherTest.DoesXyz <span style="color:red">[ FAILED ]<span style="color:black"> AnotherTest.DoesXyz<br/>
2 FAILED TESTS 2 FAILED TESTS
You can set the `GTEST_COLOR` environment variable or the `--gtest_color` You can set the `GTEST_COLOR` environment variable or the `--gtest_color`
...@@ -2193,8 +2178,7 @@ disable colors, or let googletest decide. When the value is `auto`, googletest ...@@ -2193,8 +2178,7 @@ disable colors, or let googletest decide. When the value is `auto`, googletest
will use colors if and only if the output goes to a terminal and (on non-Windows will use colors if and only if the output goes to a terminal and (on non-Windows
platforms) the `TERM` environment variable is set to `xterm` or `xterm-color`. platforms) the `TERM` environment variable is set to `xterm` or `xterm-color`.
> **Availability**: Linux, Windows, Mac.
> **Availability**: Linux, Windows, Mac.
#### Suppressing the Elapsed Time #### Suppressing the Elapsed Time
......
...@@ -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
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (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.
//
// Author: wan@google.com (Zhanyong Wan)
// //
// The Google C++ Testing and Mocking Framework (Google Test) // The Google C++ Testing and Mocking Framework (Google Test)
// //
...@@ -100,6 +99,7 @@ GTEST_API_ bool InDeathTestChild(); ...@@ -100,6 +99,7 @@ GTEST_API_ bool InDeathTestChild();
// //
// On the regular expressions used in death tests: // On the regular expressions used in death tests:
// //
// GOOGLETEST_CM0005 DO NOT DELETE
// On POSIX-compliant systems (*nix), we use the <regex.h> library, // On POSIX-compliant systems (*nix), we use the <regex.h> library,
// which uses the POSIX extended regex syntax. // which uses the POSIX extended regex syntax.
// //
...@@ -161,7 +161,7 @@ GTEST_API_ bool InDeathTestChild(); ...@@ -161,7 +161,7 @@ GTEST_API_ bool InDeathTestChild();
// is rarely a problem as people usually don't put the test binary // is rarely a problem as people usually don't put the test binary
// directory in PATH. // directory in PATH.
// //
// TODO(wan@google.com): make thread-safe death tests search the PATH. // FIXME: make thread-safe death tests search the PATH.
// Asserts that a given statement causes the program to exit, with an // Asserts that a given statement causes the program to exit, with an
// integer exit status that satisfies predicate, and emitting error output // integer exit status that satisfies predicate, and emitting error output
...@@ -202,6 +202,7 @@ class GTEST_API_ ExitedWithCode { ...@@ -202,6 +202,7 @@ class GTEST_API_ ExitedWithCode {
# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA # if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
// Tests that an exit code describes an exit due to termination by a // Tests that an exit code describes an exit due to termination by a
// given signal. // given signal.
// GOOGLETEST_CM0006 DO NOT DELETE
class GTEST_API_ KilledBySignal { class GTEST_API_ KilledBySignal {
public: public:
explicit KilledBySignal(int signum); explicit KilledBySignal(int signum);
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (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.
//
// Author: wan@google.com (Zhanyong Wan)
// //
// The Google C++ Testing and Mocking Framework (Google Test) // The Google C++ Testing and Mocking Framework (Google Test)
// //
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
// (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.
// //
// Authors: vladl@google.com (Vlad Losev)
//
// Macros and functions for implementing parameterized tests // Macros and functions for implementing parameterized tests
// in Google C++ Testing and Mocking Framework (Google Test) // in Google C++ Testing and Mocking Framework (Google Test)
// //
......
...@@ -30,8 +30,6 @@ $var maxtuple = 10 $$ Maximum number of Combine arguments we want to support. ...@@ -30,8 +30,6 @@ $var maxtuple = 10 $$ Maximum number of Combine arguments we want to support.
// (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.
// //
// Authors: vladl@google.com (Vlad Losev)
//
// Macros and functions for implementing parameterized tests // Macros and functions for implementing parameterized tests
// in Google C++ Testing and Mocking Framework (Google Test) // in Google C++ Testing and Mocking Framework (Google Test)
// //
......
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