예제 #1
0
def setupProject(project):
    orig_filename = project.application().getInputFilename("OGG/Vorbis file")
    mangle = OggMangle(project, orig_filename)
    if not INCR_MANGLE:
        mangle.hard_min_op = 1
        mangle.hard_max_op = 100
    else:
        from fusil.incr_mangle_op import InverseBit, Increment
        mangle.operations = (InverseBit, Increment)
    mangle.max_filesize = FILESIZE

    process = OggProcess(project, COMMAND, timeout=60.0)
    process.env.copy('HOME')

    if COMMAND[0] == 'ogg123':
        WatchProcess(process, exitcode_score=-0.25)
    else:
        WatchProcess(process, exitcode_score=0)
    stdout = WatchStdout(process)
    if True:
    #    stdout.max_nb_line = (5000, 1.0)
        stdout.show_matching = True
        stdout.show_not_matching = True
        stdout.addRegex(r"The file may be corrupted", -0.50)
        stdout.addRegex(r"Corrupted ogg", -0.50)
        stdout.addRegex(r"Could not decode vorbis header packet", -0.50)
    #    stdout.ignoreRegex('^Warning: Could not decode vorbis header packet')
        stdout.ignoreRegex('^Warning: sequence number gap')
        stdout.ignoreRegex('^New logical stream.*: type invalid$')
예제 #2
0
def setupProject(project):
    for filename in FILENAMES:
        if path_exists(filename):
            continue
        raise ValueError("File doesn't exist: %s! Fix FILENAMES constant" % filename)

    module_name = project.application().getInputFilename('Module name (use "ALL" to test all modules)')

    project.error("Use python interpreter: %s" % PYTHON)
    project.error("Use filenames: %s" % ', '.join(FILENAMES))

    source = PythonSource(project, module_name)
    process = PythonProcess(project, [PYTHON, '-u', '<source.py>'], timeout=10.0, stdin='null')
    WatchProcess(process, exitcode_score=0)

    stdout = WatchStdout(process)
    stdout.max_nb_line = (1000, 1.0)

    # Disable dummy error messages
    stdout.words = {
        'oops': 0.30,
        'bug': 0.30,
        'memory': 0.40,
        'overflow': 0.40,
        'fatal': 1.0,
        'assert': 1.0,
        'assertion': 1.0,
        'critical': 1.0,
        'panic': 1.0,
        'glibc detected': 1.0,
        'segfault': 1.0,
        'segmentation fault': 1.0,
    }

    # PyPy messages
    stdout.addRegex("Fatal RPython error", 1.0)

    if DEBUG:
        stdout.show_matching = True
        stdout.show_not_matching = True