From 96077bc9f37cdc3d9c182ba78ef0a2560099aced Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Wed, 1 Aug 2018 15:02:28 -0400 Subject: [PATCH] more tests changes --- googletest/test/BUILD.bazel | 30 ++++++++++--- ..._test.cc => googletest-death-test-test.cc} | 0 ...st.py => googletest-uninitialized-test.py} | 2 +- .../test/googletest-uninitialized-test_.cc | 43 +++++++++++++++++++ 4 files changed, 69 insertions(+), 6 deletions(-) rename googletest/test/{gtest-death-test_test.cc => googletest-death-test-test.cc} (100%) rename googletest/test/{gtest_uninitialized_test.py => googletest-uninitialized-test.py} (96%) create mode 100644 googletest/test/googletest-uninitialized-test_.cc diff --git a/googletest/test/BUILD.bazel b/googletest/test/BUILD.bazel index 360ce26a..780b278e 100644 --- a/googletest/test/BUILD.bazel +++ b/googletest/test/BUILD.bazel @@ -56,6 +56,7 @@ cc_test( srcs = glob( include = [ "gtest-*.cc", + "googletest-*.cc", "*.h", "googletest/include/gtest/**/*.h", ], @@ -68,6 +69,17 @@ cc_test( "gtest-listener_test.cc", "gtest-unittest-api_test.cc", "gtest-param-test_test.cc", + "googletest-catch-exceptions-test_.cc", + "googletest-color-test_.cc", + "googletest-env-var-test_.cc", + "googletest-filter-unittest_.cc", + "googletest-break-on-failure-unittest_.cc", + "googletest-listener-test.cc", + "googletest-output-test_.cc", + "googletest-list-tests-unittest_.cc", + "googletest-shuffle-test_.cc", + "googletest-uninitialized-test_.cc", + ], ) + select({ "//:windows": [], @@ -98,6 +110,14 @@ cc_test( ) +# Tests death tests. +cc_test( + name = "googletest-death-test-test", + size = "medium", + srcs = ["googletest-death-test-test.cc"], + deps = ["//:gtest_main"], +) + cc_test( name = "gtest_test_macro_stack_footprint_test", size = "small", @@ -399,17 +419,17 @@ py_test( ) cc_binary( - name = "gtest_uninitialized_test_", + name = "googletest-uninitialized-test_", testonly = 1, - srcs = ["gtest_uninitialized_test_.cc"], + srcs = ["googletest-uninitialized-test_.cc"], deps = ["//:gtest"], ) py_test( - name = "gtest_uninitialized_test", + name = "googletest-uninitialized-test", size = "medium", - srcs = ["gtest_uninitialized_test.py"], - data = [":gtest_uninitialized_test_"], + srcs = ["googletest-uninitialized-test.py"], + data = ["googletest-uninitialized-test_"], deps = [":gtest_test_utils"], ) diff --git a/googletest/test/gtest-death-test_test.cc b/googletest/test/googletest-death-test-test.cc similarity index 100% rename from googletest/test/gtest-death-test_test.cc rename to googletest/test/googletest-death-test-test.cc diff --git a/googletest/test/gtest_uninitialized_test.py b/googletest/test/googletest-uninitialized-test.py similarity index 96% rename from googletest/test/gtest_uninitialized_test.py rename to googletest/test/googletest-uninitialized-test.py index ae91f2aa..e3df5faf 100755 --- a/googletest/test/gtest_uninitialized_test.py +++ b/googletest/test/googletest-uninitialized-test.py @@ -35,7 +35,7 @@ __author__ = 'wan@google.com (Zhanyong Wan)' import gtest_test_utils -COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_uninitialized_test_') +COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-uninitialized-test_') def Assert(condition): diff --git a/googletest/test/googletest-uninitialized-test_.cc b/googletest/test/googletest-uninitialized-test_.cc new file mode 100644 index 00000000..2ba0e8b8 --- /dev/null +++ b/googletest/test/googletest-uninitialized-test_.cc @@ -0,0 +1,43 @@ +// Copyright 2008, 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: wan@google.com (Zhanyong Wan) + +#include "gtest/gtest.h" + +TEST(DummyTest, Dummy) { + // This test doesn't verify anything. We just need it to create a + // realistic stage for testing the behavior of Google Test when + // RUN_ALL_TESTS() is called without + // testing::InitGoogleTest() being called first. +} + +int main() { + return RUN_ALL_TESTS(); +}