# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file.
"""Implements commands for running/interacting with Fuchsia on an emulator."""
class EmuTarget(target.Target): def __init__(self, out_dir, target_cpu, system_log_file): """out_dir: The directory which will contain the files that are
generated to support the emulator deployment.
target_cpu: The emulated target CPU architecture.
Can be 'x64'or'arm64'."""
def _BuildCommand(self): """Build the command that will be run to start Fuchsia in the emulator.""" pass
def _SetEnv(self): return os.environ.copy()
# Used by the context manager to ensure that the emulator is killed when # the Python process exits. def __exit__(self, exc_type, exc_val, exc_tb):
self.Shutdown();
# We pass a separate stdin stream. Sharing stdin across processes # leads to flakiness due to the OS prematurely killing the stream and the # Python script panicking and aborting. # The precise root cause is still nebulous, but this fix works. # See crbug.com/741194.
logging.debug('Launching %s.' % (self.EMULATOR_NAME))
logging.debug(' '.join(emu_command))
# Zircon sends debug logs to serial port (see kernel.serial=legacy flag # above). Serial port is redirected to a file through emulator stdout. # If runner_logs are not enabled, we output the kernel serial log # to a temporary file, and print that out if we are unable to connect to # the emulator guest, to make it easier to diagnose connectivity issues.
temporary_log_file = None if runner_logs.IsEnabled():
stdout = runner_logs.FileStreamFor('serial_log') else:
temporary_log_file = tempfile.NamedTemporaryFile('w')
stdout = temporary_log_file
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.