tools/code_coverage/run_fuzz_target.py
def _ParseCommandArguments():
  """Adds and parses relevant arguments for tool comands.

  Returns:
    A dictionary representing the arguments.
  """
  arg_parser = argparse.ArgumentParser()

  arg_parser.add_argument(
      '-f',
      '--fuzzer',
      type=str,
      required=True,
      help='Path to the fuzz target executable.')

  arg_parser.add_argument(
      '-o',
      '--output-dir',
      type=str,
      required=True,
      help='Output directory where corpus and coverage dumps can be stored in.')

  arg_parser.add_argument(
      '-t',
      '--timeout',
      type=int,
      required=True,
      help='Timeout value for running a single fuzz target.')

  # Ignored. Used to comply with isolated script contract, see chromium_tests
  # and swarming recipe modules for more details.
  arg_parser.add_argument(
      '--isolated-script-test-output',
      type=str,
      required=False,
      help=argparse.SUPPRESS)

  # Ditto.
  arg_parser.add_argument(
      '--isolated-script-test-perf-output',
      type=str,
      required=False,
      help=argparse.SUPPRESS)

  if len(sys.argv) == 1:
    arg_parser.print_help()
    sys.exit(1)

  args = arg_parser.parse_args()

  assert os.path.isfile(
      args.fuzzer), ("Fuzzer '%s' does not exist." % args.fuzzer)

  assert os.path.isdir(
      args.output_dir), ("Output dir '%s' does not exist." % args.output_dir)

  assert args.timeout > 0, 'Invalid timeout value: %d.' % args.timeout

  return args
Adds and parses relevant arguments for tool comands.

  Returns:
    A dictionary representing the arguments.
  
Adds and parses relevant arguments for tool comands.
Adds and parses relevant arguments for tool comands .
def _ParseCommandArguments():
  arg_parser = argparse.ArgumentParser()
  arg_parser.add_argument(
      '-f',
      '--fuzzer',
      type=str,
      required=True,
      help='Path to the fuzz target executable.')
  arg_parser.add_argument(
      '-o',
      '--output-dir',
      type=str,
      required=True,
      help='Output directory where corpus and coverage dumps can be stored in.')
  arg_parser.add_argument(
      '-t',
      '--timeout',
      type=int,
      required=True,
      help='Timeout value for running a single fuzz target.')
  arg_parser.add_argument(
      '--isolated-script-test-output',
      type=str,
      required=False,
      help=argparse.SUPPRESS)
  arg_parser.add_argument(
      '--isolated-script-test-perf-output',
      type=str,
      required=False,
      help=argparse.SUPPRESS)
  if len(sys.argv) == 1:
    arg_parser.print_help()
    sys.exit(1)
  args = arg_parser.parse_args()
  assert os.path.isfile(
      args.fuzzer), ("Fuzzer '%s' does not exist." % args.fuzzer)
  assert os.path.isdir(
      args.output_dir), ("Output dir '%s' does not exist." % args.output_dir)
  assert args.timeout > 0, 'Invalid timeout value: %d.' % args.timeout
  return args
def _ParseCommandArguments ( ) : arg_parser = argparse . ArgumentParser ( ) arg_parser . add_argument ( '-f' , '--fuzzer' , type = str , required = True , help = 'Path to the fuzz target executable.' ) arg_parser . add_argument ( '-o' , '--output-dir' , type = str , required = True , help = 'Output directory where corpus and coverage dumps can be stored in.' ) arg_parser . add_argument ( '-t' , '--timeout' , type = int , required = True , help = 'Timeout value for running a single fuzz target.' ) arg_parser . add_argument ( '--isolated-script-test-output' , type = str , required = False , help = argparse . SUPPRESS ) arg_parser . add_argument ( '--isolated-script-test-perf-output' , type = str , required = False , help = argparse . SUPPRESS ) if len ( sys . argv ) == 1 : arg_parser . print_help ( ) sys . exit ( 1 ) args = arg_parser . parse_args ( ) assert os . path . isfile ( args . fuzzer ) , ( "Fuzzer '%s' does not exist." % args . fuzzer ) assert os . path . isdir ( args . output_dir ) , ( "Output dir '%s' does not exist." % args . output_dir ) assert args . timeout > 0 , 'Invalid timeout value: %d.' % args . timeout return args
Adds and parses relevant arguments for tool comands.
Adds and parses relevant arguments for tool comands .
"""Adds and parses relevant arguments for tool comands.

  Returns:
    A dictionary representing the arguments.
  """ # Ignored. Used to comply with isolated script contract, see chromium_tests # and swarming recipe modules for more details. # Ditto.
A dictionary representing the arguments.
A dictionary representing the arguments .