tools/code_coverage/coverage.py
def _GetBinaryPath(command):
  """Returns a relative path to the binary to be run by the command.

  Currently, following types of commands are supported (e.g. url_unittests):
  1. Run test binary direcly: "out/coverage/url_unittests <arguments>"
  2. Use xvfb.
    2.1. "python testing/xvfb.py out/coverage/url_unittests <arguments>"
    2.2. "testing/xvfb.py out/coverage/url_unittests <arguments>"
  3. Use iossim to run tests on iOS platform, please refer to testing/iossim.mm
    for its usage.
    3.1. "out/Coverage-iphonesimulator/iossim
          <iossim_arguments> -c <app_arguments>
          out/Coverage-iphonesimulator/url_unittests.app"

  Args:
    command: A command used to run a target.

  Returns:
    A relative path to the binary.
  """
  xvfb_script_name = os.extsep.join(['xvfb', 'py'])

  command_parts = _SplitCommand(command)
  if os.path.basename(command_parts[0]) == 'python':
    assert os.path.basename(command_parts[1]) == xvfb_script_name, (
        'This tool doesn\'t understand the command: "%s".' % command)
    return command_parts[2]

  if os.path.basename(command_parts[0]) == xvfb_script_name:
    return command_parts[1]

  if _IsIOSCommand(command):
    # For a given application bundle, the binary resides in the bundle and has
    # the same name with the application without the .app extension.
    app_path = command_parts[1].rstrip(os.path.sep)
    app_name = os.path.splitext(os.path.basename(app_path))[0]
    return os.path.join(app_path, app_name)

  if coverage_utils.GetHostPlatform() == 'win' \
     and not command_parts[0].endswith('.exe'):
    return command_parts[0] + '.exe'

  return command_parts[0]
Returns a relative path to the binary to be run by the command.

  Currently, following types of commands are supported (e.g. url_unittests):
  1. Run test binary direcly: "out/coverage/url_unittests <arguments>"
  2. Use xvfb.
    2.1. "python testing/xvfb.py out/coverage/url_unittests <arguments>"
    2.2. "testing/xvfb.py out/coverage/url_unittests <arguments>"
  3. Use iossim to run tests on iOS platform, please refer to testing/iossim.mm
    for its usage.
    3.1. "out/Coverage-iphonesimulator/iossim
          <iossim_arguments> -c <app_arguments>
          out/Coverage-iphonesimulator/url_unittests.app"

  Args:
    command: A command used to run a target.

  Returns:
    A relative path to the binary.
  
Returns a relative path to the binary to be run by the command.
Currently, following types of commands are supported :
1. Run test binary direcly: "out/coverage/url_unittests "
2. Use xvfb.
Returns a relative path to the binary to be run by the command . Currently following types of commands are supported : 1 . Run test binary direcly : " out / coverage / url_unittests " 2 . Use xvfb .
def _GetBinaryPath(command):
  xvfb_script_name = os.extsep.join(['xvfb', 'py'])
  command_parts = _SplitCommand(command)
  if os.path.basename(command_parts[0]) == 'python':
    assert os.path.basename(command_parts[1]) == xvfb_script_name, (
        'This tool doesn\'t understand the command: "%s".' % command)
    return command_parts[2]
  if os.path.basename(command_parts[0]) == xvfb_script_name:
    return command_parts[1]
  if _IsIOSCommand(command):
    app_path = command_parts[1].rstrip(os.path.sep)
    app_name = os.path.splitext(os.path.basename(app_path))[0]
    return os.path.join(app_path, app_name)
  if coverage_utils.GetHostPlatform() == 'win' \
     and not command_parts[0].endswith('.exe'):
    return command_parts[0] + '.exe'
  return command_parts[0]
def _GetBinaryPath ( command ) : xvfb_script_name = os . extsep . join ( [ 'xvfb' , 'py' ] ) command_parts = _SplitCommand ( command ) if os . path . basename ( command_parts [ 0 ] ) == 'python' : assert os . path . basename ( command_parts [ 1 ] ) == xvfb_script_name , ( 'This tool doesn\'t understand the command: "%s".' % command ) return command_parts [ 2 ] if os . path . basename ( command_parts [ 0 ] ) == xvfb_script_name : return command_parts [ 1 ] if _IsIOSCommand ( command ) : app_path = command_parts [ 1 ] . rstrip ( os . path . sep ) app_name = os . path . splitext ( os . path . basename ( app_path ) ) [ 0 ] return os . path . join ( app_path , app_name ) if coverage_utils . GetHostPlatform ( ) == 'win' and not command_parts [ 0 ] . endswith ( '.exe' ) : return command_parts [ 0 ] + '.exe' return command_parts [ 0 ]
Returns a relative path to the binary to be run by the command.
Returns a relative path to the binary to be run by the command .
"""Returns a relative path to the binary to be run by the command.

  Currently, following types of commands are supported (e.g. url_unittests):
  1. Run test binary direcly: "out/coverage/url_unittests <arguments>"
  2. Use xvfb.
    2.1. "python testing/xvfb.py out/coverage/url_unittests <arguments>"
    2.2. "testing/xvfb.py out/coverage/url_unittests <arguments>"
  3. Use iossim to run tests on iOS platform, please refer to testing/iossim.mm
    for its usage.
    3.1. "out/Coverage-iphonesimulator/iossim
          <iossim_arguments> -c <app_arguments>
          out/Coverage-iphonesimulator/url_unittests.app"

  Args:
    command: A command used to run a target.

  Returns:
    A relative path to the binary.
  """ # For a given application bundle, the binary resides in the bundle and has # the same name with the application without the .app extension.
A relative path to the binary.
A relative path to the binary .
command
A command used to run a target.
A command used to run a target .