| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import copy | 5 import copy |
| 6 | 6 |
| 7 from recipe_engine import recipe_api | 7 from recipe_engine import recipe_api |
| 8 | 8 |
| 9 | 9 |
| 10 class iOSApi(recipe_api.RecipeApi): | 10 class iOSApi(recipe_api.RecipeApi): |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 *args: Any additional arguments to pass to the test harness. | 384 *args: Any additional arguments to pass to the test harness. |
| 385 """ | 385 """ |
| 386 assert self.__config is not None | 386 assert self.__config is not None |
| 387 test_failures = [] | 387 test_failures = [] |
| 388 infrastructure_failures = [] | 388 infrastructure_failures = [] |
| 389 | 389 |
| 390 for test in self.__config['tests']: | 390 for test in self.__config['tests']: |
| 391 cmd = [ | 391 cmd = [ |
| 392 self.package_repo_resource( | 392 self.package_repo_resource( |
| 393 'scripts', 'slave', 'ios', 'run.py'), | 393 'scripts', 'slave', 'ios', 'run.py'), |
| 394 '--app', self.m.path.join( | 394 '--app', self.m.path['slave_build'].join( |
| 395 self.most_recent_app_dir, | 395 self.most_recent_app_dir, |
| 396 '%s.app' % test['app'], | 396 '%s.app' % test['app'], |
| 397 ), | 397 ), |
| 398 '--json_file', self.m.json.output(), | 398 '--json_file', self.m.json.output(), |
| 399 ] | 399 ] |
| 400 if test.get('xctest'): | 400 if test.get('xctest'): |
| 401 cmd.extend([ | 401 cmd.extend([ |
| 402 '--test-host', test['app'], | 402 '--test-host', test['app'], |
| 403 '--dummyproj', self.package_repo_resource( | 403 '--dummyproj', self.package_repo_resource( |
| 404 'scripts', 'slave', 'ios', 'TestProject', 'TestProject.xcodeproj'), | 404 'scripts', 'slave', 'ios', 'TestProject', 'TestProject.xcodeproj'), |
| 405 ]) | 405 ]) |
| 406 | 406 |
| 407 step_name = test['app'] | 407 step_name = test['app'] |
| 408 | 408 |
| 409 if self.platform == 'simulator': | 409 if self.platform == 'simulator': |
| 410 cmd.extend([ | 410 cmd.extend([ |
| 411 '--iossim', self.most_recent_iossim, | 411 '--iossim', self.m.path['slave_build'].join(self.most_recent_iossim), |
| 412 '--platform', test['device type'], | 412 '--platform', test['device type'], |
| 413 '--version', test['os'], | 413 '--version', test['os'], |
| 414 ]) | 414 ]) |
| 415 | 415 |
| 416 # Since we may be running simulator tests on multiple platforms, | 416 # Since we may be running simulator tests on multiple platforms, |
| 417 # include the platform and OS in the name of the step. | 417 # include the platform and OS in the name of the step. |
| 418 step_name = '%s (%s iOS %s)' % ( | 418 step_name = '%s (%s iOS %s)' % ( |
| 419 test['app'], | 419 test['app'], |
| 420 test['device type'], | 420 test['device type'], |
| 421 test['os'], | 421 test['os'], |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 '--out-dir', '${ISOLATED_OUTDIR}', | 500 '--out-dir', '${ISOLATED_OUTDIR}', |
| 501 '--xcode-version', '<(xcode_version)', | 501 '--xcode-version', '<(xcode_version)', |
| 502 ] | 502 ] |
| 503 files = [ | 503 files = [ |
| 504 # .apps are directories. Need the trailing slash to isolate the | 504 # .apps are directories. Need the trailing slash to isolate the |
| 505 # contents of a directory. | 505 # contents of a directory. |
| 506 '<(app_path)/', | 506 '<(app_path)/', |
| 507 'src/ios/build/bots/scripts/', | 507 'src/ios/build/bots/scripts/', |
| 508 ] | 508 ] |
| 509 if self.platform == 'simulator': | 509 if self.platform == 'simulator': |
| 510 iossim = self.most_recent_iossim | 510 iossim = self.m.path.join(self.most_recent_iossim) |
| 511 cmd.extend([ | 511 cmd.extend([ |
| 512 '--iossim', iossim, | 512 '--iossim', iossim, |
| 513 '--platform', '<(platform)', | 513 '--platform', '<(platform)', |
| 514 '--version', '<(version)', | 514 '--version', '<(version)', |
| 515 ]) | 515 ]) |
| 516 files.append(iossim) | 516 files.append(iossim) |
| 517 isolate_template_contents = { | 517 isolate_template_contents = { |
| 518 'conditions': [ | 518 'conditions': [ |
| 519 ['OS == "ios"', { | 519 ['OS == "ios"', { |
| 520 'variables': { | 520 'variables': { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 build_dir = { | 718 build_dir = { |
| 719 'xcodebuild': 'xcodebuild', | 719 'xcodebuild': 'xcodebuild', |
| 720 'ninja': 'out', | 720 'ninja': 'out', |
| 721 }[self.compiler] | 721 }[self.compiler] |
| 722 | 722 |
| 723 platform = { | 723 platform = { |
| 724 'device': 'iphoneos', | 724 'device': 'iphoneos', |
| 725 'simulator': 'iphonesimulator', | 725 'simulator': 'iphonesimulator', |
| 726 }[self.platform] | 726 }[self.platform] |
| 727 | 727 |
| 728 return self.m.path['checkout'].join( | 728 return self.m.path.join( |
| 729 'src', |
| 729 build_dir, | 730 build_dir, |
| 730 '%s-%s' % (self.configuration, platform), | 731 '%s-%s' % (self.configuration, platform), |
| 731 ) | 732 ) |
| 732 | 733 |
| 733 @property | 734 @property |
| 734 def most_recent_iossim(self): | 735 def most_recent_iossim(self): |
| 735 """Returns the path to the most recently compiled iossim.""" | 736 """Returns the path to the most recently compiled iossim.""" |
| 736 build_dir = { | 737 build_dir = { |
| 737 'xcodebuild': self.m.path.join('xcodebuild', 'ninja-iossim'), | 738 'xcodebuild': self.m.path.join('xcodebuild', 'ninja-iossim'), |
| 738 'ninja': 'out', | 739 'ninja': 'out', |
| (...skipping 11 matching lines...) Expand all Loading... |
| 750 # out/Debug-iphonesimulator/iossim | 751 # out/Debug-iphonesimulator/iossim |
| 751 # out/Release-iphoneos/iossim | 752 # out/Release-iphoneos/iossim |
| 752 # out/Release-iphonesimulator/iossim | 753 # out/Release-iphonesimulator/iossim |
| 753 | 754 |
| 754 platform = { | 755 platform = { |
| 755 'device': 'iphoneos', | 756 'device': 'iphoneos', |
| 756 'simulator': 'iphonesimulator', | 757 'simulator': 'iphonesimulator', |
| 757 }[self.platform] | 758 }[self.platform] |
| 758 | 759 |
| 759 return { | 760 return { |
| 760 'xcodebuild': self.m.path['checkout'].join( | 761 'xcodebuild': self.m.path.join( |
| 762 'src', |
| 761 build_dir, | 763 build_dir, |
| 762 self.configuration, | 764 self.configuration, |
| 763 'iossim', | 765 'iossim', |
| 764 ), | 766 ), |
| 765 'ninja': self.m.path['checkout'].join( | 767 'ninja': self.m.path.join( |
| 768 'src', |
| 766 build_dir, | 769 build_dir, |
| 767 '%s-%s' % (self.configuration, platform), | 770 '%s-%s' % (self.configuration, platform), |
| 768 'iossim', | 771 'iossim', |
| 769 ), | 772 ), |
| 770 }[self.compiler] | 773 }[self.compiler] |
| OLD | NEW |