OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 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 """Contains test runners for launching tests on simulators and devices.""" | 6 """Contains test runners for launching tests on simulators and devices.""" |
7 | 7 |
8 # pylint: disable=relative-import | 8 # pylint: disable=relative-import |
9 import environment_setup | 9 import environment_setup |
10 | 10 |
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1268 | 1268 |
1269 Returns: | 1269 Returns: |
1270 A list whose elements are the args representing the command. | 1270 A list whose elements are the args representing the command. |
1271 """ | 1271 """ |
1272 built_dir = os.path.split(self.app_path)[0] | 1272 built_dir = os.path.split(self.app_path)[0] |
1273 | 1273 |
1274 app_path = os.path.join(built_dir, self.test_host_name + '.app/') | 1274 app_path = os.path.join(built_dir, self.test_host_name + '.app/') |
1275 xctests_fullname = self.test_target_name + '.xctest' | 1275 xctests_fullname = self.test_target_name + '.xctest' |
1276 xctest_path = os.path.join(app_path, 'PlugIns', xctests_fullname) | 1276 xctest_path = os.path.join(app_path, 'PlugIns', xctests_fullname) |
1277 | 1277 |
1278 cmd = [ | 1278 if self.xcode_version == '8.0': |
baxley
2016/08/15 18:17:34
How long do we expect this to be in place?
If the
smut
2016/08/15 18:57:52
Ideally we should remove it when Xcode 8 is used b
| |
1279 os.path.join(built_dir, 'iossim'), | 1279 cmd = [ |
1280 '-d', self.platform, | 1280 os.path.join(built_dir, 'iossim'), |
1281 '-s', self.version, | 1281 '-d', self.platform, |
1282 app_path, | 1282 '-s', self.version, |
1283 xctest_path | 1283 app_path, |
1284 ] | 1284 xctest_path |
1285 ] | |
1286 else: | |
1287 cmd = [ | |
1288 'xcodebuild', 'test-without-building', | |
1289 'BUILT_PRODUCTS_DIR=%s' % built_dir, | |
1290 '-project', self.test_project_dir, | |
1291 '-scheme','TestProject', | |
1292 '-destination','platform=iOS Simulator,name=%s,OS=%s' | |
1293 % (self.platform, self.version), | |
1294 '-archivePath', self.homedir, | |
1295 'APP_TARGET_NAME=%s' % self.test_host_name, | |
1296 'TEST_TARGET_NAME=%s' % self.test_target_name, | |
1297 'NSUnbufferedIO=YES' | |
1298 ] | |
1299 | |
1285 return cmd | 1300 return cmd |
1286 | 1301 |
1287 @TestRunner.RequireTearDown | 1302 @TestRunner.RequireTearDown |
1288 def Launch(self, *args, **kwargs): | 1303 def Launch(self, *args, **kwargs): |
1289 """Launches the test.""" | 1304 """Launches the test.""" |
1290 self.SetUp() | 1305 self.SetUp() |
1291 | 1306 |
1292 result = self._Run( | 1307 result = self._Run( |
1293 self.GetLaunchCommand(), self.GetLaunchEnvironment(), *args, **kwargs) | 1308 self.GetLaunchCommand(), self.GetLaunchEnvironment(), *args, **kwargs) |
1294 | 1309 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1464 ) | 1479 ) |
1465 | 1480 |
1466 # Uninstall and re-install the app. | 1481 # Uninstall and re-install the app. |
1467 self.UninstallApp() | 1482 self.UninstallApp() |
1468 self.InstallApp() | 1483 self.InstallApp() |
1469 | 1484 |
1470 result = self._Run( | 1485 result = self._Run( |
1471 self.GetLaunchCommand(), self.GetLaunchEnvironment(), *args, **kwargs) | 1486 self.GetLaunchCommand(), self.GetLaunchEnvironment(), *args, **kwargs) |
1472 | 1487 |
1473 return self.RunAllTests(result, *args, **kwargs) | 1488 return self.RunAllTests(result, *args, **kwargs) |
OLD | NEW |