aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGennadiy Civil <misterg@google.com>2018-03-26 13:04:28 -0400
committerGennadiy Civil <misterg@google.com>2018-03-26 13:04:28 -0400
commit3df7cbe6f7377592a8ecc881ef0cde7f20d5c11b (patch)
tree96f47304e654fc29b6016c20ebb94521bb178392
parent6aae206bc2970068cf6bbf72a9ad07f8464cd0d0 (diff)
downloadgoogletest-3df7cbe6f7377592a8ecc881ef0cde7f20d5c11b.tar.gz
googletest-3df7cbe6f7377592a8ecc881ef0cde7f20d5c11b.tar.bz2
googletest-3df7cbe6f7377592a8ecc881ef0cde7f20d5c11b.zip
merges, gtest
-rw-r--r--googletest/include/gtest/internal/gtest-port.h4
-rwxr-xr-xgoogletest/scripts/gen_gtest_pred_impl.py23
-rw-r--r--googletest/src/gtest-port.cc4
-rwxr-xr-xgoogletest/test/gtest_env_var_test.py1
4 files changed, 19 insertions, 13 deletions
diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h
index 751e1764..e8cc5ae1 100644
--- a/googletest/include/gtest/internal/gtest-port.h
+++ b/googletest/include/gtest/internal/gtest-port.h
@@ -1434,6 +1434,8 @@ template <typename T>
const T& move(const T& t) {
return t;
}
+template <typename T>
+GTEST_ADD_REFERENCE_(T) forward(GTEST_ADD_REFERENCE_(T) t) { return t; }
template <typename T>
struct RvalueRef {
@@ -2338,6 +2340,7 @@ struct is_same : public false_type {};
template <typename T>
struct is_same<T, T> : public true_type {};
+
template <typename T>
struct is_pointer : public false_type {};
@@ -2349,6 +2352,7 @@ struct IteratorTraits {
typedef typename Iterator::value_type value_type;
};
+
template <typename T>
struct IteratorTraits<T*> {
typedef T value_type;
diff --git a/googletest/scripts/gen_gtest_pred_impl.py b/googletest/scripts/gen_gtest_pred_impl.py
index 3e7ab042..58d6dc31 100755
--- a/googletest/scripts/gen_gtest_pred_impl.py
+++ b/googletest/scripts/gen_gtest_pred_impl.py
@@ -115,10 +115,9 @@ def HeaderPreamble(n):
#ifndef 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.
-#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
-# error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
-#endif // GTEST_INCLUDE_GTEST_GTEST_H_
+#include "gtest/gtest.h"
+
+namespace testing {
// This header implements a family of generic predicate assertion
// macros:
@@ -295,14 +294,16 @@ def HeaderPostamble():
return """
+} // namespace testing
+
#endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
"""
def GenerateFile(path, content):
- """Given a file path and a content string, overwrites it with the
- given content."""
-
+ """Given a file path and a content string
+ overwrites it with the given content.
+ """
print 'Updating file %s . . .' % path
f = file(path, 'w+')
@@ -314,8 +315,8 @@ def GenerateFile(path, content):
def GenerateHeader(n):
"""Given the maximum arity n, updates the header file that implements
- the predicate assertions."""
-
+ the predicate assertions.
+ """
GenerateFile(HEADER,
HeaderPreamble(n)
+ ''.join([ImplementationForArity(i) for i in OneTo(n)])
@@ -427,7 +428,7 @@ def TestsForArity(n):
}
tests = (
-"""// Sample functions/functors for testing %(arity)s predicate assertions.
+ """// Sample functions/functors for testing %(arity)s predicate assertions.
// A %(arity)s predicate function.
template <%(types)s>
@@ -588,7 +589,7 @@ typedef Predicate%(n)sTest ASSERT_PRED%(n)sTest;
if use_assert:
assrt = 'ASSERT' # 'assert' is reserved, so we cannot use
- # that identifier here.
+ # that identifier here.
else:
assrt = 'EXPECT'
diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc
index e710354a..d32afb1f 100644
--- a/googletest/src/gtest-port.cc
+++ b/googletest/src/gtest-port.cc
@@ -1226,8 +1226,8 @@ Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) {
// "xml:" prefix of GTEST_OUTPUT.
// Note that this is meant to be called at the call site so it does
// not check that the flag is 'output'
-// In essence this checks env. variable called XML_OUTPUT_FILE
-// if it is set we prepend "xml:" to its value , if it not set we return ""
+// In essence this checks an env variable called XML_OUTPUT_FILE
+// and if it is set we prepend "xml:" to its value, if it not set we return ""
std::string OutputFlagAlsoCheckEnvVar(){
std::string default_value_for_output_flag = "";
const char* xml_output_file_env = posix::GetEnv("XML_OUTPUT_FILE");
diff --git a/googletest/test/gtest_env_var_test.py b/googletest/test/gtest_env_var_test.py
index 5361508a..beb2a8b0 100755
--- a/googletest/test/gtest_env_var_test.py
+++ b/googletest/test/gtest_env_var_test.py
@@ -100,6 +100,7 @@ class GTestEnvVarTest(gtest_test_utils.TestCase):
TestFlag('death_test_use_fork', '1', '0')
TestFlag('stack_trace_depth', '0', '100')
+
def testXmlOutputFile(self):
"""Tests that $XML_OUTPUT_FILE affects the output flag."""