OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 """Test runners for iOS.""" | 5 """Test runners for iOS.""" |
6 | 6 |
7 import argparse | 7 import argparse |
8 import collections | 8 import collections |
9 import errno | 9 import errno |
10 import os | 10 import os |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 | 675 |
676 def get_launch_env(self): | 676 def get_launch_env(self): |
677 """Returns a dict of environment variables to use to launch the test app. | 677 """Returns a dict of environment variables to use to launch the test app. |
678 | 678 |
679 Returns: | 679 Returns: |
680 A dict of environment variables. | 680 A dict of environment variables. |
681 """ | 681 """ |
682 env = super(DeviceTestRunner, self).get_launch_env() | 682 env = super(DeviceTestRunner, self).get_launch_env() |
683 if self.xctest_path: | 683 if self.xctest_path: |
684 env['NSUnbufferedIO'] = 'YES' | 684 env['NSUnbufferedIO'] = 'YES' |
685 # e.g. ios_web_shell_test_host | 685 # e.g. ios_web_shell_egtests |
686 env['APP_TARGET_NAME'] = ( | 686 env['APP_TARGET_NAME'] = os.path.splitext( |
687 os.path.splitext(os.path.basename(self.app_path))[0]) | 687 os.path.basename(self.app_path))[0] |
688 # e.g. ios_web_shell_test | 688 |
689 env['TEST_TARGET_NAME'] = env['APP_TARGET_NAME'].rsplit('_', 1)[0] | 689 # Two convention for the test name have been in use. Old convention was to |
| 690 # use the host name without _host suffix while the new convention is to |
| 691 # use host name with _module suffix. As new convention does not use _host |
| 692 # suffix its presence can be used to determine correct name for the test |
| 693 # target. TODO(crbug.com/662404): remove once only new convention is used. |
| 694 # e.g. ios_web_shell_egtests_module |
| 695 if env['APP_TARGET_NAME'].endswith('_host'): |
| 696 env['TEST_TARGET_NAME'] = env['APP_TARGET_NAME'].rsplit('_', 1)[0] |
| 697 else: |
| 698 env['TEST_TARGET_NAME'] = env['APP_TARGET_NAME'] + '_module' |
690 return env | 699 return env |
OLD | NEW |