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

Update powershell conf to select from powershell and pwsh #17416

Merged
merged 30 commits into from
Dec 16, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
extend test
  • Loading branch information
czoido committed Dec 5, 2024
commit 60c98d3115116515d7578641dc292d45985f429e
7 changes: 7 additions & 0 deletions test/functional/toolchains/env/test_virtualenv_powershell.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def generate(self):
self.env_scripts.setdefault("build", []).append("myenv.bat")
save(self, "myps.ps1", "echo MYPS1!!!!\n$env:MYVC_CUSTOMVAR2=\"PATATA2\"")
self.env_scripts.setdefault("build", []).append("myps.ps1")
save(self, "myps2.ps1", "echo MYPS2!!!!\n$env:MYVC_CUSTOMVAR3=\"PATATA3\"")
self.env_scripts.setdefault("build", []).append("myps2.ps1")
def layout(self):
self.folders.build = "mybuild"
self.folders.generators = "mybuild"
Expand All @@ -101,22 +103,27 @@ def test(self):
self.run('cd "hello world"')
self.run("set MYVC_CUSTOMVAR1")
self.run("set MYVC_CUSTOMVAR2")
self.run("set MYVC_CUSTOMVAR3")
""")
client.save({"conanfile.py": GenConanfile("pkg", "1.0"),
"test_package/conanfile.py": test_package})
client.run("create .")
assert "hello world" in client.out
assert "MYENV!!!" in client.out
assert "MYPS1!!!!" in client.out
assert "MYPS2!!!!" in client.out
assert "MYVC_CUSTOMVAR1=PATATA1" in client.out
assert "MYVC_CUSTOMVAR2=PATATA2" in client.out
assert "MYVC_CUSTOMVAR3=PATATA3" in client.out
# This was crashing because the .ps1 of test_package was not being cleaned
client.run(f"create . -c tools.env.virtualenv:powershell={powershell}")
assert "hello world" in client.out
assert "MYENV!!!" in client.out
assert "MYPS1!!!!" in client.out
assert "MYPS2!!!!" in client.out
assert "MYVC_CUSTOMVAR1=PATATA1" in client.out
assert "MYVC_CUSTOMVAR2=PATATA2" in client.out
assert "MYVC_CUSTOMVAR3=PATATA3" in client.out

@pytest.mark.skipif(platform.system() != "Windows", reason="Requires Windows powershell")
@pytest.mark.parametrize("powershell", ["powershell", "pwsh"])
Expand Down