Skip to content

new test for build-scripts transitive #18238

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

Open
wants to merge 1 commit into
base: develop2
Choose a base branch
from
Open
Changes from all 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
35 changes: 35 additions & 0 deletions test/functional/toolchains/cmake/test_transitive_build_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest

from conan.test.assets.genconanfile import GenConanfile
from conan.test.utils.tools import TestClient


Expand Down Expand Up @@ -85,6 +86,40 @@ def build(self):
assert "MYFUNCTION CMAKE A: Hello world A!!!" in c.out


def test_transitive_build_scripts_error():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a functional test? Looks like an integration one (maybe add light=True)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this one is more an integration test, but it was developed here because of being very close to the topic of the other tests in this file, while I couldn't find a better location in integration that wouldn't be a new test file just for this test.

# https://github.com/conan-io/conan/issues/18235
c = TestClient()
meta = textwrap.dedent("""
from conan import ConanFile

class Meta(ConanFile):
name = "meta"
version = "0.1"
package_type = "build-scripts"
def requirements(self):
self.requires("dep/0.1")
""")
product = textwrap.dedent("""
from conan import ConanFile

class Product(ConanFile):
name = "product"
version = "0.1"
package_type = "build-scripts"
def requirements(self):
self.requires("meta/0.1")
""")

c.save({"dep/conanfile.py": GenConanfile("dep", "0.1"),
"meta/conanfile.py": meta,
"product/conanfile.py": product})
c.run("create dep")
c.run("create meta")
c.run("install product")
# It doesn't crash



@pytest.mark.tool("cmake")
def test_reuse_macro_from_dep():
"""
Expand Down
Loading