File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
conan/internal/api/install
test/integration/generators Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,8 @@ def _receive_generators(conanfile):
168168 names = [c .__name__ if not isinstance (c , str ) else c for c in build_req .generator_info ]
169169 conanfile .output .warning (f"Tool-require { build_req } adding generators: { names } " ,
170170 warn_tag = "experimental" )
171- conanfile .generators = build_req .generator_info + conanfile .generators
171+ # Generators can be defined as a tuple in recipes, ensure we don't break if so
172+ conanfile .generators = build_req .generator_info + list (conanfile .generators )
172173
173174
174175def _generate_aggregated_env (conanfile ):
Original file line number Diff line number Diff line change 11import json
22import textwrap
33
4- from conan .test .utils .tools import TestClient
4+ from conan .test .utils .tools import GenConanfile , TestClient
55
66
77def test_inject_generators_conf ():
@@ -24,12 +24,18 @@ def package_info(self):
2424 self.generator_info = ["CMakeToolchain", MyGenerator]
2525 """ )})
2626
27+ tc .save ({"consumer/conanfile.py" : GenConanfile ("consumer" , "0.1" )
28+ .with_tool_requires ("tool/0.1" )
29+ .with_class_attribute ("generators = 'VirtualBuildEnv', 'VirtualRunEnv'" )})
30+
2731 tc .run ("create tool" )
28- tc .run ("install --tool-requires=tool/0.1 " )
32+ tc .run ("create consumer " )
2933 assert "WARN: experimental: Tool-require tool/0.1 adding generators: " \
3034 "['CMakeToolchain', 'MyGenerator']" in tc .out
3135 assert "Generator 'CMakeToolchain' calling 'generate()'" in tc .out
3236 assert "Generator 'MyGenerator' calling 'generate()'" in tc .out
37+ assert "Generator 'VirtualBuildEnv' calling 'generate()'" in tc .out
38+ assert "Generator 'VirtualRunEnv' calling 'generate()'" in tc .out
3339 assert "CMakeToolchain generated: conan_toolchain.cmake" in tc .out
3440 assert "MyGenerator generated" in tc .out
3541
You can’t perform that action at this time.
0 commit comments