Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: ports/gtest/nacl.patch

Issue 1555913002: Build gtest from source rather than using SDK-provided version (Closed) Base URL: https://chromium.googlesource.com/webports.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ports/gtest/diff_skip.txt ('k') | ports/gtest/pkg_info » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 diff --git a/CMakeLists.txt b/CMakeLists.txt 1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 --- a/CMakeLists.txt 2 --- a/CMakeLists.txt
3 +++ b/CMakeLists.txt 3 +++ b/CMakeLists.txt
4 @@ -162,14 +162,16 @@ if (gtest_build_tests) 4 @@ -172,14 +172,16 @@ if (gtest_build_tests)
5 cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}" 5 cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}"
6 gtest_main_no_rtti test/gtest_unittest.cc) 6 gtest_main_no_rtti test/gtest_unittest.cc)
7 7
8 - cxx_shared_library(gtest_dll "${cxx_default}" 8 - cxx_shared_library(gtest_dll "${cxx_default}"
9 - src/gtest-all.cc src/gtest_main.cc) 9 - src/gtest-all.cc src/gtest_main.cc)
10 + if (NOT NACL) 10 + if (NOT NACL)
11 + cxx_shared_library(gtest_dll "${cxx_default}" 11 + cxx_shared_library(gtest_dll "${cxx_default}"
12 + src/gtest-all.cc src/gtest_main.cc) 12 + src/gtest-all.cc src/gtest_main.cc)
13 13
14 - cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}" 14 - cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}"
15 - gtest_dll test/gtest_all_test.cc) 15 - gtest_dll test/gtest_all_test.cc)
16 - set_target_properties(gtest_dll_test_ 16 - set_target_properties(gtest_dll_test_
17 - PROPERTIES 17 - PROPERTIES
18 - COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") 18 - COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
19 + cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}" 19 + cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}"
20 + gtest_dll test/gtest_all_test.cc) 20 + gtest_dll test/gtest_all_test.cc)
21 + set_target_properties(gtest_dll_test_ 21 + set_target_properties(gtest_dll_test_
22 + PROPERTIES 22 + PROPERTIES
23 + COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1 ") 23 + COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1 ")
24 + endif() 24 + endif()
25 25
26 if (NOT MSVC OR NOT MSVC_VERSION EQUAL 1600) 26 if (NOT MSVC OR MSVC_VERSION LESS 1600) # 1600 is Visual Studio 2010.
27 # The C++ Standard specifies tuple_element<int, class>. 27 # Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that
28 diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest- port.h
29 --- a/include/gtest/internal/gtest-port.h
30 +++ b/include/gtest/internal/gtest-port.h
31 @@ -472,12 +472,12 @@
32 // Determines whether Google Test can use the pthreads library.
33 #ifndef GTEST_HAS_PTHREAD
34 // The user didn't tell us explicitly, so we assume pthreads support is
35 -// available on Linux and Mac.
36 +// available on certain operating systems.
37 //
38 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
39 // to your compiler flags.
40 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
41 - || GTEST_OS_QNX)
42 + || GTEST_OS_QNX || GTEST_OS_NACL)
43 #endif // GTEST_HAS_PTHREAD
44
45 #if GTEST_HAS_PTHREAD
46 diff --git a/test/gtest-death-test_test.cc b/test/gtest-death-test_test.cc 28 diff --git a/test/gtest-death-test_test.cc b/test/gtest-death-test_test.cc
47 --- a/test/gtest-death-test_test.cc 29 --- a/test/gtest-death-test_test.cc
48 +++ b/test/gtest-death-test_test.cc 30 +++ b/test/gtest-death-test_test.cc
49 @@ -1288,6 +1288,7 @@ TEST(ConditionalDeathMacrosTest, AssertDeatDoesNotReturnhI fUnsupported) { 31 @@ -1303,6 +1303,7 @@ TEST(ConditionalDeathMacrosDeathTest, ExpectsDeathWhenDeat hTestsAvailable) {
50 EXPECT_EQ(1, n); 32 EXPECT_FATAL_FAILURE(ASSERT_DEATH_IF_SUPPORTED(;, ""), "");
51 } 33 }
52 34
53 +#if 0 35 +#if 0
54 TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInFastStyle) { 36 TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInFastStyle) {
55 testing::GTEST_FLAG(death_test_style) = "fast"; 37 testing::GTEST_FLAG(death_test_style) = "fast";
56 EXPECT_FALSE(InDeathTestChild()); 38 EXPECT_FALSE(InDeathTestChild());
57 @@ -1307,6 +1308,7 @@ TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyI nThreadSafeStyle) { 39 @@ -1322,6 +1323,7 @@ TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyI nThreadSafeStyle) {
58 _exit(1); 40 _exit(1);
59 }, "Inside"); 41 }, "Inside");
60 } 42 }
61 +#endif 43 +#endif
62 44
63 #endif // GTEST_HAS_DEATH_TEST 45 #else // !GTEST_HAS_DEATH_TEST follows
64 46
65 diff --git a/test/gtest-options_test.cc b/test/gtest-options_test.cc 47 diff --git a/test/gtest-options_test.cc b/test/gtest-options_test.cc
66 --- a/test/gtest-options_test.cc 48 --- a/test/gtest-options_test.cc
67 +++ b/test/gtest-options_test.cc 49 +++ b/test/gtest-options_test.cc
68 @@ -116,6 +116,7 @@ TEST(OutputFileHelpersTest, GetCurrentExecutableName) { 50 @@ -116,6 +116,7 @@ TEST(OutputFileHelpersTest, GetCurrentExecutableName) {
69 // Chandler Carruth's libtool replacement is ready. 51 // Chandler Carruth's libtool replacement is ready.
70 const bool success = 52 const bool success =
71 exe_str == "gtest-options_test" || 53 exe_str == "gtest-options_test" ||
72 + exe_str == "gtest-options_test.nexe" || 54 + exe_str == "gtest-options_test.nexe" ||
73 exe_str == "gtest_all_test" || 55 exe_str == "gtest_all_test" ||
74 exe_str == "lt-gtest_all_test" || 56 exe_str == "lt-gtest_all_test" ||
75 exe_str == "gtest_dll_test"; 57 exe_str == "gtest_dll_test";
76 diff --git a/test/gtest-printers_test.cc b/test/gtest-printers_test.cc 58 diff --git a/test/gtest-printers_test.cc b/test/gtest-printers_test.cc
77 --- a/test/gtest-printers_test.cc 59 --- a/test/gtest-printers_test.cc
78 +++ b/test/gtest-printers_test.cc 60 +++ b/test/gtest-printers_test.cc
79 @@ -206,7 +206,9 @@ using ::testing::internal::UniversalPrint; 61 @@ -959,6 +959,7 @@ TEST(PrintStlContainerTest, NestedContainer) {
80 using ::testing::internal::UniversalPrinter;
81 using ::testing::internal::UniversalTersePrint;
82 using ::testing::internal::UniversalTersePrintTupleFieldsToStrings;
83 +#if 0
84 using ::testing::internal::kReference;
85 +#endif
86 using ::testing::internal::string;
87
88 #if GTEST_HAS_TR1_TUPLE
89 @@ -950,6 +952,7 @@ TEST(PrintStlContainerTest, NestedContainer) {
90 EXPECT_EQ("{ { 1, 2 }, { 3, 4, 5 } }", Print(v)); 62 EXPECT_EQ("{ { 1, 2 }, { 3, 4, 5 } }", Print(v));
91 } 63 }
92 64
93 +#if 0 65 +#if 0
94 TEST(PrintStlContainerTest, OneDimensionalNativeArray) { 66 TEST(PrintStlContainerTest, OneDimensionalNativeArray) {
95 const int a[3] = { 1, 2, 3 }; 67 const int a[3] = { 1, 2, 3 };
96 NativeArray<int> b(a, 3, kReference); 68 NativeArray<int> b(a, 3, RelationToSourceReference());
97 @@ -961,6 +964,7 @@ TEST(PrintStlContainerTest, TwoDimensionalNativeArray) { 69 @@ -970,6 +971,7 @@ TEST(PrintStlContainerTest, TwoDimensionalNativeArray) {
98 NativeArray<int[3]> b(a, 2, kReference); 70 NativeArray<int[3]> b(a, 2, RelationToSourceReference());
99 EXPECT_EQ("{ { 1, 2, 3 }, { 4, 5, 6 } }", Print(b)); 71 EXPECT_EQ("{ { 1, 2, 3 }, { 4, 5, 6 } }", Print(b));
100 } 72 }
101 +#endif 73 +#endif
102 74
103 // Tests that a class named iterator isn't treated as a container. 75 // Tests that a class named iterator isn't treated as a container.
104 76
77 diff --git a/test/gtest_break_on_failure_unittest.py b/test/gtest_break_on_failu re_unittest.py
78 --- a/test/gtest_break_on_failure_unittest.py
79 +++ b/test/gtest_break_on_failure_unittest.py
80 @@ -136,6 +136,9 @@ class GTestBreakOnFailureUnitTest(gtest_test_utils.TestCase) :
81
82 SetEnvVar(BREAK_ON_FAILURE_ENV_VAR, None)
83
84 + if gtest_test_utils.IS_NACL:
85 + return
86 +
87 msg = ('when %s%s, an assertion failure in "%s" %s cause a seg-fault.' %
88 (BREAK_ON_FAILURE_ENV_VAR, env_var_value_msg, ' '.join(command),
89 should_or_not))
105 diff --git a/test/gtest_help_test.py b/test/gtest_help_test.py 90 diff --git a/test/gtest_help_test.py b/test/gtest_help_test.py
106 --- a/test/gtest_help_test.py 91 --- a/test/gtest_help_test.py
107 +++ b/test/gtest_help_test.py 92 +++ b/test/gtest_help_test.py
108 @@ -44,7 +44,8 @@ import re 93 @@ -44,7 +44,8 @@ import re
109 import gtest_test_utils 94 import gtest_test_utils
110 95
111 96
112 -IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux' 97 -IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
113 +IS_NACL = True 98 +IS_NACL = True
114 +IS_LINUX = not IS_NACL and (os.name == 'posix' and os.uname()[0] == 'Linux') 99 +IS_LINUX = not IS_NACL and (os.name == 'posix' and os.uname()[0] == 'Linux')
115 IS_WINDOWS = os.name == 'nt' 100 IS_WINDOWS = os.name == 'nt'
116 101
117 PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_') 102 PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_')
118 diff --git a/test/gtest_test_utils.py b/test/gtest_test_utils.py 103 diff --git a/test/gtest_test_utils.py b/test/gtest_test_utils.py
119 --- a/test/gtest_test_utils.py 104 --- a/test/gtest_test_utils.py
120 +++ b/test/gtest_test_utils.py 105 +++ b/test/gtest_test_utils.py
121 @@ -54,6 +54,7 @@ except: 106 @@ -54,6 +54,7 @@ except:
122 GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT' 107 GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT'
123 108
124 IS_WINDOWS = os.name == 'nt' 109 IS_WINDOWS = os.name == 'nt'
125 +IS_NACL = True 110 +IS_NACL = True
126 IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0] 111 IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
127 112
128 # The environment variable for specifying the path to the premature-exit file. 113 # The environment variable for specifying the path to the premature-exit file.
129 @@ -172,6 +173,8 @@ def GetTestExecutablePath(executable_name, build_dir=None): 114 @@ -300,7 +301,8 @@ class Subprocess:
130 executable_name))
131 if (IS_WINDOWS or IS_CYGWIN) and not path.endswith('.exe'):
132 path += '.exe'
133 + if IS_NACL and not path.endswith('.sh'):
134 + path += '.sh'
135
136 if not os.path.exists(path):
137 message = (
138 @@ -300,7 +303,8 @@ class Subprocess:
139 else: 115 else:
140 self.terminated_by_signal = False 116 self.terminated_by_signal = False
141 self.exited = True 117 self.exited = True
142 - self.exit_code = self._return_code 118 - self.exit_code = self._return_code
143 + 119 +
144 + self.exit_code = self._return_code 120 + self.exit_code = self._return_code
145 121
146 122
147 def Main(): 123 def Main():
148 diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc 124 diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc
149 --- a/test/gtest_unittest.cc 125 --- a/test/gtest_unittest.cc
150 +++ b/test/gtest_unittest.cc 126 +++ b/test/gtest_unittest.cc
151 @@ -281,9 +281,13 @@ using testing::internal::TestEventListenersAccessor; 127 @@ -7608,6 +7608,7 @@ TEST(CopyArrayTest, WorksForTwoDimensionalArrays) {
152 using testing::internal::TestResultAccessor;
153 using testing::internal::UInt32;
154 using testing::internal::WideStringToUtf8;
155 +#if 0
156 using testing::internal::kCopy;
157 +#endif
158 using testing::internal::kMaxRandomSeed;
159 +#if 0
160 using testing::internal::kReference;
161 +#endif
162 using testing::internal::kTestTypeIdInGoogleTest;
163 using testing::internal::scoped_ptr;
164
165 @@ -7325,6 +7329,7 @@ TEST(CopyArrayTest, WorksForTwoDimensionalArrays) {
166 128
167 // Tests NativeArray. 129 // Tests NativeArray.
168 130
169 +#if 0 131 +#if 0
170 TEST(NativeArrayTest, ConstructorFromArrayWorks) { 132 TEST(NativeArrayTest, ConstructorFromArrayWorks) {
171 const int a[3] = { 0, 1, 2 }; 133 const int a[3] = { 0, 1, 2 };
172 NativeArray<int> na(a, 3, kReference); 134 NativeArray<int> na(a, 3, RelationToSourceReference());
173 @@ -7346,6 +7351,7 @@ TEST(NativeArrayTest, CreatesAndDeletesCopyOfArrayWhenAske dTo) { 135 @@ -7629,6 +7630,7 @@ TEST(NativeArrayTest, CreatesAndDeletesCopyOfArrayWhenAske dTo) {
174 // We rely on the heap checker to verify that na deletes the copy of 136 // We rely on the heap checker to verify that na deletes the copy of
175 // array. 137 // array.
176 } 138 }
177 +#endif 139 +#endif
178 140
179 TEST(NativeArrayTest, TypeMembersAreCorrect) { 141 TEST(NativeArrayTest, TypeMembersAreCorrect) {
180 StaticAssertTypeEq<char, NativeArray<char>::value_type>(); 142 StaticAssertTypeEq<char, NativeArray<char>::value_type>();
181 @@ -7355,6 +7361,7 @@ TEST(NativeArrayTest, TypeMembersAreCorrect) { 143 @@ -7638,6 +7640,7 @@ TEST(NativeArrayTest, TypeMembersAreCorrect) {
182 StaticAssertTypeEq<const bool(*)[2], NativeArray<bool[2]>::const_iterator>(); 144 StaticAssertTypeEq<const bool(*)[2], NativeArray<bool[2]>::const_iterator>();
183 } 145 }
184 146
185 +#if 0 147 +#if 0
186 TEST(NativeArrayTest, MethodsWork) { 148 TEST(NativeArrayTest, MethodsWork) {
187 const int a[3] = { 0, 1, 2 }; 149 const int a[3] = { 0, 1, 2 };
188 NativeArray<int> na(a, 3, kCopy); 150 NativeArray<int> na(a, 3, RelationToSourceCopy());
189 @@ -7387,6 +7394,7 @@ TEST(NativeArrayTest, WorksForTwoDimensionalArray) { 151 @@ -7670,6 +7673,7 @@ TEST(NativeArrayTest, WorksForTwoDimensionalArray) {
190 ASSERT_EQ(2U, na.size()); 152 ASSERT_EQ(2U, na.size());
191 EXPECT_EQ(a, na.begin()); 153 EXPECT_EQ(a, na.begin());
192 } 154 }
193 +#endif 155 +#endif
194 156
195 // Tests SkipPrefix(). 157 // Tests SkipPrefix().
196 158
159 diff --git a/test/gtest_xml_outfiles_test.py b/test/gtest_xml_outfiles_test.py
160 --- a/test/gtest_xml_outfiles_test.py
161 +++ b/test/gtest_xml_outfiles_test.py
162 @@ -108,12 +108,13 @@ class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTe stCase):
163 # gtest_xml_outfiles_test_. To account for this possibillity, we
164 # allow both names in the following code. We should remove this
165 # hack when Chandler Carruth's libtool replacement tool is ready.
166 - output_file_name1 = test_name + ".xml"
167 + output_file_name1 = test_name + ".nexe.xml"
168 output_file1 = os.path.join(self.output_dir_, output_file_name1)
169 output_file_name2 = 'lt-' + output_file_name1
170 output_file2 = os.path.join(self.output_dir_, output_file_name2)
171 self.assert_(os.path.isfile(output_file1) or os.path.isfile(output_file2),
172 - output_file1)
173 + "Nither output file exists (%s %s)" % (output_file1,
174 + output_file2))
175
176 expected = minidom.parseString(expected_xml)
177 if os.path.isfile(output_file1):
OLDNEW
« no previous file with comments | « ports/gtest/diff_skip.txt ('k') | ports/gtest/pkg_info » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698