@@ -83,6 +83,7 @@ def test_tool_not_available(self):
83
83
client .run_command ('uname' , assert_error = True )
84
84
assert "'uname' is not recognized as an internal or external command" in client .out
85
85
86
+
86
87
@pytest .mark .skipif (platform .system () != "Windows" , reason = "Tests Windows Subsystems" )
87
88
class TestSubsystemsBuild :
88
89
@@ -512,3 +513,49 @@ def test_vs_clang(self):
512
513
self ._build (client , generator = "Visual Studio 17 2022" , toolset = "ClangCL" )
513
514
check_exe_run (client .out , "main" , "clang" , None , "Debug" , "x86_64" , None , subsystem = None )
514
515
check_vs_runtime ("Debug/app.exe" , client , "15" , "Debug" , subsystem = None )
516
+
517
+
518
+ @pytest .mark .tool ("msys2" )
519
+ def test_msys2_env_vars_paths ():
520
+ c = TestClient ()
521
+ # A tool-requires injecting PATHs for native, should not use "_path" calls, and use
522
+ # 'separator=;' explicitly
523
+ tool = textwrap .dedent ("""
524
+ from conan import ConanFile
525
+ class HelloConan(ConanFile):
526
+ name = "tool"
527
+ version = "0.1"
528
+ def package_info(self):
529
+ self.buildenv_info.append("INCLUDE", "C:/mytool/path", separator=";")
530
+ """ )
531
+ conanfile = textwrap .dedent ("""
532
+ from conan import ConanFile
533
+ class HelloConan(ConanFile):
534
+ win_bash = True
535
+ tool_requires = "tool/0.1"
536
+
537
+ def build(self):
538
+ self.run('echo "INCLUDE=$INCLUDE"')
539
+ """ )
540
+ profile = textwrap .dedent ("""
541
+ [conf]
542
+ tools.microsoft.bash:subsystem=msys2
543
+ tools.microsoft.bash:path=bash
544
+
545
+ [buildenv]
546
+ INCLUDE=+(sep=;)C:/prepended/path
547
+ INCLUDE+=(sep=;)C:/appended/path
548
+ """ )
549
+ c .save ({"tool/conanfile.py" : tool ,
550
+ "consumer/conanfile.py" : conanfile ,
551
+ "profile" : profile })
552
+ c .run ("create tool" )
553
+ with environment_update ({"INCLUDE" : "C:/my/abs path/folder;C:/other path/subfolder" }):
554
+ c .run ("build consumer -pr=profile" )
555
+
556
+ # Check the profile is outputed correctly
557
+ assert "INCLUDE=+(sep=;)C:/prepended/path" in c .out
558
+ assert "INCLUDE+=(sep=;)C:/appended/path" in c .out
559
+ # check the composition is correct
560
+ assert "INCLUDE=C:/prepended/path;C:/my/abs path/folder;C:/other path/subfolder;" \
561
+ "C:/mytool/path;C:/appended/path" in c .out
0 commit comments