-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08fd9e7
commit 293e7ed
Showing
1 changed file
with
21 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
import textwrap | ||
import unittest | ||
|
||
import pytest | ||
|
||
from conans.client.tools.env import environment_append | ||
from conans.test.utils.tools import TestClient, GenConanfile | ||
|
||
|
@@ -266,3 +268,22 @@ def test_test_package_build_require(): | |
|
||
client.run("create pkg/conanfile.py pkg/1.0@ --build=missing --lockfile=conan.lock") | ||
assert "pkg/1.0 (test package): Applying build-requirement: cmake/1.0" in client.out | ||
|
||
|
||
@pytest.mark.parametrize("test_requires", [True, False]) | ||
def test_duplicated_build_host_require(test_requires): | ||
c = TestClient() | ||
if test_requires: | ||
pkg = GenConanfile("pkg", "0.1").with_build_requirement("tool/[^4.0]", | ||
force_host_context=True) | ||
else: | ||
pkg = GenConanfile("pkg", "0.1").with_requirement("tool/[^4.0]") | ||
c.save({"tool/conanfile.py": GenConanfile("tool"), | ||
"pkg/conanfile.py": pkg, | ||
"profile": "[tool_requires]\ntool/[^3.0]"}) | ||
c.run("create tool 3.0@") | ||
c.run("create tool 4.0@") | ||
c.run("install pkg -pr:b=default -pr:h=profile --build") | ||
assert "tool/4.0 from local cache - Cache" in c.out | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
memsharded
Author
Member
|
||
c.run("install pkg --lockfile=conan.lock") | ||
assert "tool/4.0 from local cache - Cache" in c.out | ||
This comment has been minimized.
Sorry, something went wrong.
SzBosch
Contributor
|
Add a 2nd assert to check that also tool/3.0 is installed. Both tools (versions, contexts) need to be installed.