@@ -58,9 +58,7 @@ def test_vcvars_generator_skip_on_linux():
5858 Skip creation of conanvcvars.bat on Linux build systems
5959 """
6060 client = TestClient ()
61- client .save ({"conanfile.py" : GenConanfile ().with_generator ("VCVars" )
62- .with_settings ("os" , "compiler" ,
63- "arch" , "build_type" )})
61+ client .save ({"conanfile.txt" : "[generators]\n VCVars" })
6462
6563 client .run ('install . -s os=Windows -s compiler=msvc -s compiler.version=193 '
6664 '-s compiler.runtime=dynamic' )
@@ -70,14 +68,7 @@ def test_vcvars_generator_skip_on_linux():
7068@pytest .mark .skipif (platform .system () not in ["Windows" ], reason = "Requires Windows" )
7169def test_vcvars_generator_string ():
7270 client = TestClient (path_with_spaces = False )
73-
74- conanfile = textwrap .dedent ("""
75- from conan import ConanFile
76- class TestConan(ConanFile):
77- generators = "VCVars"
78- settings = "os", "compiler", "arch", "build_type"
79- """ )
80- client .save ({"conanfile.py" : conanfile })
71+ client .save ({"conanfile.txt" : "[generators]\n VCVars" })
8172 client .run ('install . -s os=Windows -s compiler="msvc" -s compiler.version=191 '
8273 '-s compiler.cppstd=14 -s compiler.runtime=static' )
8374
@@ -89,14 +80,7 @@ class TestConan(ConanFile):
8980def test_vcvars_2015_error ():
9081 # https://github.com/conan-io/conan/issues/9888
9182 client = TestClient (path_with_spaces = False )
92-
93- conanfile = textwrap .dedent ("""
94- from conan import ConanFile
95- class TestConan(ConanFile):
96- generators = "VCVars"
97- settings = "os", "compiler", "arch", "build_type"
98- """ )
99- client .save ({"conanfile.py" : conanfile })
83+ client .save ({"conanfile.txt" : "[generators]\n VCVars" })
10084 client .run ('install . -s os=Windows -s compiler="msvc" -s compiler.version=190 '
10185 '-s compiler.cppstd=14 -s compiler.runtime=static' )
10286
@@ -109,14 +93,7 @@ class TestConan(ConanFile):
10993def test_vcvars_platform_x86 ():
11094 # https://github.com/conan-io/conan/issues/11144
11195 client = TestClient (path_with_spaces = False )
112-
113- conanfile = textwrap .dedent ("""
114- from conan import ConanFile
115- class TestConan(ConanFile):
116- generators = "VCVars"
117- settings = "os", "compiler", "arch", "build_type"
118- """ )
119- client .save ({"conanfile.py" : conanfile })
96+ client .save ({"conanfile.txt" : "[generators]\n VCVars" })
12097 client .run ('install . -s os=Windows -s compiler="msvc" -s compiler.version=193 '
12198 '-s compiler.cppstd=14 -s compiler.runtime=static -s:b arch=x86' )
12299
@@ -127,14 +104,7 @@ class TestConan(ConanFile):
127104@pytest .mark .skipif (platform .system () != "Windows" , reason = "Requires Windows" )
128105def test_vcvars_winsdk_version ():
129106 client = TestClient (path_with_spaces = False )
130-
131- conanfile = textwrap .dedent ("""
132- from conan import ConanFile
133- class TestConan(ConanFile):
134- generators = "VCVars"
135- settings = "os", "compiler", "arch", "build_type"
136- """ )
137- client .save ({"conanfile.py" : conanfile })
107+ client .save ({"conanfile.txt" : "[generators]\n VCVars" })
138108 client .run ('install . -s os=Windows -s compiler=msvc -s compiler.version=193 '
139109 '-s compiler.cppstd=14 -s compiler.runtime=static '
140110 '-c tools.microsoft:winsdk_version=10.0' )
@@ -146,35 +116,36 @@ class TestConan(ConanFile):
146116@pytest .mark .skipif (platform .system () != "Windows" , reason = "Requires Windows" )
147117def test_vcvars_compiler_update ():
148118 client = TestClient (path_with_spaces = False )
149-
150- conanfile = textwrap .dedent ("""
151- from conan import ConanFile
152- class TestConan(ConanFile):
153- generators = "VCVars"
154- settings = "os", "compiler", "arch", "build_type"
155- """ )
156- client .save ({"conanfile.py" : conanfile })
119+ client .save ({"conanfile.txt" : "[generators]\n VCVars" })
157120 client .run ('install . -s os=Windows -s compiler=msvc -s compiler.version=193 '
158121 '-s compiler.cppstd=14 -s compiler.runtime=static '
159122 '-s compiler.update=3' )
160123
161124 vcvars = client .load ("conanvcvars.bat" )
162125 assert 'vcvarsall.bat" amd64 -vcvars_ver=14.33' in vcvars
163126
127+
164128@pytest .mark .skipif (platform .system () != "Windows" , reason = "Requires Windows" )
165129def test_vcvars_armv8_windows_store ():
166130 client = TestClient (path_with_spaces = False )
167-
168- conanfile = textwrap .dedent ("""
169- from conan import ConanFile
170- class TestConan(ConanFile):
171- generators = "VCVars"
172- settings = "os", "compiler", "arch", "build_type"
173- """ )
174- client .save ({"conanfile.py" : conanfile })
131+ client .save ({"conanfile.txt" : "[generators]\n VCVars" })
175132 client .run ('install . -s:b os=Windows -s compiler="msvc" -s compiler.version=194 '
176133 '-s compiler.cppstd=14 -s compiler.runtime=static -s:h arch=armv8 '
177134 '-s:h os=WindowsStore -s:h os.version=10.0' )
178135
179136 vcvars = client .load ("conanvcvars.bat" )
180137 assert 'vcvarsall.bat" amd64_arm64' in vcvars
138+
139+
140+ @pytest .mark .skipif (platform .system () != "Windows" , reason = "Requires Windows" )
141+ def test_vcvars_clang_visual2026 ():
142+ client = TestClient (path_with_spaces = False )
143+ client .save ({"conanfile.txt" : "[generators]\n VCVars" })
144+ client .run ('install . -s:b os=Windows -s compiler=clang -s compiler.version=20 '
145+ '-s compiler.cppstd=14 -s compiler.runtime=static -s arch=x86_64 '
146+ '-s compiler.runtime_version=v145 '
147+ # Using a known existing path to avoid auto-detection via vswhere
148+ '-c tools.microsoft.msbuild:installation_path=C:/' )
149+
150+ vcvars = client .load ("conanvcvars.bat" )
151+ assert '-vcvars_ver=14.5' in vcvars
0 commit comments