Example #1
0
def main(argv):
  option_parser = run_tests_helper.CreateTestRunnerOptionParser(None,
      default_timeout=0)
  option_parser.add_option('-s', dest='test_suite',
                           help='Executable name of the test suite to run '
                           '(use -s help to list them)')
  option_parser.add_option('-r', dest='rebaseline',
                           help='Rebaseline and update *testsuite_disabled',
                           action='store_true',
                           default=False)
  option_parser.add_option('-f', dest='gtest_filter',
                           help='gtest filter')
  option_parser.add_option('-a', '--test_arguments', dest='test_arguments',
                           help='Additional arguments to pass to the test')
  option_parser.add_option('-p', dest='performance_test',
                           help='Indicator of performance test',
                           action='store_true',
                           default=False)
  option_parser.add_option('-L', dest='log_dump',
                           help='file name of log dump, which will be put in'
                           'subfolder debug_info_dumps under the same directory'
                           'in where the test_suite exists.')
  option_parser.add_option('-e', '--emulator', dest='use_emulator',
                           help='Run tests in a new instance of emulator',
                           action='store_true',
                           default=False)
  options, args = option_parser.parse_args(argv)
  if len(args) > 1:
    print 'Unknown argument:', args[1:]
    option_parser.print_usage()
    sys.exit(1)
  run_tests_helper.SetLogLevel(options.verbose_count)
  return Dispatch(options)
Example #2
0
def main(argv):
  option_parser = run_tests_helper.CreateTestRunnerOptionParser(None,
      default_timeout=0)
  option_parser.add_option('-s', '--suite', dest='test_suite',
                           help='Executable name of the test suite to run '
                           '(use -s help to list them)')
  option_parser.add_option('-r', dest='rebaseline',
                           help='Rebaseline and update *testsuite_disabled',
                           action='store_true',
                           default=False)
  option_parser.add_option('-f', '--gtest_filter', dest='gtest_filter',
                           help='gtest filter')
  option_parser.add_option('-a', '--test_arguments', dest='test_arguments',
                           help='Additional arguments to pass to the test')
  option_parser.add_option('-p', dest='performance_test',
                           help='Indicator of performance test',
                           action='store_true',
                           default=False)
  option_parser.add_option('-L', dest='log_dump',
                           help='file name of log dump, which will be put in'
                           'subfolder debug_info_dumps under the same directory'
                           'in where the test_suite exists.')
  option_parser.add_option('-e', '--emulator', dest='use_emulator',
                           help='Run tests in a new instance of emulator',
                           type='int',
                           default=0)
  option_parser.add_option('-x', '--xvfb', dest='use_xvfb',
                           action='store_true', default=False,
                           help='Use Xvfb around tests (ignored if not Linux)')
  option_parser.add_option('--fast', '--fast_and_loose', dest='fast_and_loose',
                           action='store_true', default=False,
                           help='Go faster (but be less stable), '
                           'for quick testing.  Example: when tracking down '
                           'tests that hang to add to the disabled list, '
                           'there is no need to redeploy the test binary '
                           'or data to the device again.  '
                           'Don\'t use on bots by default!')
  option_parser.add_option('--repeat', dest='repeat', type='int',
                           default=2,
                           help='Repeat count on test timeout')
  option_parser.add_option('--annotate', default=True,
                           help='Print buildbot-style annotate messages '
                           'for each test suite.  Default=True')
  option_parser.add_option('--apk', default=False,
                           help='Use the apk test runner '
                           '(off by default for now)')
  options, args = option_parser.parse_args(argv)
  if len(args) > 1:
    print 'Unknown argument:', args[1:]
    option_parser.print_usage()
    sys.exit(1)
  run_tests_helper.SetLogLevel(options.verbose_count)
  return Dispatch(options)
Example #3
0
def main(argv):
    option_parser = run_tests_helper.CreateTestRunnerOptionParser(
        None, default_timeout=0)
    option_parser.add_option('-s',
                             '--suite',
                             dest='test_suite',
                             help='Executable name of the test suite to run '
                             '(use -s help to list them)')
    option_parser.add_option('-r',
                             dest='rebaseline',
                             help='Rebaseline and update *testsuite_disabled',
                             action='store_true',
                             default=False)
    option_parser.add_option('-f',
                             '--gtest_filter',
                             dest='gtest_filter',
                             help='gtest filter')
    option_parser.add_option('-a',
                             '--test_arguments',
                             dest='test_arguments',
                             help='Additional arguments to pass to the test')
    option_parser.add_option('-p',
                             dest='performance_test',
                             help='Indicator of performance test',
                             action='store_true',
                             default=False)
    option_parser.add_option(
        '-L',
        dest='log_dump',
        help='file name of log dump, which will be put in'
        'subfolder debug_info_dumps under the same directory'
        'in where the test_suite exists.')
    option_parser.add_option('-e',
                             '--emulator',
                             dest='use_emulator',
                             help='Run tests in a new instance of emulator',
                             type='int',
                             default=0)
    option_parser.add_option(
        '-x',
        '--xvfb',
        dest='use_xvfb',
        action='store_true',
        default=False,
        help='Use Xvfb around tests (ignored if not Linux)')
    option_parser.add_option('--fast',
                             '--fast_and_loose',
                             dest='fast_and_loose',
                             action='store_true',
                             default=False,
                             help='Go faster (but be less stable), '
                             'for quick testing.  Example: when tracking down '
                             'tests that hang to add to the disabled list, '
                             'there is no need to redeploy the test binary '
                             'or data to the device again.  '
                             'Don\'t use on bots by default!')
    option_parser.add_option('--repeat',
                             dest='repeat',
                             type='int',
                             default=2,
                             help='Repeat count on test timeout')
    option_parser.add_option('--annotate',
                             default=True,
                             help='Print buildbot-style annotate messages '
                             'for each test suite.  Default=True')
    option_parser.add_option('--apk',
                             default=False,
                             help='Use the apk test runner '
                             '(off by default for now)')
    options, args = option_parser.parse_args(argv)
    if len(args) > 1:
        print 'Unknown argument:', args[1:]
        option_parser.print_usage()
        sys.exit(1)
    run_tests_helper.SetLogLevel(options.verbose_count)
    failed_tests_count = Dispatch(options)

    # If we're printing annotations then failures of individual test suites are
    # communicated by printing a STEP_FAILURE message.
    # Returning a success exit status also prevents the buildbot from incorrectly
    # marking the last suite as failed if there were failures in other suites in
    # the batch (this happens because the exit status is a sum of all failures
    # from all suites, but the buildbot associates the exit status only with the
    # most recent step).
    if options.annotate:
        return 0
    else:
        return failed_tests_count