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

- add new validate test #8383

Closed
wants to merge 1 commit into from
Closed
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
40 changes: 40 additions & 0 deletions conans/test/integration/package_id/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,43 @@ def validate(self):
"exist for this configuration):", client.out)
self.assertIn("dep/0.1: Invalid ID: Windows not supported", client.out)
self.assertIn("pkg/0.1: Invalid ID: Invalid transitive dependencies", client.out)

def test_override(self):
client = TestClient()
conanfile = textwrap.dedent("""
from conans import ConanFile, tools


class Lib(ConanFile):
settings = "os", "arch", "compiler", "build_type"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": False, "fPIC": True}

def config_options(self):
if not self.options.shared:
del self.options.fPIC

def build(self):
pass
""")

client.save({"conanfile.py": conanfile})
client.run("export . dep/1.0@")

conanfile = textwrap.dedent("""
from conans import ConanFile, tools


class App(ConanFile):
requires = "dep/1.0"

def configure(self):
self.options["dep"].shared = True

def validate(self):
assert self.options["dep"].shared == True
assert self.options["dep"].fPIC == True
""")

client.save({"conanfile.py": conanfile}, clean_first=True)
client.run("create . pkg/0.1@ --build missing")