summaryrefslogtreecommitdiffstats
path: root/googletest
diff options
context:
space:
mode:
Diffstat (limited to 'googletest')
-rw-r--r--googletest/docs/AdvancedGuide.md4
-rw-r--r--googletest/docs/FAQ.md7
-rw-r--r--googletest/docs/Primer.md36
-rw-r--r--googletest/docs/PumpManual.md2
-rw-r--r--googletest/docs/XcodeGuide.md12
-rw-r--r--googletest/samples/sample10_unittest.cc3
-rw-r--r--googletest/samples/sample1_unittest.cc3
-rw-r--r--googletest/samples/sample2_unittest.cc3
-rw-r--r--googletest/samples/sample3_unittest.cc11
-rw-r--r--googletest/samples/sample4_unittest.cc3
-rw-r--r--googletest/samples/sample5_unittest.cc4
-rw-r--r--googletest/samples/sample6_unittest.cc3
-rw-r--r--googletest/samples/sample7_unittest.cc20
-rw-r--r--googletest/samples/sample8_unittest.cc3
-rw-r--r--googletest/samples/sample9_unittest.cc3
-rw-r--r--googletest/src/gtest.cc34
-rw-r--r--googletest/test/BUILD.bazel118
17 files changed, 224 insertions, 45 deletions
diff --git a/googletest/docs/AdvancedGuide.md b/googletest/docs/AdvancedGuide.md
index 514bc35..a454bf4 100644
--- a/googletest/docs/AdvancedGuide.md
+++ b/googletest/docs/AdvancedGuide.md
@@ -128,7 +128,7 @@ c is 10<br>
1. If you see a compiler error "no matching function to call" when using `ASSERT_PRED*` or `EXPECT_PRED*`, please see [this FAQ](FAQ.md#the-compiler-complains-no-matching-function-to-call-when-i-use-assert_predn-how-do-i-fix-it) for how to resolve it.
1. Currently we only provide predicate assertions of arity <= 5. If you need a higher-arity assertion, let us know.
-_Availability_: Linux, Windows, Mac
+_Availability_: Linux, Windows, Mac.
### Using a Function That Returns an AssertionResult ###
@@ -1444,7 +1444,7 @@ absolutely have to test non-public interface code though, you can. There are
two cases to consider:
* Static functions (_not_ the same as static member functions!) or unnamed namespaces, and
- * Private or protected class members
+ * Private or protected class members.
## Static Functions ##
diff --git a/googletest/docs/FAQ.md b/googletest/docs/FAQ.md
index 7d1caf6..a9733c6 100644
--- a/googletest/docs/FAQ.md
+++ b/googletest/docs/FAQ.md
@@ -960,12 +960,11 @@ Have you read a
the Google Test Primer page?
## I want to use Google Test with Visual Studio but don't know where to start. ##
-Many people are in your position and one of the posted his solution to
-our mailing list.
+Many people are in your position and one of them posted his solution to our mailing list.
## I am seeing compile errors mentioning std::type\_traits when I try to use Google Test on Solaris. ##
Google Test uses parts of the standard C++ library that SunStudio does not support.
-Our users reported success using alternative implementations. Try running the build after runing this commad:
+Our users reported success using alternative implementations. Try running the build after running this command:
`export CC=cc CXX=CC CXXFLAGS='-library=stlport4'`
@@ -1015,7 +1014,7 @@ instead of
```
in order to define a test.
-Currently, the following `TEST`, `FAIL`, `SUCCEED`, and the basic comparison assertion macros can have alternative names. You can see the full list of covered macros [here](http://www.google.com/codesearch?q=if+!GTEST_DONT_DEFINE_\w%2B+package:http://googletest\.googlecode\.com+file:/include/gtest/gtest.h). More information can be found in the "Avoiding Macro Name Clashes" section of the README file.
+Currently, the following `TEST`, `FAIL`, `SUCCEED`, and the basic comparison assertion macros can have . You can see the full list of covered macros [here](../include/gtest/gtest.h). More information can be found in the "Avoiding Macro Name Clashes" section of the README file.
## Is it OK if I have two separate `TEST(Foo, Bar)` test methods defined in different namespaces? ##
diff --git a/googletest/docs/Primer.md b/googletest/docs/Primer.md
index be6ad38..b7b5eba 100644
--- a/googletest/docs/Primer.md
+++ b/googletest/docs/Primer.md
@@ -23,6 +23,40 @@ So let's go!
_Note:_ We sometimes refer to Google C++ Testing Framework informally
as _Google Test_.
+# Beware of the nomenclature #
+
+_Note:_ There might be some confusion of idea due to different
+definitions of the terms _Test_, _Test Case_ and _Test Suite_, so beware
+of misunderstanding these.
+
+Historically, the Google C++ Testing Framework started to use the term
+_Test Case_ for grouping related tests, whereas current publications
+including the International Software Testing Qualifications Board
+([ISTQB](http://www.istqb.org/)) and various textbooks on Software
+Quality use the term _[Test
+Suite](http://glossary.istqb.org/search/test%20suite)_ for this.
+
+The related term _Test_, as it is used in the Google C++ Testing
+Framework, is corresponding to the term _[Test
+Case](http://glossary.istqb.org/search/test%20case)_ of ISTQB and
+others.
+
+The term _Test_ is commonly of broad enough sense, including ISTQB's
+definition of _Test Case_, so it's not much of a problem here. But the
+term _Test Case_ as used in Google Test is of contradictory sense and thus confusing.
+
+Unfortunately replacing the term _Test Case_ by _Test Suite_ throughout
+the Google C++ Testing Framework is not easy without breaking dependent
+projects, as `TestCase` is part of the public API at various places.
+
+So for the time being, please be aware of the different definitions of
+the terms:
+
+Meaning | Google Test Term | [ISTQB](http://www.istqb.org/) Term
+------- | ---------------- | -----------------------------------
+Exercise a particular program path with specific input values and verify the results | [TEST()](#simple-tests) | [Test Case](http://glossary.istqb.org/search/test%20case)
+A set of several tests related to one component | [Test Case](#basic-concepts) | [Test Suite](http://glossary.istqb.org/search/test%20suite)
+
# Setting up a New Test Project #
To write a test program using Google Test, you need to compile Google
@@ -281,7 +315,7 @@ declaration`".
For each test defined with `TEST_F()`, Google Test will:
1. Create a _fresh_ test fixture at runtime
- 1. Immediately initialize it via `SetUp()` ,
+ 1. Immediately initialize it via `SetUp()`
1. Run the test
1. Clean up by calling `TearDown()`
1. Delete the test fixture. Note that different tests in the same test case have different test fixture objects, and Google Test always deletes a test fixture before it creates the next one. Google Test does not reuse the same test fixture for multiple tests. Any changes one test makes to the fixture do not affect other tests.
diff --git a/googletest/docs/PumpManual.md b/googletest/docs/PumpManual.md
index 8184f15..109c7f2 100644
--- a/googletest/docs/PumpManual.md
+++ b/googletest/docs/PumpManual.md
@@ -169,7 +169,7 @@ improving Pump.
## Real Examples ##
-You can find real-world applications of Pump in [Google Test](http://www.google.com/codesearch?q=file%3A\.pump%24+package%3Ahttp%3A%2F%2Fgoogletest\.googlecode\.com) and [Google Mock](http://www.google.com/codesearch?q=file%3A\.pump%24+package%3Ahttp%3A%2F%2Fgooglemock\.googlecode\.com). The source file `foo.h.pump` generates `foo.h`.
+You can find real-world applications of Pump in [Google Test](https://github.com/google/googletest/tree/master/googletest) and [Google Mock](https://github.com/google/googletest/tree/master/googlemock). The source file `foo.h.pump` generates `foo.h`.
## Tips ##
diff --git a/googletest/docs/XcodeGuide.md b/googletest/docs/XcodeGuide.md
index bf24bf5..117265c 100644
--- a/googletest/docs/XcodeGuide.md
+++ b/googletest/docs/XcodeGuide.md
@@ -6,13 +6,13 @@ This guide will explain how to use the Google Testing Framework in your Xcode pr
Here is the quick guide for using Google Test in your Xcode project.
- 1. Download the source from the [website](http://code.google.com/p/googletest) using this command: `svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only`
+ 1. Download the source from the [website](http://code.google.com/p/googletest) using this command: `svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only`.
1. Open up the `gtest.xcodeproj` in the `googletest-read-only/xcode/` directory and build the gtest.framework.
- 1. Create a new "Shell Tool" target in your Xcode project called something like "UnitTests"
- 1. Add the gtest.framework to your project and add it to the "Link Binary with Libraries" build phase of "UnitTests"
- 1. Add your unit test source code to the "Compile Sources" build phase of "UnitTests"
+ 1. Create a new "Shell Tool" target in your Xcode project called something like "UnitTests".
+ 1. Add the gtest.framework to your project and add it to the "Link Binary with Libraries" build phase of "UnitTests".
+ 1. Add your unit test source code to the "Compile Sources" build phase of "UnitTests".
1. Edit the "UnitTests" executable and add an environment variable named "DYLD\_FRAMEWORK\_PATH" with a value equal to the path to the framework containing the gtest.framework relative to the compiled executable.
- 1. Build and Go
+ 1. Build and Go.
The following sections further explain each of the steps listed above in depth, describing in more detail how to complete it including some variations.
@@ -66,7 +66,7 @@ If you haven't set up the DYLD\_FRAMEWORK\_PATH, correctly, you might get a mess
Reason: image not found
```
-To correct this problem, got to the directory containing the executable named in "Referenced from:" value in the error message above. Then, with the terminal in this location, find the relative path to the directory containing the gtest.framework. That is the value you'll need to set as the DYLD\_FRAMEWORK\_PATH.
+To correct this problem, go to to the directory containing the executable named in "Referenced from:" value in the error message above. Then, with the terminal in this location, find the relative path to the directory containing the gtest.framework. That is the value you'll need to set as the DYLD\_FRAMEWORK\_PATH.
# Build and Go #
diff --git a/googletest/samples/sample10_unittest.cc b/googletest/samples/sample10_unittest.cc
index 0051cd5..977e5ff 100644
--- a/googletest/samples/sample10_unittest.cc
+++ b/googletest/samples/sample10_unittest.cc
@@ -35,7 +35,6 @@
#include <stdlib.h>
#include "gtest/gtest.h"
-
using ::testing::EmptyTestEventListener;
using ::testing::InitGoogleTest;
using ::testing::Test;
@@ -46,7 +45,6 @@ using ::testing::TestPartResult;
using ::testing::UnitTest;
namespace {
-
// We will track memory used by this class.
class Water {
public:
@@ -106,7 +104,6 @@ TEST(ListenersTest, LeaksWater) {
Water* water = new Water;
EXPECT_TRUE(water != NULL);
}
-
} // namespace
int main(int argc, char **argv) {
diff --git a/googletest/samples/sample1_unittest.cc b/googletest/samples/sample1_unittest.cc
index aefc4f1..8376bb4 100644
--- a/googletest/samples/sample1_unittest.cc
+++ b/googletest/samples/sample1_unittest.cc
@@ -46,7 +46,7 @@
#include <limits.h>
#include "sample1.h"
#include "gtest/gtest.h"
-
+namespace {
// Step 2. Use the TEST macro to define your tests.
//
@@ -139,6 +139,7 @@ TEST(IsPrimeTest, Positive) {
EXPECT_FALSE(IsPrime(6));
EXPECT_TRUE(IsPrime(23));
}
+} // namespace
// Step 3. Call RUN_ALL_TESTS() in main().
//
diff --git a/googletest/samples/sample2_unittest.cc b/googletest/samples/sample2_unittest.cc
index 4fa19b7..df522da 100644
--- a/googletest/samples/sample2_unittest.cc
+++ b/googletest/samples/sample2_unittest.cc
@@ -42,7 +42,7 @@
#include "sample2.h"
#include "gtest/gtest.h"
-
+namespace {
// In this example, we test the MyString class (a simple string).
// Tests the default c'tor.
@@ -107,3 +107,4 @@ TEST(MyString, Set) {
s.Set(NULL);
EXPECT_STREQ(NULL, s.c_string());
}
+} // namespace
diff --git a/googletest/samples/sample3_unittest.cc b/googletest/samples/sample3_unittest.cc
index a4fbe5a..7f51fd8 100644
--- a/googletest/samples/sample3_unittest.cc
+++ b/googletest/samples/sample3_unittest.cc
@@ -65,9 +65,9 @@
#include "sample3-inl.h"
#include "gtest/gtest.h"
-
+namespace {
// To use a test fixture, derive a class from testing::Test.
-class QueueTest : public testing::Test {
+class QueueTestSmpl3 : public testing::Test {
protected: // You should make the members protected s.t. they can be
// accessed from sub-classes.
@@ -120,13 +120,13 @@ class QueueTest : public testing::Test {
// instead of TEST.
// Tests the default c'tor.
-TEST_F(QueueTest, DefaultConstructor) {
+TEST_F(QueueTestSmpl3, DefaultConstructor) {
// You can access data in the test fixture here.
EXPECT_EQ(0u, q0_.Size());
}
// Tests Dequeue().
-TEST_F(QueueTest, Dequeue) {
+TEST_F(QueueTestSmpl3, Dequeue) {
int * n = q0_.Dequeue();
EXPECT_TRUE(n == NULL);
@@ -144,8 +144,9 @@ TEST_F(QueueTest, Dequeue) {
}
// Tests the Queue::Map() function.
-TEST_F(QueueTest, Map) {
+TEST_F(QueueTestSmpl3, Map) {
MapTester(&q0_);
MapTester(&q1_);
MapTester(&q2_);
}
+} // namespace
diff --git a/googletest/samples/sample4_unittest.cc b/googletest/samples/sample4_unittest.cc
index fa5afc7..948266e 100644
--- a/googletest/samples/sample4_unittest.cc
+++ b/googletest/samples/sample4_unittest.cc
@@ -31,7 +31,7 @@
#include "gtest/gtest.h"
#include "sample4.h"
-
+namespace {
// Tests the Increment() method.
TEST(Counter, Increment) {
Counter c;
@@ -43,3 +43,4 @@ TEST(Counter, Increment) {
EXPECT_EQ(1, c.Increment());
EXPECT_EQ(2, c.Increment());
}
+} // namespace
diff --git a/googletest/samples/sample5_unittest.cc b/googletest/samples/sample5_unittest.cc
index 43d8e57..3099930 100644
--- a/googletest/samples/sample5_unittest.cc
+++ b/googletest/samples/sample5_unittest.cc
@@ -49,7 +49,7 @@
#include "sample3-inl.h"
#include "gtest/gtest.h"
#include "sample1.h"
-
+namespace {
// In this sample, we want to ensure that every test finishes within
// ~5 seconds. If a test takes longer to run, we consider it a
// failure.
@@ -191,7 +191,7 @@ TEST_F(QueueTest, Dequeue) {
EXPECT_EQ(1u, q2_.Size());
delete n;
}
-
+} // namespace
// If necessary, you can derive further test fixtures from a derived
// fixture itself. For example, you can derive another fixture from
// QueueTest. Google Test imposes no limit on how deep the hierarchy
diff --git a/googletest/samples/sample6_unittest.cc b/googletest/samples/sample6_unittest.cc
index 8f2036a..1faf0c3 100644
--- a/googletest/samples/sample6_unittest.cc
+++ b/googletest/samples/sample6_unittest.cc
@@ -36,7 +36,7 @@
#include "prime_tables.h"
#include "gtest/gtest.h"
-
+namespace {
// First, we define some factory functions for creating instances of
// the implementations. You may be able to skip this step if all your
// implementations can be constructed the same way.
@@ -222,3 +222,4 @@ INSTANTIATE_TYPED_TEST_CASE_P(OnTheFlyAndPreCalculated, // Instance name
PrimeTableImplementations); // Type list
#endif // GTEST_HAS_TYPED_TEST_P
+} // namespace
diff --git a/googletest/samples/sample7_unittest.cc b/googletest/samples/sample7_unittest.cc
index 1b651a2..b59e1d9 100644
--- a/googletest/samples/sample7_unittest.cc
+++ b/googletest/samples/sample7_unittest.cc
@@ -39,7 +39,7 @@
#include "prime_tables.h"
#include "gtest/gtest.h"
-
+namespace {
#if GTEST_HAS_PARAM_TEST
using ::testing::TestWithParam;
@@ -65,9 +65,9 @@ PrimeTable* CreatePreCalculatedPrimeTable() {
// can refer to the test parameter by GetParam(). In this case, the test
// parameter is a factory function which we call in fixture's SetUp() to
// create and store an instance of PrimeTable.
-class PrimeTableTest : public TestWithParam<CreatePrimeTableFunc*> {
+class PrimeTableTestSmpl7 : public TestWithParam<CreatePrimeTableFunc*> {
public:
- virtual ~PrimeTableTest() { delete table_; }
+ virtual ~PrimeTableTestSmpl7() { delete table_; }
virtual void SetUp() { table_ = (*GetParam())(); }
virtual void TearDown() {
delete table_;
@@ -78,7 +78,7 @@ class PrimeTableTest : public TestWithParam<CreatePrimeTableFunc*> {
PrimeTable* table_;
};
-TEST_P(PrimeTableTest, ReturnsFalseForNonPrimes) {
+TEST_P(PrimeTableTestSmpl7, ReturnsFalseForNonPrimes) {
EXPECT_FALSE(table_->IsPrime(-5));
EXPECT_FALSE(table_->IsPrime(0));
EXPECT_FALSE(table_->IsPrime(1));
@@ -87,7 +87,7 @@ TEST_P(PrimeTableTest, ReturnsFalseForNonPrimes) {
EXPECT_FALSE(table_->IsPrime(100));
}
-TEST_P(PrimeTableTest, ReturnsTrueForPrimes) {
+TEST_P(PrimeTableTestSmpl7, ReturnsTrueForPrimes) {
EXPECT_TRUE(table_->IsPrime(2));
EXPECT_TRUE(table_->IsPrime(3));
EXPECT_TRUE(table_->IsPrime(5));
@@ -96,7 +96,7 @@ TEST_P(PrimeTableTest, ReturnsTrueForPrimes) {
EXPECT_TRUE(table_->IsPrime(131));
}
-TEST_P(PrimeTableTest, CanGetNextPrime) {
+TEST_P(PrimeTableTestSmpl7, CanGetNextPrime) {
EXPECT_EQ(2, table_->GetNextPrime(0));
EXPECT_EQ(3, table_->GetNextPrime(2));
EXPECT_EQ(5, table_->GetNextPrime(3));
@@ -112,10 +112,9 @@ TEST_P(PrimeTableTest, CanGetNextPrime) {
//
// Here, we instantiate our tests with a list of two PrimeTable object
// factory functions:
-INSTANTIATE_TEST_CASE_P(
- OnTheFlyAndPreCalculated,
- PrimeTableTest,
- Values(&CreateOnTheFlyPrimeTable, &CreatePreCalculatedPrimeTable<1000>));
+INSTANTIATE_TEST_CASE_P(OnTheFlyAndPreCalculated, PrimeTableTestSmpl7,
+ Values(&CreateOnTheFlyPrimeTable,
+ &CreatePreCalculatedPrimeTable<1000>));
#else
@@ -128,3 +127,4 @@ INSTANTIATE_TEST_CASE_P(
TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
#endif // GTEST_HAS_PARAM_TEST
+} // namespace
diff --git a/googletest/samples/sample8_unittest.cc b/googletest/samples/sample8_unittest.cc
index 7274334..b0ff2d1 100644
--- a/googletest/samples/sample8_unittest.cc
+++ b/googletest/samples/sample8_unittest.cc
@@ -37,7 +37,7 @@
#include "prime_tables.h"
#include "gtest/gtest.h"
-
+namespace {
#if GTEST_HAS_COMBINE
// Suppose we want to introduce a new, improved implementation of PrimeTable
@@ -171,3 +171,4 @@ INSTANTIATE_TEST_CASE_P(MeaningfulTestParameters,
TEST(DummyTest, CombineIsNotSupportedOnThisPlatform) {}
#endif // GTEST_HAS_COMBINE
+} // namespace
diff --git a/googletest/samples/sample9_unittest.cc b/googletest/samples/sample9_unittest.cc
index b2e2079..75584bb 100644
--- a/googletest/samples/sample9_unittest.cc
+++ b/googletest/samples/sample9_unittest.cc
@@ -44,9 +44,7 @@ using ::testing::TestEventListeners;
using ::testing::TestInfo;
using ::testing::TestPartResult;
using ::testing::UnitTest;
-
namespace {
-
// Provides alternative output mode which produces minimal amount of
// information about tests.
class TersePrinter : public EmptyTestEventListener {
@@ -102,7 +100,6 @@ TEST(CustomOutputTest, Fails) {
EXPECT_EQ(1, 2)
<< "This test fails in order to demonstrate alternative failure messages";
}
-
} // namespace
int main(int argc, char **argv) {
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 46d8d21..b6087f9 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -2895,6 +2895,33 @@ WORD GetColorAttribute(GTestColor color) {
}
}
+int GetBitOffset(WORD color_mask) {
+ if (color_mask == 0) return 0;
+
+ int bitOffset = 0;
+ while((color_mask & 1) == 0) {
+ color_mask >>= 1;
+ ++bitOffset;
+ }
+ return bitOffset;
+}
+
+WORD GetNewColor(GTestColor color, WORD old_color_attrs) {
+ // Let's reuse the BG
+ static const WORD background_mask = BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY;
+ static const WORD foreground_mask = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY;
+ const WORD existing_bg = old_color_attrs & background_mask;
+
+ WORD new_color = GetColorAttribute(color) | existing_bg | FOREGROUND_INTENSITY;
+ static const int bg_bitOffset = GetBitOffset(background_mask);
+ static const int fg_bitOffset = GetBitOffset(foreground_mask);
+
+ if (((new_color & background_mask) >> bg_bitOffset) == ((new_color & foreground_mask) >> fg_bitOffset)) {
+ new_color ^= FOREGROUND_INTENSITY; //invert intensity
+ }
+ return new_color;
+}
+
#else
// Returns the ANSI color code for the given color. COLOR_DEFAULT is
@@ -2980,13 +3007,14 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
CONSOLE_SCREEN_BUFFER_INFO buffer_info;
GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
const WORD old_color_attrs = buffer_info.wAttributes;
-
+ const WORD new_color = GetNewColor(color, old_color_attrs);
+
// We need to flush the stream buffers into the console before each
// SetConsoleTextAttribute call lest it affect the text that is already
// printed but has not yet reached the console.
fflush(stdout);
- SetConsoleTextAttribute(stdout_handle,
- GetColorAttribute(color) | FOREGROUND_INTENSITY);
+ SetConsoleTextAttribute(stdout_handle, new_color);
+
vprintf(fmt, args);
fflush(stdout);
diff --git a/googletest/test/BUILD.bazel b/googletest/test/BUILD.bazel
new file mode 100644
index 0000000..5daa154
--- /dev/null
+++ b/googletest/test/BUILD.bazel
@@ -0,0 +1,118 @@
+# Copyright 2017 Google Inc.
+# All Rights Reserved.
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Author: misterg@google.com (Gennadiy Civil)
+#
+# Bazel BUILD for The Google C++ Testing Framework (Google Test)
+
+licenses(["notice"])
+
+""" gtest own tests """
+
+#on windows exclude gtest-tuple.h and gtest-tuple_test.cc
+cc_test(
+ name = "gtest_all_test",
+ size = "small",
+ srcs = glob(
+ include = [
+ "gtest-*.cc",
+ "*.h",
+ "googletest/include/gtest/**/*.h",
+ ],
+ exclude = [
+ "gtest-unittest-api_test.cc",
+ "gtest-tuple_test.cc",
+ "googletest/src/gtest-all.cc",
+ "gtest_all_test.cc",
+ "gtest-death-test_ex_test.cc",
+ "gtest-listener_test.cc",
+ "gtest-unittest-api_test.cc",
+ "gtest-param-test_test.cc",
+ ],
+ ) + select({
+ "//:win": [],
+ "//conditions:default": [
+ "gtest-tuple_test.cc",
+ ],
+ }),
+ copts = select({
+ "//:win": ["-DGTEST_USE_OWN_TR1_TUPLE=0"],
+ "//conditions:default": ["-DGTEST_USE_OWN_TR1_TUPLE=1"],
+ }),
+ includes = [
+ "googletest",
+ "googletest/include",
+ "googletest/include/internal",
+ "googletest/test",
+ ],
+ linkopts = select({
+ "//:win": [],
+ "//conditions:default": [
+ "-pthread",
+ ],
+ }),
+ deps = ["//:gtest_main"],
+)
+
+#These googletest tests have their own main()
+cc_test(
+ name = "gtest-listener_test",
+ size = "small",
+ srcs = [
+ "gtest-listener_test.cc",
+ ],
+ deps = [
+ "//:gtest",
+ ],
+)
+
+cc_test(
+ name = "gtest-unittest-api_test",
+ size = "small",
+ srcs = [
+ "gtest-unittest-api_test.cc",
+ ],
+ deps = [
+ "//:gtest",
+ ],
+)
+
+cc_test(
+ name = "gtest-param-test_test",
+ size = "small",
+ srcs = [
+ "gtest-param-test2_test.cc",
+ "gtest-param-test_test.cc",
+ "gtest-param-test_test.h",
+ ],
+ deps = [
+ "//:gtest",
+ ],
+)