Skip to content

Commit

Permalink
Merge branch 'develop2' into frm/win_gh_actions
Browse files Browse the repository at this point in the history
  • Loading branch information
czoido authored Oct 25, 2024
2 parents e933cb4 + 98a7976 commit 1286966
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 129 deletions.
2 changes: 1 addition & 1 deletion conan/test/utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def __init__(self, cache_folder=None, current_folder=None, servers=None, inputs=
# create default profile
if light:
text = "[settings]\nos=Linux" # Needed at least build-os
save(self.cache.settings_path, "os: [Linux]")
save(self.cache.settings_path, "os: [Linux, Windows]")
else:
text = default_profiles[platform.system()]
save(self.cache.default_profile_path, text)
Expand Down
24 changes: 0 additions & 24 deletions test/functional/command/new_test.py

This file was deleted.

14 changes: 8 additions & 6 deletions test/functional/layout/test_build_system_layout_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,17 @@ def test_layout_in_cache(conanfile, build_type, arch):
"""The layout in the cache is used too, always relative to the "base" folders that the cache
requires. But by the default, the "package" is not followed
"""
client = TurboTestClient()
client = TestClient()

libarch = subfolders_arch.get(arch)
libpath = "{}{}".format(libarch + "/" if libarch else "", build_type)
ref = RecipeReference.loads("lib/1.0")
pref = client.create(ref, args="-s arch={} -s build_type={}".format(arch, build_type),
conanfile=conanfile.format(libpath=libpath))
bf = client.cache.pkg_layout(pref).build()
pf = client.cache.pkg_layout(pref).package()

client.save({"conanfile.py": conanfile.format(libpath=libpath)})
client.run(f"create . --name=lib --version=1.0 -s build_type={build_type} -s arch={arch}")

layout = client.created_layout()
bf = layout.build()
pf = layout.package()

# Check the build folder
assert os.path.exists(os.path.join(os.path.join(bf, libpath), "mylib.lib"))
Expand Down
19 changes: 9 additions & 10 deletions test/functional/toolchains/cmake/test_cmake_toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

from conan.tools.cmake.presets import load_cmake_presets
from conan.tools.microsoft.visual import vcvars_command
from conans.model.recipe_ref import RecipeReference
from conan.test.assets.cmake import gen_cmakelists
from conan.test.assets.genconanfile import GenConanfile
from conan.test.utils.test_files import temp_folder
from conan.test.utils.tools import TestClient, TurboTestClient
from conan.test.utils.tools import TestClient
from conans.util.files import save, load, rmdir
from test.conftest import tools_locations

Expand Down Expand Up @@ -336,12 +335,10 @@ def test_install_output_directories():
If we change the libdirs of the cpp.package, as we are doing cmake.install, the output directory
for the libraries is changed
"""
ref = RecipeReference.loads("zlib/1.2.11")
client = TurboTestClient()
client = TestClient()
client.run("new cmake_lib -d name=zlib -d version=1.2.11")
cf = client.load("conanfile.py")
pref = client.create(ref, conanfile=cf)
p_folder = client.get_latest_pkg_layout(pref).package()
client.run("create .")
p_folder = client.created_layout().package()
assert not os.path.exists(os.path.join(p_folder, "mylibs"))
assert os.path.exists(os.path.join(p_folder, "lib"))

Expand All @@ -350,12 +347,14 @@ def test_install_output_directories():
cf = cf.replace("cmake_layout(self)",
'cmake_layout(self)\n self.cpp.package.libdirs = ["mylibs"]')

pref = client.create(ref, conanfile=cf)
p_folder = client.get_latest_pkg_layout(pref).package()
client.save({"conanfile.py": cf})
client.run("create .")
layout = client.created_layout()
p_folder = layout.package()
assert os.path.exists(os.path.join(p_folder, "mylibs"))
assert not os.path.exists(os.path.join(p_folder, "lib"))

b_folder = client.get_latest_pkg_layout(pref).build()
b_folder = layout.build()
if platform.system() != "Windows":
gen_folder = os.path.join(b_folder, "build", "Release", "generators")
else:
Expand Down
27 changes: 13 additions & 14 deletions test/functional/toolchains/cmake/test_cmaketoolchain_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def test_cmaketoolchain_path_find_library(settings, find_root_path_modes):
"""Test that libraries in libdirs of requires can be found with
find_library() in consumer CMakeLists
"""
client = TurboTestClient()
client = TestClient()

conanfile = textwrap.dedent("""
import os
Expand All @@ -392,12 +392,14 @@ def package(self):
copy(self, "*", self.source_folder, dst=os.path.join(self.package_folder, "lib"))
""")
client.save({"conanfile.py": conanfile, "libhello.a": "", "hello.lib": ""})
pref_host = client.create(RecipeReference.loads("hello_host/0.1"), conanfile, args=settings)
host_folder = client.get_latest_pkg_layout(pref_host).base_folder
client.run("create . --name=hello_host --version=0.1 {}".format(settings))

host_folder = client.created_layout().base_folder
host_folder_hash = host_folder.replace("\\", "/").split("/")[-1]
pref_build = client.create(RecipeReference.loads("hello_build/0.1"),
conanfile, args="--build-require")
build_folder = client.get_latest_pkg_layout(pref_build).base_folder

client.run("create . --name=hello_build --version=0.1 --build-require")

build_folder = client.created_layout().base_folder
build_folder_hash = build_folder.replace("\\", "/").split("/")[-1]
conanfile = textwrap.dedent("""
from conan import ConanFile
Expand Down Expand Up @@ -443,7 +445,7 @@ def test_cmaketoolchain_path_find_program(settings, find_root_path_modes):
"""Test that executables in bindirs of tool_requires can be found with
find_program() in consumer CMakeLists.
"""
client = TurboTestClient()
client = TestClient()

conanfile = textwrap.dedent("""
import os
Expand All @@ -458,15 +460,12 @@ def package(self):
copy(self, "*", self.source_folder, os.path.join(self.package_folder, "bin"))
""")
client.save({"conanfile.py": conanfile, "hello": "", "hello.exe": ""})
client.run("create . --name=hello_host --version=0.1 {}".format(settings))
client.run("create . --name=hello_build --version=0.1 --build-require")

pref_host = client.create(RecipeReference.loads("hello_host/0.1"), conanfile, args=settings)
host_folder = client.get_latest_pkg_layout(pref_host).base_folder
client.run("create . --name=hello_host --version=0.1 {}".format(settings))
host_folder = client.created_layout().base_folder
host_folder_hash = host_folder.replace("\\", "/").split("/")[-1]
pref_build = client.create(RecipeReference.loads("hello_build/0.1"),
conanfile, args="--build-require")
build_folder = client.get_latest_pkg_layout(pref_build).base_folder
client.run("create . --name=hello_build --version=0.1 --build-require")
build_folder = client.created_layout().base_folder
build_folder_hash = build_folder.replace("\\", "/").split("/")[-1]

conanfile = textwrap.dedent("""
Expand Down
7 changes: 3 additions & 4 deletions test/functional/toolchains/gnu/autotools/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def test_install_output_directories():
If we change the libdirs of the cpp.package, as we are doing cmake.install, the output directory
for the libraries is changed
"""
client = TurboTestClient(path_with_spaces=False)
client = TestClient(path_with_spaces=False)
client.run("new cmake_lib -d name=hello -d version=1.0")
client.run("create .")
consumer_conanfile = textwrap.dedent("""
Expand Down Expand Up @@ -215,9 +215,8 @@ def build(self):
"configure.ac": configure_ac,
"Makefile.am": makefile_am,
"main.cpp": main}, clean_first=True)
ref = RecipeReference.loads("zlib/1.2.11")
pref = client.create(ref, conanfile=consumer_conanfile)
p_folder = client.get_latest_pkg_layout(pref).package()
client.run("create . --name=zlib --version=1.2.11")
p_folder = client.created_layout().package()
assert os.path.exists(os.path.join(p_folder, "mybin", "main"))
assert not os.path.exists(os.path.join(p_folder, "bin"))

Expand Down
2 changes: 1 addition & 1 deletion test/integration/lockfile/test_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def package_info(self):

@pytest.fixture()
def client_setup():
c = TestClient()
c = TestClient(light=True)
pkb_requirements = """
def requirements(self):
if self.settings.os == "Windows":
Expand Down
12 changes: 6 additions & 6 deletions test/integration/lockfile/test_ci_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_graph_build_order_override_error():
|--------------/
|-----override------> zlib/1.3
"""
c = TestClient()
c = TestClient(light=True)
c.save({"zlib/conanfile.py": GenConanfile("zlib"),
"liba/conanfile.py": GenConanfile("liba", "0.1").with_requires("zlib/1.0"),
"libb/conanfile.py": GenConanfile("libb", "0.1").with_requires("liba/0.1", "zlib/2.0"),
Expand Down Expand Up @@ -59,7 +59,7 @@ def test_graph_build_order_override_replace_requires(replace_pattern):
replace_requires zlib -> zlib/system
"""
c = TestClient()
c = TestClient(light=True)
c.save({"zlib/conanfile.py": GenConanfile("zlib"),
"liba/conanfile.py": GenConanfile("liba", "0.1").with_requires("zlib/1.0"),
"libb/conanfile.py": GenConanfile("libb", "0.1").with_requires("liba/0.1", "zlib/2.0"),
Expand Down Expand Up @@ -109,7 +109,7 @@ def test_single_config_decentralized_overrides():
\------override-----> toolc/3.0
pkgc -> toola/3.0 -> toolb/1.0 -> toolc/1.0
"""
c = TestClient()
c = TestClient(light=True)
c.save({"toolc/conanfile.py": GenConanfile("toolc"),
"toolb/conanfile.py": GenConanfile("toolb").with_requires("toolc/1.0"),
"toola/conanfile.py": GenConanfile("toola", "1.0").with_requirement("toolb/1.0")
Expand Down Expand Up @@ -172,7 +172,7 @@ def test_single_config_decentralized_overrides_nested():
\ \-----------override---------> libf/2.0
\--------------------override--------------------------> libf/3.0
"""
c = TestClient()
c = TestClient(light=True)
c.save({"libf/conanfile.py": GenConanfile("libf"),
"libe/conanfile.py": GenConanfile("libe", "1.0").with_requires("libf/1.0"),
"libd/conanfile.py": GenConanfile("libd", "1.0").with_requires("libe/1.0"),
Expand Down Expand Up @@ -233,7 +233,7 @@ def test_single_config_decentralized_overrides_multi(forced):
\-----------override--------> libf/2.0
"""
override, force = (True, False) if not forced else (False, True)
c = TestClient()
c = TestClient(light=True)
c.save({"libf/conanfile.py": GenConanfile("libf"),
"libe/conanfile.py": GenConanfile("libe", "1.0").with_requires("libf/1.0"),
"libd/conanfile.py": GenConanfile("libd", "1.0").with_requires("libe/1.0"),
Expand Down Expand Up @@ -319,7 +319,7 @@ def test_single_config_decentralized_overrides_multi_replace_requires(replace_pa
\-----------override--------> libf/2.0
"""
override, force = (True, False) if not forced else (False, True)
c = TestClient()
c = TestClient(light=True)
c.save({"libf/conanfile.py": GenConanfile("libf"),
"libe/conanfile.py": GenConanfile("libe", "1.0").with_requires("libf/1.0"),
"libd/conanfile.py": GenConanfile("libd", "1.0").with_requires("libe/1.0"),
Expand Down
2 changes: 1 addition & 1 deletion test/integration/lockfile/test_ci_revisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def package_info(self):

@pytest.fixture()
def client_setup():
c = TestClient()
c = TestClient(light=True)
c.save_home({"global.conf": "core.package_id:default_unknown_mode=recipe_revision_mode"})
pkb_requirements = """
def requirements(self):
Expand Down
20 changes: 10 additions & 10 deletions test/integration/lockfile/test_graph_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_overrides_half_diamond(override, force):
pkgc -----> pkgb/0.1 --> pkga/0.1
\--(override/force)-->pkga/0.2
"""
c = TestClient()
c = TestClient(light=True)
c.save({"pkga/conanfile.py": GenConanfile("pkga"),
"pkgb/conanfile.py": GenConanfile("pkgb", "0.1").with_requires("pkga/0.1"),
"pkgc/conanfile.py": GenConanfile("pkgc", "0.1").with_requirement("pkgb/0.1")
Expand Down Expand Up @@ -45,7 +45,7 @@ def test_overrides_half_diamond_ranges(override, force):
pkgc -----> pkgb/0.1 --> pkga/[>0.1 <0.2]
\--(override/force)-->pkga/0.2
"""
c = TestClient()
c = TestClient(light=True)
c.save({"pkga/conanfile.py": GenConanfile("pkga"),
"pkgb/conanfile.py": GenConanfile("pkgb", "0.1").with_requires("pkga/[>=0.1 <0.2]"),
"pkgc/conanfile.py": GenConanfile("pkgc", "0.1").with_requirement("pkgb/0.1")
Expand Down Expand Up @@ -74,7 +74,7 @@ def test_overrides_half_diamond_ranges_inverted(override, force):
pkgc -----> pkgb/0.1 --> pkga/[>=0.1]
\--(override/force)-->pkga/0.1
"""
c = TestClient()
c = TestClient(light=True)
c.save({"pkga/conanfile.py": GenConanfile("pkga"),
"pkgb/conanfile.py": GenConanfile("pkgb", "0.1").with_requires("pkga/[>=0.1]"),
"pkgc/conanfile.py": GenConanfile("pkgc", "0.1").with_requirement("pkgb/0.1")
Expand Down Expand Up @@ -103,7 +103,7 @@ def test_overrides_diamond(override, force):
\------> pkgc/0.1 --> pkga/0.2
\--(override/force)-->pkga/0.3
"""
c = TestClient()
c = TestClient(light=True)
c.save({"pkga/conanfile.py": GenConanfile("pkga"),
"pkgb/conanfile.py": GenConanfile("pkgb", "0.1").with_requires("pkga/0.1"),
"pkgc/conanfile.py": GenConanfile("pkgc", "0.1").with_requires("pkga/0.2"),
Expand Down Expand Up @@ -156,7 +156,7 @@ def test_overrides_diamond_ranges(override, force):
\------> pkgc/0.1 --> pkga/[>=0.2 <0.3]
\--(override/force)-->pkga/0.3
"""
c = TestClient()
c = TestClient(light=True)
c.save({"pkga/conanfile.py": GenConanfile("pkga"),
"pkgb/conanfile.py": GenConanfile("pkgb", "0.1").with_requires("pkga/[>=0.1 <0.2]"),
"pkgc/conanfile.py": GenConanfile("pkgc", "0.1").with_requires("pkga/[>=0.2 <0.3]"),
Expand Down Expand Up @@ -198,7 +198,7 @@ def test_overrides_multiple(override1, force1, override2, force2):
\ \--override---------> pkga/0.2
\---override-------------------> pkga/0.3
"""
c = TestClient()
c = TestClient(light=True)
c.save({"pkga/conanfile.py": GenConanfile("pkga"),
"pkgb/conanfile.py": GenConanfile("pkgb", "0.1").with_requires("pkga/0.1"),
"pkgc/conanfile.py": GenConanfile("pkgc", "0.1").with_requirement("pkgb/0.1")
Expand Down Expand Up @@ -235,7 +235,7 @@ def test_graph_different_overrides():
\------override-----> toolc/0.3
pkgc -> toola/0.3 -> toolb/0.3 -> toolc/0.1
"""
c = TestClient()
c = TestClient(light=True)
c.save({"toolc/conanfile.py": GenConanfile("toolc"),
"toolb/conanfile.py": GenConanfile("toolb").with_requires("toolc/0.1"),
"toola/conanfile.py": GenConanfile("toola", "0.1").with_requirement("toolb/0.1")
Expand Down Expand Up @@ -284,7 +284,7 @@ def test_introduced_conflict(override, force):
Using --lockfile-partial we can evaluate and introduce a new conflict
pkgd -----> pkgb/[*] --> pkga/[>=0.1 <0.2]
"""
c = TestClient()
c = TestClient(light=True)
c.save({"pkga/conanfile.py": GenConanfile("pkga"),
"pkgb/conanfile.py": GenConanfile("pkgb").with_requires("pkga/[>=0.1 <0.2]"),
"pkgc/conanfile.py": GenConanfile("pkgc", "0.1").with_requires("pkga/[>=0.2 <0.3]"),
Expand Down Expand Up @@ -339,7 +339,7 @@ def test_command_line_lockfile_overrides():
"""
--lockfile-overrides cannot be abused to inject new overrides, only existing ones
"""
c = TestClient()
c = TestClient(light=True)
c.save({
"pkga/conanfile.py": GenConanfile("pkga"),
"pkgb/conanfile.py": GenConanfile("pkgb", "0.1").with_requires("pkga/0.1"),
Expand All @@ -357,7 +357,7 @@ def test_command_line_lockfile_overrides():


def test_consecutive_installs():
c = TestClient()
c = TestClient(light=True)
c.save({
"pkga/conanfile.py": GenConanfile("pkga"),
"pkgb/conanfile.py": GenConanfile("pkgb", "0.1").with_requires("pkga/0.1"),
Expand Down
4 changes: 2 additions & 2 deletions test/integration/lockfile/test_lock_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_conanfile_txt_deps_ranges(requires):
"""
conanfile.txt locking it dependencies (with version ranges) using alias
"""
client = TestClient()
client = TestClient(light=True)
client.save({"pkg/conanfile.py": GenConanfile("pkg"),
"consumer/conanfile.txt": f"[{requires}]\npkg/(latest)"})
client.run("create pkg --version=0.1")
Expand Down Expand Up @@ -42,7 +42,7 @@ def test_conanfile_txt_deps_ranges_lock_revisions(requires):
"""
conanfile.txt locking it dependencies (with version ranges)
"""
client = TestClient()
client = TestClient(light=True)
client.save({"pkg/conanfile.py": GenConanfile("pkg"),
"consumer/conanfile.txt": f"[{requires}]\npkg/(latest)"})
client.run("create pkg --version=0.1")
Expand Down
Loading

0 comments on commit 1286966

Please sign in to comment.