Пример #1
0
def testBinary(shellPath, args, useValgrind):
    '''Tests the given shell with the given args.'''
    testCmd = (constructVgCmdList() if useValgrind else []) + [shellPath] + args
    sps.vdump('The testing command is: ' + sps.shellify(testCmd))
    out, rCode = sps.captureStdout(testCmd, combineStderr=True, ignoreStderr=True,
                                   ignoreExitCode=True, env=envVars.envWithPath(
                                       os.path.dirname(os.path.abspath(shellPath))))
    sps.vdump('The exit code is: ' + str(rCode))
    return out, rCode
Пример #2
0
def testIsHardFpShellARM(s):
    '''Tests if the ARM shell is compiled with hardfp support.'''
    readelfBin = '/usr/bin/readelf'
    if os.path.exists(readelfBin):
        newEnv = envVars.envWithPath(os.path.dirname(os.path.abspath(s)))
        readelfOutput = sps.captureStdout([readelfBin, '-A', s], env=newEnv)[0]
        return 'Tag_ABI_VFP_args: VFP registers' in readelfOutput
    else:
        raise Exception('readelf is not found.')
Пример #3
0
def testIsHardFpShellARM(s):
    '''Tests if the ARM shell is compiled with hardfp support.'''
    readelfBin = '/usr/bin/readelf'
    if os.path.exists(readelfBin):
        newEnv = envVars.envWithPath(os.path.dirname(os.path.abspath(s)))
        readelfOutput = sps.captureStdout([readelfBin, '-A', s], env=newEnv)[0]
        return 'Tag_ABI_VFP_args: VFP registers' in readelfOutput
    else:
        raise Exception('readelf is not found.')
Пример #4
0
def testBinary(shellPath, args, useValgrind):
    '''Tests the given shell with the given args.'''
    testCmd = (constructVgCmdList() if useValgrind else []) + [shellPath] + args
    sps.vdump('The testing command is: ' + sps.shellify(testCmd))
    out, rCode = sps.captureStdout(testCmd, combineStderr=True, ignoreStderr=True,
                                   ignoreExitCode=True, env=envVars.envWithPath(
                                       os.path.dirname(os.path.abspath(shellPath))))
    sps.vdump('The exit code is: ' + str(rCode))
    return out, rCode
Пример #5
0
def makeEnv(binPath):
    env = envVars.envWithPath(os.path.abspath(os.path.dirname(binPath)))
    if 'ASAN_OPTIONS' in env:
        env['ASAN_OPTIONS'] += ':exitcode=' + str(ASAN_EXIT_CODE)
    else:
        env['ASAN_OPTIONS'] = 'exitcode=' + str(ASAN_EXIT_CODE)
    symbolizer_path = envVars.findLlvmBinPath()
    if symbolizer_path is not None:
        env['ASAN_SYMBOLIZER_PATH'] = os.path.join(symbolizer_path,
                                                   'llvm-symbolizer')
    return env
Пример #6
0
def makeEnv(binPath):
    shellIsDeterministic = '-dm-' in binPath
    # Total hack to make this not rely on queryBuildConfiguration in the funfuzz repository.
    # We need this so releng machines (which work off downloaded shells that are in build/dist/js),
    # do not compile LLVM.
    if not shellIsDeterministic:
        return None

    env = envVars.envWithPath(os.path.abspath(os.path.dirname(binPath)))
    env['ASAN_OPTIONS'] = 'exitcode=' + str(ASAN_EXIT_CODE)
    symbolizer_path = envVars.findLlvmBinPath()
    if symbolizer_path is not None:
        env['ASAN_SYMBOLIZER_PATH'] = os.path.join(symbolizer_path, 'llvm-symbolizer')
    return env
Пример #7
0
def makeEnv(binPath):
    shellIsDeterministic = '-dm-' in binPath
    # Total hack to make this not rely on queryBuildConfiguration in the funfuzz repository.
    # We need this so releng machines (which work off downloaded shells that are in build/dist/js),
    # do not compile LLVM.
    if not shellIsDeterministic:
        return None

    env = envVars.envWithPath(os.path.abspath(os.path.dirname(binPath)))
    env['ASAN_OPTIONS'] = 'exitcode=' + str(ASAN_EXIT_CODE)
    symbolizer_path = envVars.findLlvmBinPath()
    if symbolizer_path is not None:
        env['ASAN_SYMBOLIZER_PATH'] = os.path.join(symbolizer_path,
                                                   'llvm-symbolizer')
    return env