-
Notifications
You must be signed in to change notification settings - Fork 990
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow regex patterns for tools.info.package_id:confs
- Loading branch information
1 parent
d6dbe07
commit 608b6dc
Showing
2 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
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
54 changes: 54 additions & 0 deletions
54
conans/test/integration/configuration/conf/test_conf_copy.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,54 @@ | ||
import os | ||
import platform | ||
import textwrap | ||
|
||
import pytest | ||
from mock import patch | ||
|
||
from conan import conan_version | ||
from conans.errors import ConanException | ||
from conans.util.files import save, load | ||
from conans.test.utils.tools import TestClient | ||
|
||
from conans.model.conf import Conf | ||
|
||
|
||
def test_copy_conaninfo_conf(): | ||
conf = Conf() | ||
|
||
conf.define("core:non_interactive", True) | ||
conf.define("tools.cmake.cmaketoolchain:generator", True) | ||
conf.define("tools.deployer:symlinks", True) | ||
|
||
pattern = [".*"] | ||
conf.define("tools.info.package_id:confs", pattern) | ||
result = conf.copy_conaninfo_conf().dumps() | ||
assert "tools.info.package_id:confs=%s" % pattern in result | ||
assert "core:non_interactive" in result | ||
assert "tools.cmake.cmaketoolchain:generator=True" in result | ||
assert "tools.deployer:symlinks" in result | ||
|
||
pattern = ["tools\..*"] | ||
conf.define("tools.info.package_id:confs", pattern) | ||
result = conf.copy_conaninfo_conf().dumps() | ||
assert "tools.info.package_id:confs=%s" % pattern in result | ||
assert "core:non_interactive" not in result | ||
assert "tools.cmake.cmaketoolchain:generator=True" in result | ||
assert "tools.deployer:symlinks" in result | ||
|
||
pattern = [".*cmake"] | ||
conf.define("tools.info.package_id:confs", pattern) | ||
result = conf.copy_conaninfo_conf().dumps() | ||
assert "tools.info.package_id:confs=%s" % pattern not in result | ||
assert "core:non_interactive" not in result | ||
assert "tools.cmake.cmaketoolchain:generator=True" in result | ||
assert "tools.deployer:symlinks" not in result | ||
|
||
pattern = ["(tools.deploy|core)"] | ||
conf.define("tools.info.package_id:confs", pattern) | ||
result = conf.copy_conaninfo_conf().dumps() | ||
assert "tools.info.package_id:confs=%s" % pattern not in result | ||
assert "core:non_interactive" in result | ||
assert "tools.cmake.cmaketoolchain:generator=True" not in result | ||
assert "tools.deployer:symlinks" in result | ||
|