def ResolveTombstones(device, resolve_all_tombstones, include_stack_symbols,
                      wipe_tombstones, jobs=4,
                      apk_under_test=None, enable_relocation_packing=None,
                      tombstone_symbolizer=None):
  """Resolve tombstones in the device.

  Args:
    device: An instance of DeviceUtils.
    resolve_all_tombstone: Whether to resolve every tombstone.
    include_stack_symbols: Whether to include symbols for stack data.
    wipe_tombstones: Whether to wipe tombstones.
    jobs: Number of jobs to use when processing multiple crash stacks.

  Returns:
    A list of resolved tombstones.
  """
  return _ResolveTombstones(jobs,
                            _GetTombstonesForDevice(device,
                                                    resolve_all_tombstones,
                                                    include_stack_symbols,
                                                    wipe_tombstones),
                            (tombstone_symbolizer
                             or stack_symbolizer.Symbolizer(
                                apk_under_test,
                                enable_relocation_packing)))
    def _initializeLogAttributes(self, args):
        self._enable_java_deobfuscation = args.enable_java_deobfuscation
        self._store_tombstones = args.store_tombstones
        self._symbolizer = stack_symbolizer.Symbolizer(
            self.apk_under_test.path if self.apk_under_test else None,
            args.enable_relocation_packing)

        self._gs_results_bucket = args.gs_results_bucket
        self._should_save_logcat = bool(args.json_results_file)
Esempio n. 3
0
 def _initializeLogAttributes(self, args):
   self._enable_java_deobfuscation = args.enable_java_deobfuscation
   self._store_tombstones = args.store_tombstones
   self._symbolizer = stack_symbolizer.Symbolizer(
       self.apk_under_test.path if self.apk_under_test else None)
Esempio n. 4
0
    def __init__(self, args, data_deps_delegate, error_func):
        super(GtestTestInstance, self).__init__()
        # TODO(jbudorick): Support multiple test suites.
        if len(args.suite_name) > 1:
            raise ValueError(
                'Platform mode currently supports only 1 gtest suite')
        self._coverage_dir = args.coverage_dir
        self._exe_dist_dir = None
        self._external_shard_index = args.test_launcher_shard_index
        self._extract_test_list_from_filter = args.extract_test_list_from_filter
        self._filter_tests_lock = threading.Lock()
        self._gs_test_artifacts_bucket = args.gs_test_artifacts_bucket
        self._isolated_script_test_output = args.isolated_script_test_output
        self._isolated_script_test_perf_output = (
            args.isolated_script_test_perf_output)
        self._render_test_output_dir = args.render_test_output_dir
        self._shard_timeout = args.shard_timeout
        self._store_tombstones = args.store_tombstones
        self._suite = args.suite_name[0]
        self._symbolizer = stack_symbolizer.Symbolizer(None)
        self._total_external_shards = args.test_launcher_total_shards
        self._wait_for_java_debugger = args.wait_for_java_debugger

        # GYP:
        if args.executable_dist_dir:
            self._exe_dist_dir = os.path.abspath(args.executable_dist_dir)
        else:
            # TODO(agrieve): Remove auto-detection once recipes pass flag explicitly.
            exe_dist_dir = os.path.join(constants.GetOutDirectory(),
                                        '%s__dist' % self._suite)

            if os.path.exists(exe_dist_dir):
                self._exe_dist_dir = exe_dist_dir

        incremental_part = ''
        if args.test_apk_incremental_install_json:
            incremental_part = '_incremental'

        self._test_launcher_batch_limit = MAX_SHARDS
        if (args.test_launcher_batch_limit
                and 0 < args.test_launcher_batch_limit < MAX_SHARDS):
            self._test_launcher_batch_limit = args.test_launcher_batch_limit

        apk_path = os.path.join(
            constants.GetOutDirectory(), '%s_apk' % self._suite,
            '%s-debug%s.apk' % (self._suite, incremental_part))
        self._test_apk_incremental_install_json = (
            args.test_apk_incremental_install_json)
        if not os.path.exists(apk_path):
            self._apk_helper = None
        else:
            self._apk_helper = apk_helper.ApkHelper(apk_path)
            self._extras = {
                _EXTRA_NATIVE_TEST_ACTIVITY:
                self._apk_helper.GetActivityName(),
            }
            if self._suite in RUN_IN_SUB_THREAD_TEST_SUITES:
                self._extras[_EXTRA_RUN_IN_SUB_THREAD] = 1
            if self._suite in BROWSER_TEST_SUITES:
                self._extras[_EXTRA_SHARD_SIZE_LIMIT] = 1
                self._extras[EXTRA_SHARD_NANO_TIMEOUT] = int(
                    1e9 * self._shard_timeout)
                self._shard_timeout = 10 * self._shard_timeout
            if args.wait_for_java_debugger:
                self._extras[EXTRA_SHARD_NANO_TIMEOUT] = int(1e15)  # Forever

        if not self._apk_helper and not self._exe_dist_dir:
            error_func('Could not find apk or executable for %s' % self._suite)

        self._data_deps = []
        self._gtest_filter = test_filter.InitializeFilterFromArgs(args)
        self._run_disabled = args.run_disabled

        self._data_deps_delegate = data_deps_delegate
        self._runtime_deps_path = args.runtime_deps_path
        if not self._runtime_deps_path:
            logging.warning('No data dependencies will be pushed.')

        if args.app_data_files:
            self._app_data_files = args.app_data_files
            if args.app_data_file_dir:
                self._app_data_file_dir = args.app_data_file_dir
            else:
                self._app_data_file_dir = tempfile.mkdtemp()
                logging.critical('Saving app files to %s',
                                 self._app_data_file_dir)
        else:
            self._app_data_files = None
            self._app_data_file_dir = None

        self._flags = None
        self._initializeCommandLineFlags(args)

        # TODO(jbudorick): Remove this once it's deployed.
        self._enable_xml_result_parsing = args.enable_xml_result_parsing
Esempio n. 5
0
 def _initializeTombstonesAttributes(self, args):
     self._store_tombstones = args.store_tombstones
     self._symbolizer = stack_symbolizer.Symbolizer(
         self.apk_under_test.path if self.apk_under_test else None,
         args.enable_relocation_packing)
Esempio n. 6
0
 def _initializeLogAttributes(self, args):
     self._enable_breakpad_dump = args.enable_breakpad_dump
     self._proguard_mapping_path = args.proguard_mapping_path
     self._store_tombstones = args.store_tombstones
     self._symbolizer = stack_symbolizer.Symbolizer(
         self.apk_under_test.path if self.apk_under_test else None)