-
Notifications
You must be signed in to change notification settings - Fork 989
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[develop2] undefined settings (#13161)
- Loading branch information
1 parent
4ee2b23
commit a12e209
Showing
2 changed files
with
31 additions
and
48 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
conans/test/integration/settings/test_non_defining_settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import textwrap | ||
|
||
from conans.test.utils.tools import TestClient | ||
|
||
|
||
def test_settings_not_defined_consuming(): | ||
c = TestClient() | ||
conanfile = textwrap.dedent(""" | ||
from conan import ConanFile | ||
class Pkg(ConanFile): | ||
name = "pkg" | ||
version = "1.0" | ||
settings = "os", "arch" | ||
def build(self): | ||
self.output.info(f"Building with os={self.settings.os}") | ||
self.output.info(f"Building with arch={self.settings.arch}") | ||
def package_id(self): | ||
del self.info.settings.os | ||
del self.info.settings.arch | ||
""") | ||
c.save({"conanfile.py": conanfile, | ||
"profile": ""}) | ||
c.run("create . -pr=profile -s os=Windows -s arch=armv8") | ||
assert "Building with os=Windows" in c.out | ||
assert "Building with arch=armv8" in c.out | ||
c.run("install --requires=pkg/1.0 -pr=profile") | ||
# It doesn't fail, even if settings not defined | ||
c.run("install --requires=pkg/1.0 -pr=profile -s os=Linux -s arch=x86") | ||
# It doesn't fail, even if settings different value |