Ejemplo n.º 1
0
def make_env(platform=None, clear_variables=False):
    args = (Path('bfgdir', Root.srcdir), None, None, abspath('srcdir'),
            abspath('builddir'), {}, (False, False), None)
    if platform:
        with mock.patch('bfg9000.platforms.host.platform_name',
                        return_value=platform):
            env = Environment(*(args + (platform, )))
    else:
        env = Environment(*args)

    if clear_variables:
        env.variables = {}
    return env
Ejemplo n.º 2
0
def make_env(platform=None, clear_variables=False, variables={}):
    args = (Path('bfgdir', Root.srcdir), None, None, abspath('srcdir'),
            abspath('builddir'), {}, (False, False))
    if platform:
        with mock.patch('bfg9000.platforms.core.platform_name',
                        return_value=platform):
            env = Environment(*args)
    else:
        env = Environment(*args)

    if clear_variables:
        env.variables = {}
    env.variables.update(variables)
    return env
Ejemplo n.º 3
0
def make_env(platform=None, clear_variables=False, variables={}):
    args = (abspath('bfgdir'), None, None, abspath('srcdir'),
            abspath('builddir'))
    if platform:
        with mock.patch('bfg9000.platforms.core.platform_name',
                        return_value=platform):
            env = Environment(*args)
    else:
        env = Environment(*args)
    env.finalize({InstallRoot.prefix: abspath('prefix')}, (False, False))

    if clear_variables:
        env.variables = {}
    env.variables.update(variables)
    return env