Esempio n. 1
0
def test_set_pythonhome(toolchains, cd_to_tmpdir):
    toolchains.create("foo")
    qibuild.config.add_build_config("foo", toolchain="foo")
    python_package = toolchains.add_package("foo", "python")
    build_worktree = TestBuildWorkTree()
    build_worktree.set_active_config("foo")
    env = build_worktree.get_env()
    assert env["PYTHONHOME"] == python_package.path
Esempio n. 2
0
def test_set_pythonhome(toolchains, cd_to_tmpdir):
    toolchains.create("foo")
    qibuild.config.add_build_config("foo", toolchain="foo")
    python_package = toolchains.add_package("foo", "python")
    build_worktree = TestBuildWorkTree()
    build_worktree.set_active_config("foo")
    env = build_worktree.get_env()
    if sys.platform == "darwin":
        assert env["PYTHONHOME"] == python_package.path + "/Python.framework/Versions/2.7"
    else:
        assert env["PYTHONHOME"] == python_package.path
Esempio n. 3
0
def test_set_pythonhome(toolchains, cd_to_tmpdir):
    toolchains.create("foo")
    qibuild.config.add_build_config("foo", toolchain="foo")
    python_package = toolchains.add_package("foo", "python")
    build_worktree = TestBuildWorkTree()
    build_worktree.set_active_config("foo")
    env = build_worktree.get_env()
    if sys.platform == "darwin":
        assert env["PYTHONHOME"] == python_package.path + "/Python.framework/Versions/2.7"
    else:
        assert env["PYTHONHOME"] == python_package.path
Esempio n. 4
0
def test_using_defaut_config(toolchains, args, build_worktree):
    """ Test Using Default Config """
    qibuild.config.add_build_config("foo", toolchain="foo")
    foo_tc = toolchains.create("foo")
    build_worktree.set_default_config("foo")
    args.worktree = build_worktree.root
    assert qitoolchain.parsers.get_toolchain(args) == foo_tc
Esempio n. 5
0
def test_using_defaut_config(toolchains, args, build_worktree):
    """ Test Using Default Config """
    qibuild.config.add_build_config("foo", toolchain="foo")
    foo_tc = toolchains.create("foo")
    build_worktree.set_default_config("foo")
    args.worktree = build_worktree.root
    assert qitoolchain.parsers.get_toolchain(args) == foo_tc
Esempio n. 6
0
def test_using_dash_c(toolchains, args):
    """ Test Using Dash C """
    foo_tc = toolchains.create("foo")
    qibuild.config.add_build_config("bar", toolchain="foo")
    qibuild.config.add_build_config("baz")
    args.config = "bar"
    assert qitoolchain.parsers.get_toolchain(args) == foo_tc
    args.config = "baz"
    with pytest.raises(Exception) as e:
        qitoolchain.parsers.get_toolchain(args)
    assert "config baz has no toolchain" in str(e)
Esempio n. 7
0
def test_using_dash_c(toolchains, args):
    """ Test Using Dash C """
    foo_tc = toolchains.create("foo")
    qibuild.config.add_build_config("bar", toolchain="foo")
    qibuild.config.add_build_config("baz")
    args.config = "bar"
    assert qitoolchain.parsers.get_toolchain(args) == foo_tc
    args.config = "baz"
    with pytest.raises(Exception) as e:
        qitoolchain.parsers.get_toolchain(args)
    assert "config baz has no toolchain" in e.value.message
Esempio n. 8
0
def test_get_env(toolchains, cd_to_tmpdir):
    toolchains.create("foo")
    qibuild.config.add_build_config("foo", toolchain="foo")
    bar_package = toolchains.add_package("foo", "bar")
    build_worktree = TestBuildWorkTree()
    build_worktree.set_active_config("foo")
    world_proj = build_worktree.create_project("world")
    env = build_worktree.get_env()
    if sys.platform.startswith("linux"):
        assert env["LD_LIBRARY_PATH"] == "%s:%s" % (os.path.join(
            world_proj.sdk_directory,
            "lib"), os.path.join(bar_package.path, "lib"))
    if sys.platform.startswith("win"):
        old_path = os.environ["PATH"]
        assert env["PATH"] == "%s;%s;%s" % (os.path.join(
            world_proj.sdk_directory,
            "bin"), os.path.join(bar_package.path, "bin"), old_path)
    if sys.platform == "darwin":
        assert env["DYLD_LIBRARY_PATH"] == "%s:%s" % (os.path.join(
            world_proj.sdk_directory,
            "lib"), os.path.join(bar_package.path, "lib"))
        assert env["DYLD_FRAMEWORK_PATH"] == bar_package.path
Esempio n. 9
0
def test_get_env(toolchains, cd_to_tmpdir):
    toolchains.create("foo")
    qibuild.config.add_build_config("foo", toolchain="foo")
    bar_package = toolchains.add_package("foo", "bar")
    build_worktree = TestBuildWorkTree()
    build_worktree.set_active_config("foo")
    world_proj = build_worktree.create_project("world")
    env = build_worktree.get_env()
    if sys.platform.startswith("linux"):
        assert env["LD_LIBRARY_PATH"] == "%s:%s" % (
                os.path.join(world_proj.sdk_directory, "lib"),
                os.path.join(bar_package.path, "lib"))
    if sys.platform.startswith("win"):
        old_path = os.environ["PATH"]
        assert env["PATH"] == "%s;%s;%s" % (
                os.path.join(world_proj.sdk_directory, "bin"),
                os.path.join(bar_package.path, "bin"),
                old_path)
    if sys.platform == "darwin":
        assert env["DYLD_LIBRARY_PATH"] == "%s:%s" % (
                os.path.join(world_proj.sdk_directory, "lib"),
                os.path.join(bar_package.path, "lib"))
        assert env["DYLD_FRAMEWORK_PATH"] == bar_package.path
def test_simple(qitoolchain_action, toolchains, record_messages):
    """ Test Simple """
    toolchains.create("foo")
    toolchains.add_package("foo", "boost", package_version="1.57-r3")
    qitoolchain_action("package-info", "--toolchain", "foo", "boost")
    assert record_messages.find("boost 1.57-r3")