Unverified Commit 1dad4cf5 authored by Gennadiy Civil's avatar Gennadiy Civil Committed by GitHub
Browse files

Merge branch 'master' into fix_death_test_child_mingw_wer_issue1116

parents 10f05a62 490554aa
...@@ -31,11 +31,9 @@ ...@@ -31,11 +31,9 @@
"""Verifies that Google Test warns the user when not initialized properly.""" """Verifies that Google Test warns the user when not initialized properly."""
__author__ = 'wan@google.com (Zhanyong Wan)'
import gtest_test_utils import gtest_test_utils
COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_uninitialized_test_') COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-uninitialized-test_')
def Assert(condition): def Assert(condition):
......
...@@ -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)
#include "gtest/gtest.h" #include "gtest/gtest.h"
......
...@@ -26,12 +26,11 @@ ...@@ -26,12 +26,11 @@
// 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)
#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
......
...@@ -26,10 +26,9 @@ ...@@ -26,10 +26,9 @@
// 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)
#include "gtest-typed-test_test.h"
#include "test/gtest-typed-test_test.h"
#include <set> #include <set>
#include <vector> #include <vector>
......
...@@ -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)
#ifndef GTEST_TEST_GTEST_TYPED_TEST_TEST_H_ #ifndef GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
#define GTEST_TEST_GTEST_TYPED_TEST_TEST_H_ #define GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
......
...@@ -25,10 +25,9 @@ ...@@ -25,10 +25,9 @@
// 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) // The Google C++ Testing and Mocking Framework (Google Test)
//
// The Google C++ Testing Framework (Google Test)
// //
// This file contains tests verifying correctness of data provided via // This file contains tests verifying correctness of data provided via
// UnitTest's public methods. // UnitTest's public methods.
......
...@@ -26,22 +26,21 @@ ...@@ -26,22 +26,21 @@
// 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++ Testing and Mocking Framework (Google Test)
//
// Tests for Google C++ Testing Framework (Google Test)
// //
// 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 "gtest-filepath_test.cc" #include "test/googletest-filepath-test.cc"
#include "gtest-linked_ptr_test.cc" #include "test/googletest-linked-ptr-test.cc"
#include "gtest-message_test.cc" #include "test/googletest-message-test.cc"
#include "gtest-options_test.cc" #include "test/googletest-options-test.cc"
#include "gtest-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 "gtest-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"
...@@ -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 Test's assert-by-exception mode with exceptions enabled. // Tests Google Test's assert-by-exception mode with exceptions enabled.
...@@ -98,7 +97,7 @@ TEST(Test, Test) { ...@@ -98,7 +97,7 @@ TEST(Test, Test) {
int kTestForContinuingTest = 0; int kTestForContinuingTest = 0;
TEST(Test, Test2) { TEST(Test, Test2) {
// FIXME(sokolov): how to force Test2 to be after Test? // FIXME: how to force Test2 to be after Test?
kTestForContinuingTest = 1; kTestForContinuingTest = 1;
} }
......
...@@ -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 using global test environments. // Tests using global test environments.
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
# (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 --help flag of Google C++ Testing Framework. """Tests the --help flag of Google C++ Testing and Mocking Framework.
SYNOPSIS SYNOPSIS
gtest_help_test.py --build_dir=BUILD/DIR gtest_help_test.py --build_dir=BUILD/DIR
...@@ -37,8 +37,6 @@ SYNOPSIS ...@@ -37,8 +37,6 @@ SYNOPSIS
gtest_help_test.py gtest_help_test.py
""" """
__author__ = 'wan@google.com (Zhanyong Wan)'
import os import os
import re import re
import gtest_test_utils import gtest_test_utils
......
...@@ -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)
// This program is meant to be run by gtest_help_test.py. Do not run // This program is meant to be run by gtest_help_test.py. Do not run
// it directly. // it directly.
......
...@@ -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)
#include "gtest/gtest.h" #include "gtest/gtest.h"
......
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
// Tests that a Google Test program that has no test defined can run // Tests that a Google Test program that has no test defined can run
// successfully. // successfully.
//
// Author: wan@google.com (Zhanyong Wan)
#include "gtest/gtest.h" #include "gtest/gtest.h"
......
...@@ -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 Test manipulates the premature-exit-detection // Tests that Google Test manipulates the premature-exit-detection
// file correctly. // file correctly.
......
...@@ -26,10 +26,9 @@ ...@@ -26,10 +26,9 @@
// 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) // Unit test for gtest_prod.h.
//
// Unit test for gtest/gtest_prod.h.
#include "production.h" #include "production.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
......
...@@ -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 the --gtest_repeat=number flag. // Tests the --gtest_repeat=number flag.
...@@ -118,8 +117,7 @@ const int kNumberOfParamTests = 10; ...@@ -118,8 +117,7 @@ const int kNumberOfParamTests = 10;
class MyParamTest : public testing::TestWithParam<int> {}; class MyParamTest : public testing::TestWithParam<int> {};
TEST_P(MyParamTest, ShouldPass) { TEST_P(MyParamTest, ShouldPass) {
// TODO(vladl@google.com): Make parameter value checking robust // FIXME: Make parameter value checking robust WRT order of tests.
// WRT order of tests.
GTEST_CHECK_INT_EQ_(g_param_test_count % kNumberOfParamTests, GetParam()); GTEST_CHECK_INT_EQ_(g_param_test_count % kNumberOfParamTests, GetParam());
g_param_test_count++; g_param_test_count++;
} }
......
...@@ -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: mheule@google.com (Markus Heule)
// //
// This test verifies that it's possible to use Google Test by including // This test verifies that it's possible to use Google Test by including
// the gtest.h header file alone. // the gtest.h header file alone.
......
...@@ -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 SCOPED_TRACE() and various Google Test assertions can be // Tests that SCOPED_TRACE() and various Google Test assertions can be
// used in a large number of threads concurrently. // used in a large number of threads concurrently.
......
// Copyright 2013, 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.
//
// Each TEST() expands to some static registration logic. GCC puts all
// such static initialization logic for a translation unit in a common,
// internal function. Since Google's build system restricts how much
// stack space a function can use, there's a limit on how many TEST()s
// one can put in a single C++ test file. This test ensures that a large
// number of TEST()s can be defined in the same translation unit.
#include "gtest/gtest.h"
// This macro defines 10 dummy tests.
#define TEN_TESTS_(test_case_name) \
TEST(test_case_name, T0) {} \
TEST(test_case_name, T1) {} \
TEST(test_case_name, T2) {} \
TEST(test_case_name, T3) {} \
TEST(test_case_name, T4) {} \
TEST(test_case_name, T5) {} \
TEST(test_case_name, T6) {} \
TEST(test_case_name, T7) {} \
TEST(test_case_name, T8) {} \
TEST(test_case_name, T9) {}
// This macro defines 100 dummy tests.
#define HUNDRED_TESTS_(test_case_name_prefix) \
TEN_TESTS_(test_case_name_prefix ## 0) \
TEN_TESTS_(test_case_name_prefix ## 1) \
TEN_TESTS_(test_case_name_prefix ## 2) \
TEN_TESTS_(test_case_name_prefix ## 3) \
TEN_TESTS_(test_case_name_prefix ## 4) \
TEN_TESTS_(test_case_name_prefix ## 5) \
TEN_TESTS_(test_case_name_prefix ## 6) \
TEN_TESTS_(test_case_name_prefix ## 7) \
TEN_TESTS_(test_case_name_prefix ## 8) \
TEN_TESTS_(test_case_name_prefix ## 9)
// This macro defines 1000 dummy tests.
#define THOUSAND_TESTS_(test_case_name_prefix) \
HUNDRED_TESTS_(test_case_name_prefix ## 0) \
HUNDRED_TESTS_(test_case_name_prefix ## 1) \
HUNDRED_TESTS_(test_case_name_prefix ## 2) \
HUNDRED_TESTS_(test_case_name_prefix ## 3) \
HUNDRED_TESTS_(test_case_name_prefix ## 4) \
HUNDRED_TESTS_(test_case_name_prefix ## 5) \
HUNDRED_TESTS_(test_case_name_prefix ## 6) \
HUNDRED_TESTS_(test_case_name_prefix ## 7) \
HUNDRED_TESTS_(test_case_name_prefix ## 8) \
HUNDRED_TESTS_(test_case_name_prefix ## 9)
// Ensures that we can define 1000 TEST()s in the same translation
// unit.
THOUSAND_TESTS_(T)
int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
// We don't actually need to run the dummy tests - the purpose is to
// ensure that they compile.
return 0;
}
...@@ -27,24 +27,20 @@ ...@@ -27,24 +27,20 @@
# (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.
"""Unit test utilities for Google C++ Testing Framework.""" """Unit test utilities for Google C++ Testing and Mocking Framework."""
# Suppresses the 'Import not at the top of the file' lint complaint. # Suppresses the 'Import not at the top of the file' lint complaint.
# pylint: disable-msg=C6204 # pylint: disable-msg=C6204
__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 +70,7 @@ def SetEnvVar(env_var, value): ...@@ -74,7 +70,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 +84,7 @@ def _ParseAndStripGTestFlags(argv): ...@@ -88,7 +84,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
...@@ -310,7 +306,7 @@ def Main(): ...@@ -310,7 +306,7 @@ def Main():
_ParseAndStripGTestFlags(sys.argv) _ParseAndStripGTestFlags(sys.argv)
# The tested binaries should not be writing XML output files unless the # The tested binaries should not be writing XML output files unless the
# script explicitly instructs them to. # script explicitly instructs them to.
# TODO(vladl@google.com): Move this into Subprocess when we implement # FIXME: Move this into Subprocess when we implement
# passing environment into it as a parameter. # passing environment into it as a parameter.
if GTEST_OUTPUT_VAR_NAME in os.environ: if GTEST_OUTPUT_VAR_NAME in os.environ:
del os.environ[GTEST_OUTPUT_VAR_NAME] del os.environ[GTEST_OUTPUT_VAR_NAME]
......
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