本文整理匯總了Python中qibuild.test.conftest.TestBuildWorkTree.set_active_config方法的典型用法代碼示例。如果您正苦於以下問題:Python TestBuildWorkTree.set_active_config方法的具體用法?Python TestBuildWorkTree.set_active_config怎麽用?Python TestBuildWorkTree.set_active_config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qibuild.test.conftest.TestBuildWorkTree
的用法示例。
在下文中一共展示了TestBuildWorkTree.set_active_config方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_set_pythonhome
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import set_active_config [as 別名]
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
示例2: test_profiles_from_config
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import set_active_config [as 別名]
def test_profiles_from_config(cd_to_tmpdir):
qibuild.config.add_build_config("foo", profiles=["bar"])
build_worktree = TestBuildWorkTree()
local_xml = build_worktree.qibuild_xml
qibuild.profile.configure_build_profile(local_xml, "bar", [("WITH_BAR", "ON")])
build_worktree.set_active_config("foo")
build_config = build_worktree.build_config
assert build_config.profiles == ["bar"]
assert build_config.cmake_args == ["-DCMAKE_BUILD_TYPE=Debug", "-DWITH_BAR=ON"]
示例3: test_set_pythonhome
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import set_active_config [as 別名]
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
示例4: test_bad_qibuild_config_with_qitest_json
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import set_active_config [as 別名]
def test_bad_qibuild_config_with_qitest_json(args, qibuild_action, monkeypatch):
qibuild_action.add_test_project("testme")
qibuild_action("add-config", "foo")
qibuild_action("configure", "--config", "foo", "testme")
build_worktree = TestBuildWorkTree()
build_worktree.set_active_config("foo")
testme_proj = build_worktree.get_build_project("testme")
testme_sdk = testme_proj.sdk_directory
qitest_json = os.path.join(testme_sdk, "qitest.json")
monkeypatch.chdir(testme_proj.path)
args.qitest_jsons = [qitest_json]
test_runners = qitest.parsers.get_test_runners(args)
示例5: test_profiles_from_config
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import set_active_config [as 別名]
def test_profiles_from_config(cd_to_tmpdir):
""" Test Profiles From Config """
qibuild.config.add_build_config("foo", profiles=["bar"])
build_worktree = TestBuildWorkTree()
local_xml = build_worktree.qibuild_xml
qibuild.profile.configure_build_profile(local_xml, "bar", [("WITH_BAR", "ON")])
build_worktree.set_active_config("foo")
build_config = build_worktree.build_config
assert build_config.profiles == ["bar"]
cmake_args = build_config.cmake_args
cmake_args = [x for x in cmake_args if "VIRTUALENV" not in x]
assert cmake_args == ["-DCMAKE_BUILD_TYPE=Debug", "-DWITH_BAR=ON"]
示例6: test_using_fake_ctc
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import set_active_config [as 別名]
def test_using_fake_ctc(qibuild_action, fake_ctc):
""" Test Using Fake Cross Toolchain """
qibuild_action.add_test_project("footool")
qibuild_action("configure", "footool", "--config", "fake-ctc")
qibuild_action("make", "footool", "--config", "fake-ctc")
build_worktree = TestBuildWorkTree()
build_worktree.set_active_config("fake-ctc")
footool_proj = build_worktree.get_build_project("footool")
# assert that bin/footool exists but cannot be run:
footool = qibuild.find.find_bin([footool_proj.sdk_directory], "footool",
expect_one=True)
assert os.path.exists(footool)
with pytest.raises(Exception):
qisys.command.call([footool])
示例7: test_staged_path_first_in_path_conf
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import set_active_config [as 別名]
def test_staged_path_first_in_path_conf(qibuild_action, toolchains):
""" Test Staged Path First In Path Conf """
toolchains.create("foo")
qibuild.config.add_build_config("foo", toolchain="foo")
bar_package = toolchains.add_package("foo", "bar")
qibuild_action.add_test_project("stagepath")
qibuild_action("configure", "stagepath", "--config", "foo")
build_worktree = TestBuildWorkTree()
build_worktree.set_active_config("foo")
stagepath_proj = build_worktree.get_build_project("stagepath")
path_conf = read_path_conf(stagepath_proj)
lines = path_conf.splitlines()
assert lines == [
stagepath_proj.path,
stagepath_proj.sdk_directory,
bar_package.path
]
示例8: test_get_env
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import set_active_config [as 別名]
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
示例9: test_changing_active_config_changes_projects_build_dir
# 需要導入模塊: from qibuild.test.conftest import TestBuildWorkTree [as 別名]
# 或者: from qibuild.test.conftest.TestBuildWorkTree import set_active_config [as 別名]
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