def run():
    root_logger.setLevel(logging.DEBUG)
    global console_handler
    console_handler = logging.StreamHandler()
    console_handler.setLevel(logging.INFO)
    console_handler.setFormatter(logging.Formatter('%(message)s'))
    root_logger.addHandler(console_handler)
    try:
        with open('tests.json') as file:
            json = load(file)
    except __HOLE__ as e:
        logging.critical(e)
        sys.exit(2)

    run_only = json.get('run-only')

    failed = ran = 0
    for test_name, params in json.get('tests', {}).iteritems():
        if run_only and test_name not in run_only:
            continue
        if not params.get('disabled', False):
            ran += 1
            if not run_test(json['basepath'], json['plots'], test_name, params):
                failed += 1
            logging.info('')
        else:
            logging.warn('Test "{0}" disabled'.format(test_name))

    for test_name, params in json.get('wavs', {}).iteritems():
        ran += 1
        if not run_wav_test(test_name, os.path.join(json['basepath'], params['file']), params):
            failed += 1
        logging.info('')
    logging.info('Ran {0} tests, {1} failed'.format(ran, failed))
dataset/ETHPy150Open tp7/Sushi/regression-tests.py/run