Index: ports/gtest/nacl.patch |
diff --git a/ports/gtest/nacl.patch b/ports/gtest/nacl.patch |
index f94cf9fe959ed1d54af6d68666376ebd5ef518f6..7f223e60284d0ccec81cdf9983d4b68add9abb8b 100644 |
--- a/ports/gtest/nacl.patch |
+++ b/ports/gtest/nacl.patch |
@@ -1,7 +1,7 @@ |
diff --git a/CMakeLists.txt b/CMakeLists.txt |
--- a/CMakeLists.txt |
+++ b/CMakeLists.txt |
-@@ -162,14 +162,16 @@ if (gtest_build_tests) |
+@@ -172,14 +172,16 @@ if (gtest_build_tests) |
cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}" |
gtest_main_no_rtti test/gtest_unittest.cc) |
@@ -23,44 +23,26 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt |
+ COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") |
+ endif() |
- if (NOT MSVC OR NOT MSVC_VERSION EQUAL 1600) |
- # The C++ Standard specifies tuple_element<int, class>. |
-diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h |
---- a/include/gtest/internal/gtest-port.h |
-+++ b/include/gtest/internal/gtest-port.h |
-@@ -472,12 +472,12 @@ |
- // Determines whether Google Test can use the pthreads library. |
- #ifndef GTEST_HAS_PTHREAD |
- // The user didn't tell us explicitly, so we assume pthreads support is |
--// available on Linux and Mac. |
-+// available on certain operating systems. |
- // |
- // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 |
- // to your compiler flags. |
- # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \ |
-- || GTEST_OS_QNX) |
-+ || GTEST_OS_QNX || GTEST_OS_NACL) |
- #endif // GTEST_HAS_PTHREAD |
- |
- #if GTEST_HAS_PTHREAD |
+ if (NOT MSVC OR MSVC_VERSION LESS 1600) # 1600 is Visual Studio 2010. |
+ # Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that |
diff --git a/test/gtest-death-test_test.cc b/test/gtest-death-test_test.cc |
--- a/test/gtest-death-test_test.cc |
+++ b/test/gtest-death-test_test.cc |
-@@ -1288,6 +1288,7 @@ TEST(ConditionalDeathMacrosTest, AssertDeatDoesNotReturnhIfUnsupported) { |
- EXPECT_EQ(1, n); |
+@@ -1303,6 +1303,7 @@ TEST(ConditionalDeathMacrosDeathTest, ExpectsDeathWhenDeathTestsAvailable) { |
+ EXPECT_FATAL_FAILURE(ASSERT_DEATH_IF_SUPPORTED(;, ""), ""); |
} |
+#if 0 |
TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInFastStyle) { |
testing::GTEST_FLAG(death_test_style) = "fast"; |
EXPECT_FALSE(InDeathTestChild()); |
-@@ -1307,6 +1308,7 @@ TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInThreadSafeStyle) { |
+@@ -1322,6 +1323,7 @@ TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInThreadSafeStyle) { |
_exit(1); |
}, "Inside"); |
} |
+#endif |
- #endif // GTEST_HAS_DEATH_TEST |
+ #else // !GTEST_HAS_DEATH_TEST follows |
diff --git a/test/gtest-options_test.cc b/test/gtest-options_test.cc |
--- a/test/gtest-options_test.cc |
@@ -76,32 +58,35 @@ diff --git a/test/gtest-options_test.cc b/test/gtest-options_test.cc |
diff --git a/test/gtest-printers_test.cc b/test/gtest-printers_test.cc |
--- a/test/gtest-printers_test.cc |
+++ b/test/gtest-printers_test.cc |
-@@ -206,7 +206,9 @@ using ::testing::internal::UniversalPrint; |
- using ::testing::internal::UniversalPrinter; |
- using ::testing::internal::UniversalTersePrint; |
- using ::testing::internal::UniversalTersePrintTupleFieldsToStrings; |
-+#if 0 |
- using ::testing::internal::kReference; |
-+#endif |
- using ::testing::internal::string; |
- |
- #if GTEST_HAS_TR1_TUPLE |
-@@ -950,6 +952,7 @@ TEST(PrintStlContainerTest, NestedContainer) { |
+@@ -959,6 +959,7 @@ TEST(PrintStlContainerTest, NestedContainer) { |
EXPECT_EQ("{ { 1, 2 }, { 3, 4, 5 } }", Print(v)); |
} |
+#if 0 |
TEST(PrintStlContainerTest, OneDimensionalNativeArray) { |
const int a[3] = { 1, 2, 3 }; |
- NativeArray<int> b(a, 3, kReference); |
-@@ -961,6 +964,7 @@ TEST(PrintStlContainerTest, TwoDimensionalNativeArray) { |
- NativeArray<int[3]> b(a, 2, kReference); |
+ NativeArray<int> b(a, 3, RelationToSourceReference()); |
+@@ -970,6 +971,7 @@ TEST(PrintStlContainerTest, TwoDimensionalNativeArray) { |
+ NativeArray<int[3]> b(a, 2, RelationToSourceReference()); |
EXPECT_EQ("{ { 1, 2, 3 }, { 4, 5, 6 } }", Print(b)); |
} |
+#endif |
// Tests that a class named iterator isn't treated as a container. |
+diff --git a/test/gtest_break_on_failure_unittest.py b/test/gtest_break_on_failure_unittest.py |
+--- a/test/gtest_break_on_failure_unittest.py |
++++ b/test/gtest_break_on_failure_unittest.py |
+@@ -136,6 +136,9 @@ class GTestBreakOnFailureUnitTest(gtest_test_utils.TestCase): |
+ |
+ SetEnvVar(BREAK_ON_FAILURE_ENV_VAR, None) |
+ |
++ if gtest_test_utils.IS_NACL: |
++ return |
++ |
+ msg = ('when %s%s, an assertion failure in "%s" %s cause a seg-fault.' % |
+ (BREAK_ON_FAILURE_ENV_VAR, env_var_value_msg, ' '.join(command), |
+ should_or_not)) |
diff --git a/test/gtest_help_test.py b/test/gtest_help_test.py |
--- a/test/gtest_help_test.py |
+++ b/test/gtest_help_test.py |
@@ -126,16 +111,7 @@ diff --git a/test/gtest_test_utils.py b/test/gtest_test_utils.py |
IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0] |
# The environment variable for specifying the path to the premature-exit file. |
-@@ -172,6 +173,8 @@ def GetTestExecutablePath(executable_name, build_dir=None): |
- executable_name)) |
- if (IS_WINDOWS or IS_CYGWIN) and not path.endswith('.exe'): |
- path += '.exe' |
-+ if IS_NACL and not path.endswith('.sh'): |
-+ path += '.sh' |
- |
- if not os.path.exists(path): |
- message = ( |
-@@ -300,7 +303,8 @@ class Subprocess: |
+@@ -300,7 +301,8 @@ class Subprocess: |
else: |
self.terminated_by_signal = False |
self.exited = True |
@@ -148,29 +124,15 @@ diff --git a/test/gtest_test_utils.py b/test/gtest_test_utils.py |
diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc |
--- a/test/gtest_unittest.cc |
+++ b/test/gtest_unittest.cc |
-@@ -281,9 +281,13 @@ using testing::internal::TestEventListenersAccessor; |
- using testing::internal::TestResultAccessor; |
- using testing::internal::UInt32; |
- using testing::internal::WideStringToUtf8; |
-+#if 0 |
- using testing::internal::kCopy; |
-+#endif |
- using testing::internal::kMaxRandomSeed; |
-+#if 0 |
- using testing::internal::kReference; |
-+#endif |
- using testing::internal::kTestTypeIdInGoogleTest; |
- using testing::internal::scoped_ptr; |
- |
-@@ -7325,6 +7329,7 @@ TEST(CopyArrayTest, WorksForTwoDimensionalArrays) { |
+@@ -7608,6 +7608,7 @@ TEST(CopyArrayTest, WorksForTwoDimensionalArrays) { |
// Tests NativeArray. |
+#if 0 |
TEST(NativeArrayTest, ConstructorFromArrayWorks) { |
const int a[3] = { 0, 1, 2 }; |
- NativeArray<int> na(a, 3, kReference); |
-@@ -7346,6 +7351,7 @@ TEST(NativeArrayTest, CreatesAndDeletesCopyOfArrayWhenAskedTo) { |
+ NativeArray<int> na(a, 3, RelationToSourceReference()); |
+@@ -7629,6 +7630,7 @@ TEST(NativeArrayTest, CreatesAndDeletesCopyOfArrayWhenAskedTo) { |
// We rely on the heap checker to verify that na deletes the copy of |
// array. |
} |
@@ -178,15 +140,15 @@ diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc |
TEST(NativeArrayTest, TypeMembersAreCorrect) { |
StaticAssertTypeEq<char, NativeArray<char>::value_type>(); |
-@@ -7355,6 +7361,7 @@ TEST(NativeArrayTest, TypeMembersAreCorrect) { |
+@@ -7638,6 +7640,7 @@ TEST(NativeArrayTest, TypeMembersAreCorrect) { |
StaticAssertTypeEq<const bool(*)[2], NativeArray<bool[2]>::const_iterator>(); |
} |
+#if 0 |
TEST(NativeArrayTest, MethodsWork) { |
const int a[3] = { 0, 1, 2 }; |
- NativeArray<int> na(a, 3, kCopy); |
-@@ -7387,6 +7394,7 @@ TEST(NativeArrayTest, WorksForTwoDimensionalArray) { |
+ NativeArray<int> na(a, 3, RelationToSourceCopy()); |
+@@ -7670,6 +7673,7 @@ TEST(NativeArrayTest, WorksForTwoDimensionalArray) { |
ASSERT_EQ(2U, na.size()); |
EXPECT_EQ(a, na.begin()); |
} |
@@ -194,3 +156,22 @@ diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc |
// Tests SkipPrefix(). |
+diff --git a/test/gtest_xml_outfiles_test.py b/test/gtest_xml_outfiles_test.py |
+--- a/test/gtest_xml_outfiles_test.py |
++++ b/test/gtest_xml_outfiles_test.py |
+@@ -108,12 +108,13 @@ class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTestCase): |
+ # gtest_xml_outfiles_test_. To account for this possibillity, we |
+ # allow both names in the following code. We should remove this |
+ # hack when Chandler Carruth's libtool replacement tool is ready. |
+- output_file_name1 = test_name + ".xml" |
++ output_file_name1 = test_name + ".nexe.xml" |
+ output_file1 = os.path.join(self.output_dir_, output_file_name1) |
+ output_file_name2 = 'lt-' + output_file_name1 |
+ output_file2 = os.path.join(self.output_dir_, output_file_name2) |
+ self.assert_(os.path.isfile(output_file1) or os.path.isfile(output_file2), |
+- output_file1) |
++ "Nither output file exists (%s %s)" % (output_file1, |
++ output_file2)) |
+ |
+ expected = minidom.parseString(expected_xml) |
+ if os.path.isfile(output_file1): |