diff --git a/test/gtest-param-test_test.cc b/test/gtest-param-test_test.cc index 63080216..ecb5fdbb 100644 --- a/test/gtest-param-test_test.cc +++ b/test/gtest-param-test_test.cc @@ -787,6 +787,6 @@ int main(int argc, char **argv) { GeneratorEvaluationTest::set_param_value(1); #endif // GTEST_HAS_PARAM_TEST - testing::InitGoogleTest(&argc, argv); + ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/gtest-test-part_test.cc b/test/gtest-test-part_test.cc index f9e2e5d3..93fe156e 100644 --- a/test/gtest-test-part_test.cc +++ b/test/gtest-test-part_test.cc @@ -1,5 +1,34 @@ -// Copyright 2008 Google Inc. All Rights Reserved. +// 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: mheule@google.com (Markus Heule) +// #include diff --git a/test/gtest_filter_unittest_.cc b/test/gtest_filter_unittest_.cc index d496f531..3cbddcf6 100644 --- a/test/gtest_filter_unittest_.cc +++ b/test/gtest_filter_unittest_.cc @@ -140,7 +140,7 @@ INSTANTIATE_TEST_CASE_P(SeqQ, ParamTest, testing::Values(5, 6)); } // namespace int main(int argc, char **argv) { - testing::InitGoogleTest(&argc, argv); + ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/gtest_list_tests_unittest_.cc b/test/gtest_list_tests_unittest_.cc index 1ba3922c..a0ed0825 100644 --- a/test/gtest_list_tests_unittest_.cc +++ b/test/gtest_list_tests_unittest_.cc @@ -79,7 +79,7 @@ TEST(FooDeathTest, Test1) { } // namespace int main(int argc, char **argv) { - testing::InitGoogleTest(&argc, argv); + ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/gtest_output_test.py b/test/gtest_output_test.py index 6cff1623..2751fa66 100755 --- a/test/gtest_output_test.py +++ b/test/gtest_output_test.py @@ -253,8 +253,13 @@ class GTestOutputTest(unittest.TestCase): def testOutput(self): output = GetOutputOfAllCommands() + golden_file = open(GOLDEN_PATH, 'rb') - golden = golden_file.read() + # A mis-configured source control system can cause \r appear in EOL + # sequences when we read the golden file irrespective of an operating + # system used. Therefore, we need to strip those \r's from newlines + # unconditionally. + golden = ToUnixLineEnding(golden_file.read()) golden_file.close() # We want the test to pass regardless of death tests being diff --git a/test/gtest_output_test_.cc b/test/gtest_output_test_.cc index 6d42ad80..693df3f5 100644 --- a/test/gtest_output_test_.cc +++ b/test/gtest_output_test_.cc @@ -974,6 +974,10 @@ int main(int argc, char **argv) { // We just run the tests, knowing some of them are intended to fail. // We will use a separate Python script to compare the output of // this program with the golden file. + + // It's hard to test InitGoogleTest() directly, as it has many + // global side effects. The following line serves as a sanity test + // for it. testing::InitGoogleTest(&argc, argv); if (argc >= 2 && String(argv[1]) == "--gtest_internal_skip_environment_and_ad_hoc_tests")