Exemplo n.º 1
0
def run_tests(tests, lit_config, opts, discovered_tests):
    workers = min(len(tests), opts.workers)
    display = lit.display.create_display(opts, len(tests), discovered_tests,
                                         workers)

    def progress_callback(test):
        display.update(test)
        if opts.order == 'failing-first':
            touch_file(test)

    run = lit.run.Run(tests, lit_config, workers, progress_callback,
                      opts.max_failures, opts.timeout)

    display.print_header()

    interrupted = False
    error = None
    try:
        execute_in_tmp_dir(run, lit_config)
    except KeyboardInterrupt:
        interrupted = True
        error = '  interrupted by user'
    except lit.run.MaxFailuresError:
        error = 'warning: reached maximum number of test failures'
    except lit.run.TimeoutError:
        error = 'warning: reached timeout'

    display.clear(interrupted)
    if error:
        sys.stderr.write('%s, skipping remaining tests\n' % error)
Exemplo n.º 2
0
def run_tests(tests, litConfig, opts, numTotalTests):
    display = lit.display.create_display(opts, len(tests), numTotalTests,
                                         opts.numWorkers)

    def progress_callback(test):
        display.update(test)
        if opts.order == 'failing-first':
            touch_file(test)

    run = lit.run.create_run(tests, litConfig, opts.numWorkers,
                             progress_callback, opts.timeout)

    display.print_header()
    try:
        execute_in_tmp_dir(run, litConfig)
    except KeyboardInterrupt:
        #TODO(yln): should we attempt to cleanup the progress bar here?
        sys.exit(2)
    # TODO(yln): display.finish_interrupted(), which shows the most recently started test
    # TODO(yln): change display to update when test starts, not when test completes
    # Ensure everything still works with SimpleProgressBar as well
    # finally:
    #     display.clear()

    display.clear()
Exemplo n.º 3
0
def run_tests(tests, lit_config, opts, numTotalTests):
    display = lit.display.create_display(opts, len(tests), numTotalTests,
                                         opts.workers)
    def progress_callback(test):
        display.update(test)
        if opts.order == 'failing-first':
            touch_file(test)

    run = lit.run.create_run(tests, lit_config, opts.workers, progress_callback,
                             opts.max_failures, opts.timeout)

    display.print_header()
    try:
        execute_in_tmp_dir(run, lit_config)
        display.clear(interrupted=False)
    except KeyboardInterrupt:
        display.clear(interrupted=True)
        print(' [interrupted by user]')