コード例 #1
0
ファイル: test_profile.py プロジェクト: Grimy/qibuild
def test_using_custom_profile(qibuild_action, qisrc_action, git_server):
    git_server.add_build_profile("foo", [("WITH_FOO", "ON")])
    qisrc_action("init", git_server.manifest_url)
    build_worktree = TestBuildWorkTree()
    qibuild_xml = build_worktree.qibuild_xml
    qibuild.profile.configure_build_profile(qibuild_xml, "bar", [("WITH_BAR", "ON")])
    build_worktree.create_project("spam")
    qibuild.config.add_build_config("foo", profiles=["foo"])
    qibuild.config.add_build_config("bar", profiles=["bar"])
    qibuild_action("configure", "spam", "--config", "foo", "--summarize-options")
    qibuild_action("configure", "spam", "--config", "bar", "--summarize-options")
コード例 #2
0
ファイル: test_profile.py プロジェクト: pineal/qibuild
def test_using_custom_profile(qibuild_action, qisrc_action, git_server):
    git_server.add_build_profile("foo", [("WITH_FOO", "ON")])
    qisrc_action("init", git_server.manifest_url)
    build_worktree = TestBuildWorkTree()
    qibuild_xml = build_worktree.qibuild_xml
    qibuild.profile.configure_build_profile(qibuild_xml, "bar",
                                            [("WITH_BAR", "ON")])
    build_worktree.create_project("spam")
    qibuild_action("configure", "spam", "--profile", "foo",
                   "--summarize-options")
    qibuild_action("configure", "spam", "--profile", "bar",
                   "--summarize-options")
コード例 #3
0
ファイル: test_parser.py プロジェクト: trb116/pythonanalyzer
def test_no_duplicate_deps(cd_to_tmpdir, args):
    args.dep_types = "default"
    build_worktree = TestBuildWorkTree()
    foo = build_worktree.create_project("foo", run_depends=["bar"])
    build_worktree.create_project("bar", src="foo/bar")
    git = qisrc.git.Git(foo.path)
    git.init()
    git_worktree = TestGitWorkTree()

    with qisys.sh.change_cwd(cd_to_tmpdir.join("foo").strpath):
        projs = get_git_projects(git_worktree, args, default_all=True,
                                 use_build_deps=True)
    assert projs == [foo]
コード例 #4
0
ファイル: test_parser.py プロジェクト: Mhalla/qibuild
def test_no_duplicate_deps(cd_to_tmpdir, args):
    args.dep_types = "default"
    build_worktree = TestBuildWorkTree()
    foo = build_worktree.create_project("foo", run_depends=["bar"])
    build_worktree.create_project("bar", src="foo/bar")
    git = qisrc.git.Git(foo.path)
    git.init()
    git_worktree = TestGitWorkTree()

    with qisys.sh.change_cwd(cd_to_tmpdir.join("foo").strpath):
        projs = get_git_projects(git_worktree, args, default_all=True,
                                 use_build_deps=True)
    assert projs == [foo]
コード例 #5
0
ファイル: test_profile.py プロジェクト: Phlogistique/qibuild
def test_warns_on_conflict(qibuild_action, qisrc_action, git_server,
                           record_messages):
    git_server.add_build_profile("foo", [("WITH_FOO", "ON")])
    qisrc_action("init", git_server.manifest_url)
    build_worktree = TestBuildWorkTree()
    qibuild_xml = build_worktree.qibuild_xml
    qibuild.profile.configure_build_profile(qibuild_xml, "foo", [("WITH_FOO", "OFF")])
    build_worktree.create_project("spam")
    qibuild.config.add_build_config("foo", profiles=["foo"])
    record_messages.reset()
    qibuild_action("configure", "spam", "--config", "foo", "--summarize-options")
    assert record_messages.find("WITH_FOO\s+: OFF")
    assert record_messages.find("WARN")
コード例 #6
0
def test_bad_qibuild2_qiproject(cd_to_tmpdir):
    build_worktree = TestBuildWorkTree()
    build_worktree.create_project("foo")
    foo_qiproj_xml = build_worktree.tmpdir.join("foo").join("qiproject.xml")
    foo_qiproj_xml.write(""" \
<project name="foo">
    <project src="bar" />
</project>
""")
    bar_path = build_worktree.tmpdir.join("foo", "bar").ensure(dir=True)
    bar_path.ensure("CMakeLists.txt").ensure(file=True)
    bar_qiproj_xml = bar_path.join("qiproject.xml")
    bar_qiproj_xml.write("<project />")
    build_worktree = TestBuildWorkTree()
コード例 #7
0
ファイル: test_build_worktree.py プロジェクト: Grimy/qibuild
def test_bad_qibuild2_qiproject(cd_to_tmpdir):
    build_worktree = TestBuildWorkTree()
    build_worktree.create_project("foo")
    foo_qiproj_xml = build_worktree.tmpdir.join("foo").join("qiproject.xml")
    foo_qiproj_xml.write(""" \
<project name="foo">
    <project src="bar" />
</project>
""")
    bar_path = build_worktree.tmpdir.join("foo", "bar").ensure(dir=True)
    bar_path.ensure("CMakeLists.txt").ensure(file=True)
    bar_qiproj_xml = bar_path.join("qiproject.xml")
    bar_qiproj_xml.write("<project />")
    build_worktree = TestBuildWorkTree()
コード例 #8
0
ファイル: test_profile.py プロジェクト: mikalv/qibuild
def test_warns_on_conflict(qibuild_action, qisrc_action, git_server,
                           record_messages):
    git_server.add_build_profile("foo", [("WITH_FOO", "ON")])
    qisrc_action("init", git_server.manifest_url)
    build_worktree = TestBuildWorkTree()
    qibuild_xml = build_worktree.qibuild_xml
    qibuild.profile.configure_build_profile(qibuild_xml, "foo",
                                            [("WITH_FOO", "OFF")])
    build_worktree.create_project("spam")
    qibuild.config.add_build_config("foo", profiles=["foo"])
    record_messages.reset()
    qibuild_action("configure", "spam", "--config", "foo",
                   "--summarize-options")
    assert record_messages.find(r"WITH_FOO\s+: OFF")
    assert record_messages.find("WARN")
コード例 #9
0
ファイル: test_profile.py プロジェクト: aldebaran/qibuild
def test_using_custom_profile(qibuild_action, qisrc_action, git_server, record_messages):
    """ Test Using Custom Profile """
    git_server.add_build_profile("foo", [("WITH_FOO", "ON")])
    qisrc_action("init", git_server.manifest_url)
    build_worktree = TestBuildWorkTree()
    qibuild_xml = build_worktree.qibuild_xml
    qibuild.profile.configure_build_profile(qibuild_xml, "bar", [("WITH_BAR", "ON")])
    build_worktree.create_project("spam")
    qibuild.config.add_build_config("foo", profiles=["foo"])
    qibuild.config.add_build_config("bar", profiles=["bar"])
    qibuild_action("configure", "spam", "--config", "foo", "--summarize-options")
    assert record_messages.find(r"WITH_FOO\s+: ON")
    record_messages.reset()
    qibuild_action("configure", "spam", "--config", "bar", "--summarize-options")
    assert record_messages.find(r"WITH_BAR\s+: ON")
コード例 #10
0
ファイル: test_parser.py プロジェクト: Mhalla/qibuild
def setup_test():
    build_worktree = TestBuildWorkTree()
    foo = build_worktree.create_project("foo")
    world = build_worktree.create_project("world")
    hello = build_worktree.create_project("hello", build_depends=["world"])
    git = qisrc.git.Git(foo.path)
    git.init()
    git = qisrc.git.Git(world.path)
    git.init()
    git = qisrc.git.Git(hello.path)
    git.init()
    git_worktree = TestGitWorkTree()
    foo = git_worktree.get_git_project("foo")
    hello = git_worktree.get_git_project("hello")
    world = git_worktree.get_git_project("world")
    return (foo, hello, world)
コード例 #11
0
def test_changing_active_config_changes_projects_build_dir(cd_to_tmpdir):
    """ Test Changing Active Config Changes Projects Build Dir """
    qibuild.config.add_build_config("foo")
    build_worktree = TestBuildWorkTree()
    build_worktree.set_active_config("foo")
    world_proj = build_worktree.create_project("world")
    assert "foo" in world_proj.build_directory
コード例 #12
0
ファイル: test_parser.py プロジェクト: trb116/pythonanalyzer
def setup_test():
    build_worktree = TestBuildWorkTree()
    foo = build_worktree.create_project("foo")
    world = build_worktree.create_project("world")
    hello = build_worktree.create_project("hello", build_depends=["world"])
    git = qisrc.git.Git(foo.path)
    git.init()
    git = qisrc.git.Git(world.path)
    git.init()
    git = qisrc.git.Git(hello.path)
    git.init()
    git_worktree = TestGitWorkTree()
    foo = git_worktree.get_git_project("foo")
    hello = git_worktree.get_git_project("hello")
    world = git_worktree.get_git_project("world")
    return (foo, hello, world)
コード例 #13
0
ファイル: test_parser.py プロジェクト: trb116/pythonanalyzer
def test_build_deps_not_top_dir(cd_to_tmpdir, args):
    args.dep_types = "default"
    build_worktree = TestBuildWorkTree()
    dep_proj = build_worktree.create_project("dep")
    git = qisrc.git.Git(dep_proj.path)
    git.init()
    foo = build_worktree.create_project("foo", src="top/foo", build_depends=["dep"])
    top_proj = build_worktree.worktree.add_project("top")
    git = qisrc.git.Git(top_proj.path)
    git.init()
    git_worktree = TestGitWorkTree()
    top_proj = git_worktree.get_git_project("top")
    dep_proj = git_worktree.get_git_project("dep")
    with qisys.sh.change_cwd(cd_to_tmpdir.join("top", "foo").strpath):
        projs =  get_git_projects(git_worktree, args,
                                  use_build_deps=True)
        assert projs == [dep_proj, top_proj]
コード例 #14
0
ファイル: test_parser.py プロジェクト: Mhalla/qibuild
def test_build_deps_not_top_dir(cd_to_tmpdir, args):
    args.dep_types = "default"
    build_worktree = TestBuildWorkTree()
    dep_proj = build_worktree.create_project("dep")
    git = qisrc.git.Git(dep_proj.path)
    git.init()
    foo = build_worktree.create_project("foo", src="top/foo", build_depends=["dep"])
    top_proj = build_worktree.worktree.add_project("top")
    git = qisrc.git.Git(top_proj.path)
    git.init()
    git_worktree = TestGitWorkTree()
    top_proj = git_worktree.get_git_project("top")
    dep_proj = git_worktree.get_git_project("dep")
    with qisys.sh.change_cwd(cd_to_tmpdir.join("top", "foo").strpath):
        projs =  get_git_projects(git_worktree, args,
                                  use_build_deps=True)
        assert projs == [dep_proj, top_proj]
コード例 #15
0
def test_using_build_prefix_from_config_deps_already_cleaned(tmpdir, monkeypatch):
    """ Test Using Build Prefix From Config Deps Already Cleaned """
    myprefix = tmpdir.join("prefix")
    work = tmpdir.mkdir("work")
    dot_qi = work.mkdir(".qi")
    qibuild_xml = dot_qi.join("qibuild.xml")
    to_write = """<qibuild version="1">\n  <build prefix="%s" />\n</qibuild>\n"""
    qibuild_xml.write(to_write % myprefix.strpath)
    worktree = qisys.worktree.WorkTree(work.strpath)
    build_worktree = TestBuildWorkTree(worktree)
    _bar_proj = build_worktree.create_project("bar")
    foo_proj = build_worktree.create_project("foo", build_depends=["bar"])
    foo_proj.configure()
    build_dir = foo_proj.build_directory
    assert os.path.exists(build_dir)
    monkeypatch.chdir(foo_proj.path)
    qisys.script.run_action("qibuild.actions.clean", ["--force", "-z"])
    assert not os.path.exists(build_dir)
コード例 #16
0
def test_using_custom_profile(qibuild_action, qisrc_action, git_server,
                              record_messages):
    """ Test Using Custom Profile """
    git_server.add_build_profile("foo", [("WITH_FOO", "ON")])
    qisrc_action("init", git_server.manifest_url)
    build_worktree = TestBuildWorkTree()
    qibuild_xml = build_worktree.qibuild_xml
    qibuild.profile.configure_build_profile(qibuild_xml, "bar",
                                            [("WITH_BAR", "ON")])
    build_worktree.create_project("spam")
    qibuild.config.add_build_config("foo", profiles=["foo"])
    qibuild.config.add_build_config("bar", profiles=["bar"])
    qibuild_action("configure", "spam", "--config", "foo",
                   "--summarize-options")
    assert record_messages.find(r"WITH_FOO\s+: ON")
    record_messages.reset()
    qibuild_action("configure", "spam", "--config", "bar",
                   "--summarize-options")
    assert record_messages.find(r"WITH_BAR\s+: ON")
コード例 #17
0
def test_using_build_prefix_from_config_deps_already_cleaned(tmpdir, monkeypatch):
    myprefix = tmpdir.join("prefix")
    work = tmpdir.mkdir("work")
    dot_qi = work.mkdir(".qi")
    qibuild_xml = dot_qi.join("qibuild.xml")
    to_write = """\
<qibuild version="1">
  <build prefix="%s" />
</qibuild>
"""
    qibuild_xml.write(to_write % myprefix.strpath)
    worktree = qisys.worktree.WorkTree(work.strpath)
    build_worktree = TestBuildWorkTree(worktree)
    bar_proj = build_worktree.create_project("bar")
    foo_proj = build_worktree.create_project("foo", build_depends=["bar"])
    foo_proj.configure()
    build_dir = foo_proj.build_directory
    assert os.path.exists(build_dir)
    monkeypatch.chdir(foo_proj.path)
    qisys.script.run_action("qibuild.actions.clean", ["--force", "-z"])
    assert not os.path.exists(build_dir)
コード例 #18
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
コード例 #19
0
ファイル: test_build_worktree.py プロジェクト: Grimy/qibuild
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
コード例 #20
0
def test_changing_active_config_changes_projects_build_dir(cd_to_tmpdir):  # pylint: disable=unused-argument
    qibuild.config.add_build_config("foo")
    build_worktree = TestBuildWorkTree()
    build_worktree.set_active_config("foo")
    world_proj = build_worktree.create_project("world")
    assert "foo" in world_proj.build_directory
コード例 #21
0
ファイル: test_build_worktree.py プロジェクト: Grimy/qibuild
def test_changing_active_config_changes_projects_build_dir(cd_to_tmpdir):
    qibuild.config.add_build_config("foo")
    build_worktree = TestBuildWorkTree()
    build_worktree.set_active_config("foo")
    world_proj = build_worktree.create_project("world")
    assert "foo" in  world_proj.build_directory