merges
This commit is contained in:
		
							parent
							
								
									8170693de6
								
							
						
					
					
						commit
						1fb2e10cfe
					
				@ -31,7 +31,7 @@
 | 
			
		||||
 | 
			
		||||
"""Tests the text output of Google C++ Mocking Framework.
 | 
			
		||||
 | 
			
		||||
SYNOPSIS
 | 
			
		||||
To update the golden file:
 | 
			
		||||
gmock_output_test.py --build_dir=BUILD/DIR --gengolden
 | 
			
		||||
# where BUILD/DIR contains the built gmock_output_test_ file.
 | 
			
		||||
gmock_output_test.py --gengolden
 | 
			
		||||
@ -176,5 +176,8 @@ if __name__ == '__main__':
 | 
			
		||||
    golden_file = open(GOLDEN_PATH, 'wb')
 | 
			
		||||
    golden_file.write(output)
 | 
			
		||||
    golden_file.close()
 | 
			
		||||
    # Suppress the error "googletest was imported but a call to its main()
 | 
			
		||||
    # was never detected."
 | 
			
		||||
    os._exit(0)
 | 
			
		||||
  else:
 | 
			
		||||
    gmock_test_utils.Main()
 | 
			
		||||
 | 
			
		||||
@ -34,7 +34,6 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
 | 
			
		||||
import os
 | 
			
		||||
import sys
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Determines path to gtest_test_utils and imports it.
 | 
			
		||||
SCRIPT_DIR = os.path.dirname(__file__) or '.'
 | 
			
		||||
 | 
			
		||||
@ -44,9 +43,10 @@ if os.path.isdir(gtest_tests_util_dir):
 | 
			
		||||
  GTEST_TESTS_UTIL_DIR = gtest_tests_util_dir
 | 
			
		||||
else:
 | 
			
		||||
  GTEST_TESTS_UTIL_DIR = os.path.join(SCRIPT_DIR, '../../googletest/test')
 | 
			
		||||
 | 
			
		||||
sys.path.append(GTEST_TESTS_UTIL_DIR)
 | 
			
		||||
import gtest_test_utils  # pylint: disable-msg=C6204
 | 
			
		||||
 | 
			
		||||
# pylint: disable=C6204
 | 
			
		||||
import gtest_test_utils
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def GetSourceDir():
 | 
			
		||||
 | 
			
		||||
@ -73,11 +73,9 @@
 | 
			
		||||
//   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions
 | 
			
		||||
//                              are enabled.
 | 
			
		||||
//   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string
 | 
			
		||||
//                              is/isn't available (some systems define
 | 
			
		||||
//                              ::string, which is different to std::string).
 | 
			
		||||
//   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
 | 
			
		||||
//                              is/isn't available (some systems define
 | 
			
		||||
//                              ::wstring, which is different to std::wstring).
 | 
			
		||||
//                              is/isn't available
 | 
			
		||||
//   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::wstring
 | 
			
		||||
//                              is/isn't available
 | 
			
		||||
//   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular
 | 
			
		||||
//                              expressions are/aren't available.
 | 
			
		||||
//   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>
 | 
			
		||||
@ -178,7 +176,7 @@
 | 
			
		||||
//                            GTEST_HAS_POSIX_RE (see above) which users can
 | 
			
		||||
//                            define themselves.
 | 
			
		||||
//   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
 | 
			
		||||
//                            the above two are mutually exclusive.
 | 
			
		||||
//                            the above _RE(s) are mutually exclusive.
 | 
			
		||||
//   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
 | 
			
		||||
 | 
			
		||||
// Misc public macros
 | 
			
		||||
@ -272,10 +270,12 @@
 | 
			
		||||
# include <TargetConditionals.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Brings in the definition of HAS_GLOBAL_STRING.  This must be done
 | 
			
		||||
// BEFORE we test HAS_GLOBAL_STRING.
 | 
			
		||||
#include <string>  // NOLINT
 | 
			
		||||
#include <algorithm>  // NOLINT
 | 
			
		||||
#include <iostream>  // NOLINT
 | 
			
		||||
#include <sstream>  // NOLINT
 | 
			
		||||
#include <string>  // NOLINT
 | 
			
		||||
#include <utility>
 | 
			
		||||
#include <vector>  // NOLINT
 | 
			
		||||
 | 
			
		||||
@ -824,9 +824,10 @@ using ::std::tuple_size;
 | 
			
		||||
# define GTEST_HAS_TYPED_TEST_P 1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Determines whether to support Combine().
 | 
			
		||||
// The implementation doesn't work on Sun Studio since it doesn't
 | 
			
		||||
// understand templated conversion operators.
 | 
			
		||||
// Determines whether to support Combine(). This only makes sense when
 | 
			
		||||
// value-parameterized tests are enabled.  The implementation doesn't
 | 
			
		||||
// work on Sun Studio since it doesn't understand templated conversion
 | 
			
		||||
// operators.
 | 
			
		||||
#if (GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_) && !defined(__SUNPRO_CC)
 | 
			
		||||
# define GTEST_HAS_COMBINE 1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@ -73,7 +73,7 @@ namespace testing {
 | 
			
		||||
// Constants.
 | 
			
		||||
 | 
			
		||||
// The default death test style.
 | 
			
		||||
static const char kDefaultDeathTestStyle[] = "fast";
 | 
			
		||||
static const char kDefaultDeathTestStyle[] = "threadsafe";
 | 
			
		||||
 | 
			
		||||
GTEST_DEFINE_string_(
 | 
			
		||||
    death_test_style,
 | 
			
		||||
@ -555,7 +555,13 @@ bool DeathTestImpl::Passed(bool status_ok) {
 | 
			
		||||
      break;
 | 
			
		||||
    case DIED:
 | 
			
		||||
      if (status_ok) {
 | 
			
		||||
# if GTEST_USES_PCRE
 | 
			
		||||
        // PCRE regexes support embedded NULs.
 | 
			
		||||
        // GTEST_USES_PCRE is defined only in google3 mode
 | 
			
		||||
        const bool matched = RE::PartialMatch(error_message, *regex());
 | 
			
		||||
# else
 | 
			
		||||
        const bool matched = RE::PartialMatch(error_message.c_str(), *regex());
 | 
			
		||||
# endif  // GTEST_USES_PCRE
 | 
			
		||||
        if (matched) {
 | 
			
		||||
          success = true;
 | 
			
		||||
        } else {
 | 
			
		||||
 | 
			
		||||
@ -92,7 +92,7 @@ class GTestEnvVarTest(gtest_test_utils.TestCase):
 | 
			
		||||
    TestFlag('print_time', '0', '1')
 | 
			
		||||
    TestFlag('repeat', '999', '1')
 | 
			
		||||
    TestFlag('throw_on_failure', '1', '0')
 | 
			
		||||
    TestFlag('death_test_style', 'threadsafe', 'fast')
 | 
			
		||||
    TestFlag('death_test_style', 'fast', 'threadsafe')
 | 
			
		||||
    TestFlag('catch_exceptions', '0', '1')
 | 
			
		||||
 | 
			
		||||
    if IS_LINUX:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user