Merge pull request #1515 from gennadiycivil/master

merges
This commit is contained in:
Gennadiy Civil 2018-03-26 14:10:38 -04:00 committed by GitHub
commit 2f3af4f923
4 changed files with 17 additions and 12 deletions

View File

@ -1434,6 +1434,8 @@ template <typename T>
const T& move(const T& t) { const T& move(const T& t) {
return t; return t;
} }
template <typename T>
GTEST_ADD_REFERENCE_(T) forward(GTEST_ADD_REFERENCE_(T) t) { return t; }
template <typename T> template <typename T>
struct RvalueRef { struct RvalueRef {
@ -2338,6 +2340,7 @@ struct is_same : public false_type {};
template <typename T> template <typename T>
struct is_same<T, T> : public true_type {}; struct is_same<T, T> : public true_type {};
template <typename T> template <typename T>
struct is_pointer : public false_type {}; struct is_pointer : public false_type {};
@ -2349,6 +2352,7 @@ struct IteratorTraits {
typedef typename Iterator::value_type value_type; typedef typename Iterator::value_type value_type;
}; };
template <typename T> template <typename T>
struct IteratorTraits<T*> { struct IteratorTraits<T*> {
typedef T value_type; typedef T value_type;

View File

@ -115,10 +115,9 @@ def HeaderPreamble(n):
#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
// Makes sure this header is not included before gtest.h. #include "gtest/gtest.h"
#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
# error Do not include gtest_pred_impl.h directly. Include gtest.h instead. namespace testing {
#endif // GTEST_INCLUDE_GTEST_GTEST_H_
// This header implements a family of generic predicate assertion // This header implements a family of generic predicate assertion
// macros: // macros:
@ -295,16 +294,17 @@ def HeaderPostamble():
return """ return """
} // namespace testing
#endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ #endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
""" """
def GenerateFile(path, content): def GenerateFile(path, content):
"""Given a file path and a content string, overwrites it with the """Given a file path and a content string
given content.""" overwrites it with the given content.
"""
print 'Updating file %s . . .' % path print 'Updating file %s . . .' % path
f = file(path, 'w+') f = file(path, 'w+')
print >>f, content, print >>f, content,
f.close() f.close()
@ -314,8 +314,8 @@ def GenerateFile(path, content):
def GenerateHeader(n): def GenerateHeader(n):
"""Given the maximum arity n, updates the header file that implements """Given the maximum arity n, updates the header file that implements
the predicate assertions.""" the predicate assertions.
"""
GenerateFile(HEADER, GenerateFile(HEADER,
HeaderPreamble(n) HeaderPreamble(n)
+ ''.join([ImplementationForArity(i) for i in OneTo(n)]) + ''.join([ImplementationForArity(i) for i in OneTo(n)])

View File

@ -1226,8 +1226,8 @@ Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) {
// "xml:" prefix of GTEST_OUTPUT. // "xml:" prefix of GTEST_OUTPUT.
// Note that this is meant to be called at the call site so it does // Note that this is meant to be called at the call site so it does
// not check that the flag is 'output' // not check that the flag is 'output'
// In essence this checks env. variable called XML_OUTPUT_FILE // In essence this checks an env variable called XML_OUTPUT_FILE
// if it is set we prepend "xml:" to its value , if it not set we return "" // and if it is set we prepend "xml:" to its value, if it not set we return ""
std::string OutputFlagAlsoCheckEnvVar(){ std::string OutputFlagAlsoCheckEnvVar(){
std::string default_value_for_output_flag = ""; std::string default_value_for_output_flag = "";
const char* xml_output_file_env = posix::GetEnv("XML_OUTPUT_FILE"); const char* xml_output_file_env = posix::GetEnv("XML_OUTPUT_FILE");

View File

@ -100,6 +100,7 @@ class GTestEnvVarTest(gtest_test_utils.TestCase):
TestFlag('death_test_use_fork', '1', '0') TestFlag('death_test_use_fork', '1', '0')
TestFlag('stack_trace_depth', '0', '100') TestFlag('stack_trace_depth', '0', '100')
def testXmlOutputFile(self): def testXmlOutputFile(self):
"""Tests that $XML_OUTPUT_FILE affects the output flag.""" """Tests that $XML_OUTPUT_FILE affects the output flag."""