Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the layout, use different folder for the 'conan infos' files #11820

Merged
merged 9 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions conans/client/cmd/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ def install_build_and_test(app, conanfile_abs_path, reference, graph_info,
# Don't use "test_package/build/HASH/" as the build_f
delete_after_build = False
test_build_folder = base_folder
# Don't mess the test_package folder with the conaninfo.txt and others
# We don't have the conanfile loaded yet so we cannot know the generators_folder
install_folder = os.path.join(base_folder, "install")
lasote marked this conversation as resolved.
Show resolved Hide resolved
else:
test_build_folder, delete_after_build = _build_folder(test_build_folder,
graph_info.profile_host,
base_folder)
rmdir(test_build_folder)
install_folder = test_build_folder
if build_modes is None:
build_modes = ["never"]
try:
deps_install(app=app,
create_reference=reference,
ref_or_path=conanfile_abs_path,
install_folder=test_build_folder,
install_folder=install_folder,
base_folder=test_build_folder,
remotes=remotes,
graph_info=graph_info,
Expand All @@ -53,7 +57,7 @@ def install_build_and_test(app, conanfile_abs_path, reference, graph_info,
cmd_build(app, conanfile_abs_path, test_build_folder,
source_folder=base_folder, build_folder=test_build_folder,
package_folder=os.path.join(test_build_folder, "package"),
install_folder=test_build_folder, test=reference)
install_folder=install_folder, test=reference)
finally:
if delete_after_build:
# Required for windows where deleting the cwd is not possible.
Expand Down
3 changes: 2 additions & 1 deletion conans/model/conan_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ def install_folder(self):
@property
def generators_folder(self):
# FIXME: Remove in 2.0, no self.install_folder
return self.folders.generators_folder if self.folders.generators else self.install_folder
return self.folders.generators_folder \
if self.folders.generators is not None else self.install_folder

@property
def generators_path(self) -> Path:
Expand Down
2 changes: 1 addition & 1 deletion conans/model/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self):
self.source = ""
self.build = ""
self.package = ""
self.generators = ""
self.generators = None # None so in Conan 1.X we know when to fallback to install folder
self.imports = ""
# Relative location of the project root, if the conanfile is not in that project root, but
# in a subfolder: e.g: If the conanfile is in a subfolder then self.root = ".."
Expand Down
3 changes: 3 additions & 0 deletions conans/test/functional/command/test_command_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os.path
import time
import unittest

Expand Down Expand Up @@ -25,3 +26,5 @@ def test_conan_test(self):
client.run("test test_package hello/0.1@lasote/stable -s hello:build_type=Debug "
"--build missing")
self.assertIn('hello/0.1: Hello World Debug!', client.out)
assert os.path.exists(os.path.join(client.current_folder, "test_package",
"install", "conaninfo.txt"))