def test_set_default_config(cd_to_tmpdir): qibuild.config.add_build_config("foo") build_worktree = TestBuildWorkTree() build_worktree.set_default_config("foo") assert build_worktree.default_config == "foo" build_worktree2 = TestBuildWorkTree() assert build_worktree2.default_config == "foo"
def test_simple(qilinguist_action, record_messages): """ Test Simple """ build_worktree = TestBuildWorkTree() build_worktree.add_test_project("translateme/qt") qilinguist_action("list") assert record_messages.find("\\*\\s+helloqt") assert record_messages.find("\\*\\s+translate")
def test_qt(qilinguist_action): build_worktree = TestBuildWorkTree() project = build_worktree.add_test_project("translateme/qt") try: project.configure() except Exception: print "Qt not installed, skipping" return project.build() qilinguist_action("update", "helloqt") # Translate in French: fr_ts = os.path.join(project.path, "po", "fr_FR.ts") tree = qisys.qixml.read(fr_ts) root = tree.getroot() tr_elem = root.find("context/message/translation") assert tr_elem is not None tr_elem.attrib.clear() tr_elem.text = "Bonjour, monde" qisys.qixml.write(root, fr_ts) qilinguist_action("release", "helloqt") translateme = qibuild.find.find([project.sdk_directory], "translateme") cmd = [translateme, os.path.join(project.path, "po"), "fr_FR"] process = subprocess.Popen(cmd, stdout=subprocess.PIPE) (out, _) = process.communicate() assert "Bonjour, monde" in out
def test_set_default_config(cd_to_tmpdir): # pylint: disable=unused-argument qibuild.config.add_build_config("foo") build_worktree = TestBuildWorkTree() build_worktree.set_default_config("foo") assert build_worktree.default_config == "foo" build_worktree2 = TestBuildWorkTree() assert build_worktree2.default_config == "foo"
def test_when_is_default(qibuild_action): qibuild_action("add-config", "foo", "--default") build_worktree = TestBuildWorkTree() assert build_worktree.build_config.active_build_config.name == "foo" qibuild_action("rm-config", "foo") build_worktree2 = TestBuildWorkTree() assert build_worktree2.build_config.active_build_config is None
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
def test_qt(qilinguist_action): """ Test Qt """ build_worktree = TestBuildWorkTree() project = build_worktree.add_test_project("translateme/qt") try: project.configure() except Exception: print("Qt not installed, skipping") return project.build() qilinguist_action("update", "helloqt") # Translate in French: fr_ts = os.path.join(project.path, "po", "fr_FR.ts") tree = qisys.qixml.read(fr_ts) root = tree.getroot() tr_elem = root.find("context/message/translation") assert tr_elem is not None tr_elem.attrib.clear() tr_elem.text = "Bonjour, monde" qisys.qixml.write(root, fr_ts) qilinguist_action("release", "helloqt") translateme = qibuild.find.find([project.sdk_directory], "translateme") cmd = [translateme, os.path.join(project.path, "po"), "fr_FR"] process = subprocess.Popen(cmd, stdout=subprocess.PIPE) (out, _) = process.communicate() assert "Bonjour, monde" in out
def test_when_is_default(qitoolchain_action): qitoolchain_action("create", "foo") qibuild.config.add_build_config("foo", toolchain="foo") test_build_worktre1 = TestBuildWorkTree() test_build_worktre1.set_default_config("foo") qitoolchain_action("remove", "foo", "--force") test_build_worktre2 = TestBuildWorkTree() assert test_build_worktre2.toolchain is None
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
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"]
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")
def test_when_is_default(qitoolchain_action): qitoolchain_action("create", "foo") qibuild.config.add_build_config("foo", toolchain="foo") test_build_worktre1 = TestBuildWorkTree() test_build_worktre1.set_default_config("foo") qitoolchain_action("remove", "foo", "--force") test_build_worktre2 = TestBuildWorkTree() # pylint:disable-msg=E1101 with pytest.raises(Exception) as e: test_build_worktre2.toolchain # pylint: disable=pointless-statement assert "No such toolchain" in e.value.message
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
def test_when_is_default(qitoolchain_action): """ Test When Is Default """ qitoolchain_action("create", "foo") qibuild.config.add_build_config("foo", toolchain="foo") test_build_worktre1 = TestBuildWorkTree() test_build_worktre1.set_default_config("foo") qitoolchain_action("remove", "foo", "--force") test_build_worktre2 = TestBuildWorkTree() with pytest.raises(Exception) as e: test_build_worktre2.toolchain # pylint:disable=pointless-statement assert "No such toolchain" in e.value.message
def test_when_is_default(qitoolchain_action): qitoolchain_action("create", "foo") qibuild.config.add_build_config("foo", toolchain="foo") test_build_worktre1 = TestBuildWorkTree() test_build_worktre1.set_default_config("foo") qitoolchain_action("remove", "foo", "--force") test_build_worktre2 = TestBuildWorkTree() # pylint:disable-msg=E1101 with pytest.raises(Exception) as e: test_build_worktre2.toolchain assert "No such toolchain" in e.value.message
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)
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")
def test_pure_c_project(qibuild_action, tmpdir): """ Test Pure C Project """ work = tmpdir.join("work") foo1 = work.mkdir("foo") foo1.join("CMakeLists.txt").write("""\ncmake_minimum_required(VERSION 3.0)\nproject(foo C)\n""") qibuild_action.chdir(foo1.strpath) qibuild_action("convert", "--go") qibuild_action.chdir(work.strpath) build_worktree = TestBuildWorkTree() worktree = build_worktree.worktree worktree.add_project("foo") assert build_worktree.get_build_project("foo")
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"]
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"] cmake_args = build_config.cmake_args cmake_args = [x for x in cmake_args if not "VIRTUALENV" in x] assert cmake_args == ["-DCMAKE_BUILD_TYPE=Debug", "-DWITH_BAR=ON"]
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")
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]
def test_new_syntax(build_worktree): world_proj = build_worktree.create_project("world") with open(world_proj.qiproject_xml, "w") as fp: fp.write(""" <project format="3"> <version>0.42</version> <qibuild name="world" /> </project> """) build_worktree = TestBuildWorkTree() world_proj = build_worktree.get_build_project("world") assert world_proj.name == "world" assert world_proj.version == "0.42"
def test_pure_c_project(qibuild_action, tmpdir): """ Test Pure C Project """ work = tmpdir.join("work") foo1 = work.mkdir("foo") foo1.join("CMakeLists.txt").write( """\ncmake_minimum_required(VERSION 3.0)\nproject(foo C)\n""") qibuild_action.chdir(foo1.strpath) qibuild_action("convert", "--go") qibuild_action.chdir(work.strpath) build_worktree = TestBuildWorkTree() worktree = build_worktree.worktree worktree.add_project("foo") assert build_worktree.get_build_project("foo")
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"] # build_config.cmake contains qibuild_DIR, CMAKE_BUILD_TYPE, and # QI_VIRTUALENV_PATH, which are not relevant to this test cmake_args = build_config.cmake_args cmake_args = [x for x in cmake_args if "WITH" in x] assert cmake_args == ["-DWITH_BAR=ON"]
def test_using_fake_ctc(qibuild_action, fake_ctc): # pylint: disable=unused-argument 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) # pylint: disable-msg=E1101 with pytest.raises(Exception): qisys.command.call([footool])
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])
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()
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")
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")
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 ]
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)
def test_simple(qitoolchain_action): qitoolchain_action("create", "foo") qitoolchain_action("set-default", "-c", "foo") build_worktree = TestBuildWorkTree() toolchain = build_worktree.toolchain assert toolchain assert toolchain.name == "foo"
def test_venv_path(qipy_action): # ipython 5 is the last version compatible with Python 2.7 qipy_action("bootstrap", "pip", "virtualenv", "ipython<=5") build_worktree = TestBuildWorkTree() venv_path = build_worktree.venv_path activate = os.path.join(venv_path, "bin", "activate") assert os.path.exists(activate)
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]
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)
def test_path_conf_contains_toolchain_paths(qibuild_action, toolchains): toolchains.create("foo") qibuild.config.add_build_config("foo", toolchain="foo") toolchains.add_package("foo", "bar") foo_tc = qitoolchain.get_toolchain("foo") bar_path = foo_tc.get_package("bar").path qibuild_action.add_test_project("hello") qibuild_action.add_test_project("world") build_woktree = TestBuildWorkTree() build_woktree.build_config.set_active_config("foo") qibuild_action("configure", "hello", "--config", "foo") world_proj = build_woktree.get_build_project("world") hello_proj = build_woktree.get_build_project("hello") path_conf = os.path.join(hello_proj.sdk_directory, "share", "qi", "path.conf") with open(path_conf, "r") as fp: contents = fp.readlines() sdk_dirs = [x.strip() for x in contents] assert hello_proj.sdk_directory in sdk_dirs assert world_proj.sdk_directory in sdk_dirs assert bar_path in sdk_dirs
def test_sync_build_profiles(qisrc_action, git_server): git_server.add_build_profile("foo", [("WITH_FOO", "ON")]) qisrc_action("init", git_server.manifest_url) build_worktree = TestBuildWorkTree() build_config = qibuild.build_config.CMakeBuildConfig(build_worktree) build_config.profiles = ["foo"] assert build_config.cmake_args == ["-DCMAKE_BUILD_TYPE=Debug", "-DWITH_FOO=ON"] git_server.add_build_profile("foo", [("WITH_FOO", "ON"), ("WITH_BAR", "ON")]) qisrc_action("sync") assert build_config.cmake_args == ["-DCMAKE_BUILD_TYPE=Debug", "-DWITH_FOO=ON", "-DWITH_BAR=ON"]
def test_using_build_prefix_from_config(qibuild_action, tmpdir): """ Test Using Build Prefix From Config """ build_worktree = TestBuildWorkTree() qibuild_action.add_test_project("world") qibuild_cfg = qibuild.config.QiBuildConfig() qibuild_cfg.local.build.prefix = "prefix" qibuild_cfg.write_local_config(build_worktree.qibuild_xml) qibuild_action("configure", "world") prefix = build_worktree.tmpdir.join("prefix") expected = prefix.join("build-sys-%s" % (TARGET), "world") assert expected.join("CMakeCache.txt").check(file=True)
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)
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_add_build_project(git_server, qisrc_action): git_server.add_qibuild_test_project("world") qisrc_action("init", git_server.manifest_url) build_worktree = TestBuildWorkTree() assert build_worktree.get_build_project("world")
def test_non_translated_messages_qt(qilinguist_action): build_worktree = TestBuildWorkTree() project = build_worktree.add_test_project("translateme/qt") qilinguist_action("update", "helloqt") qilinguist_action("release", "helloqt", raises=True)
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