Run timed_main across all selected archs and emulators. :return: if any of the timed_mains exits non-zero and non-null, return that. Otherwise, return 0.
(self, *args, **kwargs)
| 844 | sys.stdout.flush() |
| 845 | |
| 846 | def main(self, *args, **kwargs): |
| 847 | ''' |
| 848 | Run timed_main across all selected archs and emulators. |
| 849 | |
| 850 | :return: if any of the timed_mains exits non-zero and non-null, |
| 851 | return that. Otherwise, return 0. |
| 852 | ''' |
| 853 | env = kwargs.copy() |
| 854 | self.input_args = env.copy() |
| 855 | env.update(consts) |
| 856 | real_all_archs = env['all_archs'] |
| 857 | if real_all_archs: |
| 858 | real_archs = consts['all_long_archs'] |
| 859 | else: |
| 860 | real_archs = env['archs'] |
| 861 | if env['all_emulators']: |
| 862 | real_emulators = consts['all_long_emulators'] |
| 863 | else: |
| 864 | real_emulators = env['emulators'] |
| 865 | return_value = 0 |
| 866 | class GetOutOfLoop(Exception): pass |
| 867 | try: |
| 868 | ret = self.setup() |
| 869 | if ret is not None and ret != 0: |
| 870 | return_value = ret |
| 871 | raise GetOutOfLoop() |
| 872 | for emulator in real_emulators: |
| 873 | for arch in real_archs: |
| 874 | if arch in env['arch_short_to_long_dict']: |
| 875 | arch = env['arch_short_to_long_dict'][arch] |
| 876 | if self.is_arch_supported(arch): |
| 877 | if not env['dry_run']: |
| 878 | start_time = time.time() |
| 879 | env['arch'] = arch |
| 880 | env['archs'] = [arch] |
| 881 | env['_args_given']['archs'] = True |
| 882 | env['all_archs'] = False |
| 883 | env['emulator'] = emulator |
| 884 | env['emulators'] = [emulator] |
| 885 | env['_args_given']['emulators'] = True |
| 886 | env['all_emulators'] = False |
| 887 | self.env = env.copy() |
| 888 | self._init_env(self.env) |
| 889 | self.sh = shell_helpers.ShellHelpers( |
| 890 | dry_run=self.env['dry_run'], |
| 891 | quiet=self.env['quiet'], |
| 892 | ) |
| 893 | ret = self.timed_main() |
| 894 | if not env['dry_run']: |
| 895 | end_time = time.time() |
| 896 | self.ellapsed_seconds = end_time - start_time |
| 897 | self.print_time(self.ellapsed_seconds) |
| 898 | if ret is not None and ret != 0: |
| 899 | return_value = ret |
| 900 | if self.env['quit_on_fail']: |
| 901 | raise GetOutOfLoop() |
| 902 | elif not real_all_archs: |
| 903 | raise Exception('Unsupported arch for this action: ' + arch) |
nothing calls this directly
no test coverage detected