| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import os | 6 import os |
| 7 import ntpath | 7 import ntpath |
| 8 import posixpath | 8 import posixpath |
| 9 import sys | 9 import sys |
| 10 import collections | 10 import collections |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 def testArmLinux(self): | 175 def testArmLinux(self): |
| 176 build_artifacts.PLATFORM = 'linux' | 176 build_artifacts.PLATFORM = 'linux' |
| 177 build_artifacts.GypNinjaBuild( | 177 build_artifacts.GypNinjaBuild( |
| 178 'arm', 'gyp.py', 'foo.gyp', 'target', 'out_dir') | 178 'arm', 'gyp.py', 'foo.gyp', 'target', 'out_dir') |
| 179 self.run_mock.assert_has_calls([ | 179 self.run_mock.assert_has_calls([ |
| 180 call(['python', 'gyp.py', 'foo.gyp', '--depth=.', '-G', | 180 call(['python', 'gyp.py', 'foo.gyp', '--depth=.', '-G', |
| 181 'output_dir=out_dir'], | 181 'output_dir=out_dir'], |
| 182 cwd='src_dir', | 182 cwd='src_dir', |
| 183 env={ | 183 env={ |
| 184 'GYP_CROSSCOMPILE': '1', |
| 184 'GYP_GENERATORS': 'ninja', | 185 'GYP_GENERATORS': 'ninja', |
| 185 'GYP_DEFINES': 'target_arch=arm armv7=1 arm_thumb=0 arm_neon=1' | 186 'GYP_DEFINES': 'target_arch=arm arm_float_abi=hard', |
| 186 ' arm_float_abi=hard nacl_enable_arm_gcc=1', | |
| 187 'CC': 'arm-linux-gnueabihf-gcc', | |
| 188 'CXX': 'arm-linux-gnueabihf-g++', | |
| 189 'AR': 'arm-linux-gnueabihf-ar', | |
| 190 'AS': 'arm-linux-gnueabihf-as', | |
| 191 'CC_host': 'cc', | |
| 192 'CXX_host': 'c++', | |
| 193 }), | 187 }), |
| 194 call(['ninja', '-C', 'out_dir/Release', 'target'], cwd='src_dir') | 188 call(['ninja', '-C', 'out_dir/Release', 'target'], cwd='src_dir') |
| 195 ]) | 189 ]) |
| 196 | 190 |
| 197 def testNoArmTrusted(self): | 191 def testNoArmTrusted(self): |
| 198 build_artifacts.PLATFORM = 'linux' | 192 build_artifacts.PLATFORM = 'linux' |
| 199 self.options_mock.no_arm_trusted = True | 193 self.options_mock.no_arm_trusted = True |
| 200 build_artifacts.GypNinjaBuild( | 194 build_artifacts.GypNinjaBuild( |
| 201 'arm', 'gyp.py', 'foo.gyp', 'target', 'out_dir') | 195 'arm', 'gyp.py', 'foo.gyp', 'target', 'out_dir') |
| 202 self.run_mock.assert_has_calls([ | 196 self.run_mock.assert_has_calls([ |
| 203 call(['python', 'gyp.py', 'foo.gyp', '--depth=.', '-G', | 197 call(['python', 'gyp.py', 'foo.gyp', '--depth=.', '-G', |
| 204 'output_dir=out_dir'], | 198 'output_dir=out_dir'], |
| 205 cwd='src_dir', | 199 cwd='src_dir', |
| 206 env={ | 200 env={ |
| 201 'GYP_CROSSCOMPILE': '1', |
| 207 'GYP_GENERATORS': 'ninja', | 202 'GYP_GENERATORS': 'ninja', |
| 208 'GYP_DEFINES': 'target_arch=arm armv7=1 arm_thumb=0 arm_neon=1' | 203 'GYP_DEFINES': 'target_arch=arm arm_float_abi=hard ' |
| 209 ' arm_float_abi=hard nacl_enable_arm_gcc=1' | 204 'disable_cross_trusted=1', |
| 210 ' disable_cross_trusted=1', | |
| 211 'CC': 'arm-linux-gnueabihf-gcc', | |
| 212 'CXX': 'arm-linux-gnueabihf-g++', | |
| 213 'AR': 'arm-linux-gnueabihf-ar', | |
| 214 'AS': 'arm-linux-gnueabihf-as', | |
| 215 'CC_host': 'cc', | |
| 216 'CXX_host': 'c++', | |
| 217 }), | 205 }), |
| 218 call(['ninja', '-C', 'out_dir/Release', 'target'], cwd='src_dir') | 206 call(['ninja', '-C', 'out_dir/Release', 'target'], cwd='src_dir') |
| 219 ]) | 207 ]) |
| 220 | 208 |
| 221 | 209 |
| 222 class ArchivePosixTestCase(BasePosixTestCase): | 210 class ArchivePosixTestCase(BasePosixTestCase): |
| 223 def setUp(self): | 211 def setUp(self): |
| 224 BasePosixTestCase.setUp(self) | 212 BasePosixTestCase.setUp(self) |
| 225 self.makedir_mock = patch('buildbot_common.MakeDir').start() | 213 self.makedir_mock = patch('buildbot_common.MakeDir').start() |
| 226 self.copyfile_mock = patch('buildbot_common.CopyFile').start() | 214 self.copyfile_mock = patch('buildbot_common.CopyFile').start() |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 archive = build_artifacts.Archive('foo') | 288 archive = build_artifacts.Archive('foo') |
| 301 self.assertEqual(archive.name, 'win_foo') | 289 self.assertEqual(archive.name, 'win_foo') |
| 302 self.assertEqual(archive.archive_name, 'win_foo.tar.bz2') | 290 self.assertEqual(archive.archive_name, 'win_foo.tar.bz2') |
| 303 self.assertEqual(archive.archive_path, r'c:\archive_dir\win_foo.tar.bz2') | 291 self.assertEqual(archive.archive_path, r'c:\archive_dir\win_foo.tar.bz2') |
| 304 self.assertEqual(archive.dirname, r'c:\archive_dir\win_foo') | 292 self.assertEqual(archive.dirname, r'c:\archive_dir\win_foo') |
| 305 makedir_mock.assert_called_once_with(r'c:\archive_dir\win_foo') | 293 makedir_mock.assert_called_once_with(r'c:\archive_dir\win_foo') |
| 306 | 294 |
| 307 | 295 |
| 308 if __name__ == '__main__': | 296 if __name__ == '__main__': |
| 309 unittest.main() | 297 unittest.main() |
| OLD | NEW |