| 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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 | 668 |
| 669 Returns: | 669 Returns: |
| 670 A dict of environment variables. | 670 A dict of environment variables. |
| 671 """ | 671 """ |
| 672 env = super(DeviceTestRunner, self).get_launch_env() | 672 env = super(DeviceTestRunner, self).get_launch_env() |
| 673 if self.xctest_path: | 673 if self.xctest_path: |
| 674 env['NSUnbufferedIO'] = 'YES' | 674 env['NSUnbufferedIO'] = 'YES' |
| 675 # e.g. ios_web_shell_egtests | 675 # e.g. ios_web_shell_egtests |
| 676 env['APP_TARGET_NAME'] = os.path.splitext( | 676 env['APP_TARGET_NAME'] = os.path.splitext( |
| 677 os.path.basename(self.app_path))[0] | 677 os.path.basename(self.app_path))[0] |
| 678 | |
| 679 # Two convention for the test name have been in use. Old convention was to | |
| 680 # use the host name without _host suffix while the new convention is to | |
| 681 # use host name with _module suffix. As new convention does not use _host | |
| 682 # suffix its presence can be used to determine correct name for the test | |
| 683 # target. TODO(crbug.com/662404): remove once only new convention is used. | |
| 684 # e.g. ios_web_shell_egtests_module | 678 # e.g. ios_web_shell_egtests_module |
| 685 if env['APP_TARGET_NAME'].endswith('_host'): | 679 env['TEST_TARGET_NAME'] = env['APP_TARGET_NAME'] + '_module' |
| 686 env['TEST_TARGET_NAME'] = env['APP_TARGET_NAME'].rsplit('_', 1)[0] | |
| 687 else: | |
| 688 env['TEST_TARGET_NAME'] = env['APP_TARGET_NAME'] + '_module' | |
| 689 return env | 680 return env |
| OLD | NEW |