Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
54 changes: 26 additions & 28 deletions test/functional/workspace/test_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pytest

from conan.api.subapi.workspace import WorkspaceAPI
from conan.internal.util.files import chdir
from conan.test.utils.tools import TestClient

WorkspaceAPI.TEST_ENABLED = "will_break_next"
Expand Down Expand Up @@ -50,7 +49,6 @@ def test_metabuild():
# it doesn't fail


@pytest.mark.tool("cmake")
def test_relative_paths():
# This is using the meta-project
c = TestClient()
Expand All @@ -64,33 +62,33 @@ def test_relative_paths():
with c.chdir("mywks"):
c.run("workspace add ../liba")
c.run("workspace add ../app1 --product")
c.run("workspace build")
conanws_yml = textwrap.dedent("""\
editables:
app1/0.1:
path: ../app1
liba/0.1:
path: ../liba
products:
- ../app1
""")
assert conanws_yml == c.load("conanws.yml")
c.run("workspace info")
expected = textwrap.dedent("""\
products
../app1
editables
app1/0.1
path: ../app1
liba/0.1
path: ../liba
""")
assert expected in c.out
c.run("graph info --requires=app1/0.1")
c.assert_listed_require({"app1/0.1": "Editable", "liba/0.1": "Editable"})
# cd otherwks
with c.chdir("otherwks"):
c.run("workspace add ../other/libb")
c.run("workspace add ../other/app2 --product")
c.run("workspace build")
conanws_yml = textwrap.dedent("""\
editables:
app2/0.1:
path: ../other/app2
libb/0.1:
path: ../other/libb
products:
- ../other/app2
""")
assert conanws_yml == c.load("conanws.yml")

ext = ".exe" if platform.system() == "Windows" else ""
assert os.path.exists(os.path.join(c.current_folder, "app1", "build", "Release", f"app1{ext}"))
assert os.path.exists(os.path.join(c.current_folder, "other", "app2", "build", "Release", f"app2{ext}"))
c.run("workspace info")
expected = textwrap.dedent("""\
products
../other/app2
editables
app2/0.1
path: ../other/app2
libb/0.1
path: ../other/libb
""")
assert expected in c.out
c.run("graph info --requires=app2/0.1")
c.assert_listed_require({"app2/0.1": "Editable", "libb/0.1": "Editable"})
Loading
Loading