Ejemplo n.º 1
0
def flag_value(flag, spec):
    compiler = None
    if spec is None:
        compiler = MockCompiler()
    else:
        compiler_entry = copy(default_compiler_entry)
        compiler_entry['spec'] = spec
        # Disable faulty id()-based cache (issue #7647).
        compilers._compiler_cache = {}
        compiler = compilers.compiler_from_config_entry(compiler_entry)

    return getattr(compiler, flag)
Ejemplo n.º 2
0
def flag_value(flag, spec):
    compiler = None
    if spec is None:
        compiler = MockCompiler()
    else:
        compiler_entry = copy(default_compiler_entry)
        compiler_entry['spec'] = spec
        # Disable faulty id()-based cache (issue #7647).
        compilers._compiler_cache = {}
        compiler = compilers.compiler_from_config_entry(compiler_entry)

    return getattr(compiler, flag)
Ejemplo n.º 3
0
def test_compiler_flags_from_config_are_grouped():
    compiler_entry = {
        'spec': '[email protected]',
        'operating_system': 'foo-os',
        'paths': {
            'cc': 'cc-path',
            'cxx': 'cxx-path',
            'fc': None,
            'f77': None
        },
        'flags': {
            'cflags': '-O0 -foo-flag foo-val'
        },
        'modules': None
    }

    compiler = compilers.compiler_from_config_entry(compiler_entry)
    assert any(x == '-foo-flag foo-val' for x in compiler.flags['cflags'])
Ejemplo n.º 4
0
def test_compiler_flags_from_config_are_grouped():
    compiler_entry = {
        'spec': '[email protected]',
        'operating_system': 'foo-os',
        'paths': {
            'cc': 'cc-path',
            'cxx': 'cxx-path',
            'fc': None,
            'f77': None
        },
        'flags': {
            'cflags': '-O0 -foo-flag foo-val'
        },
        'modules': None
    }

    compiler = compilers.compiler_from_config_entry(compiler_entry)
    assert any(x == '-foo-flag foo-val' for x in compiler.flags['cflags'])