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

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
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 @@ -162,14 +162,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)
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 const int a[3] = { 1, 2, 3 }; 95 const int a[3] = { 1, 2, 3 };
96 NativeArray<int> b(a, 3, kReference); 96 NativeArray<int> b(a, 3, kReference);
97 @@ -961,6 +964,7 @@ TEST(PrintStlContainerTest, TwoDimensionalNativeArray) { 97 @@ -961,6 +964,7 @@ TEST(PrintStlContainerTest, TwoDimensionalNativeArray) {
98 NativeArray<int[3]> b(a, 2, kReference); 98 NativeArray<int[3]> b(a, 2, kReference);
99 EXPECT_EQ("{ { 1, 2, 3 }, { 4, 5, 6 } }", Print(b)); 99 EXPECT_EQ("{ { 1, 2, 3 }, { 4, 5, 6 } }", Print(b));
100 } 100 }
101 +#endif 101 +#endif
102 102
103 // Tests that a class named iterator isn't treated as a container. 103 // Tests that a class named iterator isn't treated as a container.
104 104
105 diff --git a/test/gtest_break_on_failure_unittest.py b/test/gtest_break_on_failu re_unittest.py
106 --- a/test/gtest_break_on_failure_unittest.py
107 +++ b/test/gtest_break_on_failure_unittest.py
108 @@ -136,6 +136,9 @@ class GTestBreakOnFailureUnitTest(gtest_test_utils.TestCase) :
109
110 SetEnvVar(BREAK_ON_FAILURE_ENV_VAR, None)
111
112 + if gtest_test_utils.IS_NACL:
113 + return
114 +
115 msg = ('when %s%s, an assertion failure in "%s" %s cause a seg-fault.' %
116 (BREAK_ON_FAILURE_ENV_VAR, env_var_value_msg, ' '.join(command),
117 should_or_not))
105 diff --git a/test/gtest_help_test.py b/test/gtest_help_test.py 118 diff --git a/test/gtest_help_test.py b/test/gtest_help_test.py
106 --- a/test/gtest_help_test.py 119 --- a/test/gtest_help_test.py
107 +++ b/test/gtest_help_test.py 120 +++ b/test/gtest_help_test.py
108 @@ -44,7 +44,8 @@ import re 121 @@ -44,7 +44,8 @@ import re
109 import gtest_test_utils 122 import gtest_test_utils
110 123
111 124
112 -IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux' 125 -IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
113 +IS_NACL = True 126 +IS_NACL = True
114 +IS_LINUX = not IS_NACL and (os.name == 'posix' and os.uname()[0] == 'Linux') 127 +IS_LINUX = not IS_NACL and (os.name == 'posix' and os.uname()[0] == 'Linux')
115 IS_WINDOWS = os.name == 'nt' 128 IS_WINDOWS = os.name == 'nt'
116 129
117 PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_') 130 PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_')
118 diff --git a/test/gtest_test_utils.py b/test/gtest_test_utils.py 131 diff --git a/test/gtest_test_utils.py b/test/gtest_test_utils.py
119 --- a/test/gtest_test_utils.py 132 --- a/test/gtest_test_utils.py
120 +++ b/test/gtest_test_utils.py 133 +++ b/test/gtest_test_utils.py
121 @@ -54,6 +54,7 @@ except: 134 @@ -54,6 +54,7 @@ except:
122 GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT' 135 GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT'
123 136
124 IS_WINDOWS = os.name == 'nt' 137 IS_WINDOWS = os.name == 'nt'
125 +IS_NACL = True 138 +IS_NACL = True
126 IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0] 139 IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
127 140
128 # The environment variable for specifying the path to the premature-exit file. 141 # The environment variable for specifying the path to the premature-exit file.
129 @@ -172,6 +173,8 @@ def GetTestExecutablePath(executable_name, build_dir=None): 142 @@ -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: 143 else:
140 self.terminated_by_signal = False 144 self.terminated_by_signal = False
141 self.exited = True 145 self.exited = True
142 - self.exit_code = self._return_code 146 - self.exit_code = self._return_code
143 + 147 +
144 + self.exit_code = self._return_code 148 + self.exit_code = self._return_code
145 149
146 150
147 def Main(): 151 def Main():
148 diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc 152 diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 const int a[3] = { 0, 1, 2 }; 191 const int a[3] = { 0, 1, 2 };
188 NativeArray<int> na(a, 3, kCopy); 192 NativeArray<int> na(a, 3, kCopy);
189 @@ -7387,6 +7394,7 @@ TEST(NativeArrayTest, WorksForTwoDimensionalArray) { 193 @@ -7387,6 +7394,7 @@ TEST(NativeArrayTest, WorksForTwoDimensionalArray) {
190 ASSERT_EQ(2U, na.size()); 194 ASSERT_EQ(2U, na.size());
191 EXPECT_EQ(a, na.begin()); 195 EXPECT_EQ(a, na.begin());
192 } 196 }
193 +#endif 197 +#endif
194 198
195 // Tests SkipPrefix(). 199 // Tests SkipPrefix().
196 200
201 diff --git a/test/gtest_xml_outfiles_test.py b/test/gtest_xml_outfiles_test.py
202 --- a/test/gtest_xml_outfiles_test.py
203 +++ b/test/gtest_xml_outfiles_test.py
204 @@ -108,12 +108,13 @@ class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTe stCase):
205 # gtest_xml_outfiles_test_. To account for this possibillity, we
206 # allow both names in the following code. We should remove this
207 # hack when Chandler Carruth's libtool replacement tool is ready.
208 - output_file_name1 = test_name + ".xml"
209 + output_file_name1 = test_name + ".nexe.xml"
210 output_file1 = os.path.join(self.output_dir_, output_file_name1)
211 output_file_name2 = 'lt-' + output_file_name1
212 output_file2 = os.path.join(self.output_dir_, output_file_name2)
213 self.assert_(os.path.isfile(output_file1) or os.path.isfile(output_file2),
214 - output_file1)
215 + "Nither output file exists (%s %s)" % (output_file1,
216 + output_file2))
217
218 expected = minidom.parseString(expected_xml)
219 if os.path.isfile(output_file1):
220 diff --git a/test/gtest_xml_output_unittest.py b/test/gtest_xml_output_unittest. py
221 --- a/test/gtest_xml_output_unittest.py
222 +++ b/test/gtest_xml_output_unittest.py
223 @@ -193,6 +193,7 @@ class GTestXMLOutputUnitTest(gtest_xml_test_utils.GTestXMLTe stCase):
224 minute=int(match.group(5)), second=int(match.group(6)))
225
226 time_delta = abs(datetime.datetime.now() - date_time_from_xml)
227 + print date_time_from_xml
228 # timestamp value should be near the current local time
229 self.assertTrue(time_delta < datetime.timedelta(seconds=600),
230 'time_delta is %s' % time_delta)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698