Best Python code snippet using pytest-cov
msvs.py
Source:msvs.py
...81 add_env(path, vc_prefix + "/VC98/Bin")82 add_env(path, msdev_prefix + "/TOOLS/WINNT")83 add_env(path, msdev_prefix + "/TOOLS")84 add_to_front_list('PATH', path)85 set_env("MSDevDir", msdev_prefix + "/msdev98")86 set_env("MSVCDir", vc_prefix + "/VC98")87 return vc_prefix + "/VC98"88def _set_msvs_dev7(env, x64_host, x64_target): # .NET 200389 prefixes = [ "c:/Program Files/Microsoft Visual Studio .NET 2003",90 "c:/Program Files (x86)/Microsoft Visual Studio .NET 2003"]91 prefix = _find_dir_list(prefixes)92 if not prefix:93 die("Could not find MSVS7 .NET 2003")94 inc = []95 add_env(inc, prefix + '/VC7/ATLMFC/INCLUDE')96 add_env(inc, prefix + '/VC7/include')97 add_env(inc, prefix + '/VC7/PlatformSDK/include/prerelease')98 add_env(inc, prefix + '/VC7/PlatformSDK/include')99 add_env(inc, prefix + '/SDK/v1.1/include')100 add_env(inc, prefix + '/SDK/v1.1/include/')101 set_env_list("INCLUDE",inc)102 lib = []103 add_env(lib, prefix + '/VC7/ATLMFC/LIB')104 add_env(lib, prefix + '/VC7/LIB')105 add_env(lib, prefix + '/VC7/PlatformSDK/lib/prerelease')106 add_env(lib, prefix + '/VC7/PlatformSDK/lib')107 add_env(lib, prefix + '/SDK/v1.1/lib')108 add_env(lib, prefix + '/SDK/v1.1/Lib/')109 set_env_list("LIB",lib)110 111 path = []112 add_env(path, prefix + "/Common7/IDE")113 add_env(path, prefix + "/VC7/bin")114 add_env(path, prefix + "/Common7/Tools")115 add_env(path, prefix + "/Common7/Tools/bin/prerelease")116 add_env(path, prefix + "/Common7/Tools/bin")117 add_env(path, prefix + "/SDK/v1.1/bin")118 add_to_front_list('PATH', path)119 120 set_env("VCINSTALLDIR", prefix)121 set_env("VC71COMNTOOLS", prefix + "/Common7/Tools/")122 set_env("VSINSTALLDIR", prefix + '/Common7/IDE')123 set_env("MSVCDir", prefix + '/VC7')124 set_env("FrameworkVersion","v1.1.4322")125 set_env("FrameworkSDKDir", prefix + "/SDK/v1.1")126 set_env("FrameworkDir", "C:/WINDOWS/Microsoft.NET/Framework")127 # DevEnvDir has a trailing slash128 set_env("DevEnvDir", prefix + "/Common7/IDE/")129 return prefix + "/VC7"130def _set_msvs_dev8(env, x64_host, x64_target, regv=None): # VS 2005131 if regv:132 prefix = regv133 else:134 prefixes = ["c:/Program Files (x86)/Microsoft Visual Studio 8",135 "c:/Program Files/Microsoft Visual Studio 8"]136 prefix = _find_dir_list(prefixes)137 if not os.path.exists(prefix):138 die("Could not find MSVC8 (2005)")139 set_env('VCINSTALLDIR', prefix + '/VC')140 set_env('VS80COMNTOOLS', prefix + "/Common7/Tools")141 set_env('VSINSTALLDIR', prefix)142 i =[] 143 add_env(i, prefix + "/VC/ATLMFC/INCLUDE")144 add_env(i, prefix + "/VC/INCLUDE")145 add_env(i, prefix + "/VC/PlatformSDK/include")146 add_env(i, prefix + "/SDK/v2.0/include")147 set_env_list('INCLUDE', i)148 set_env('FrameworkDir','C:/WINDOWS/Microsoft.NET/Framework')149 set_env('FrameworkVersion', 'v2.0.50727')150 set_env('FrameworkSDKDir', prefix +'/SDK/v2.0')151 # DevEnvDir has a trailing slash152 set_env("DevEnvDir", prefix +'/Common7/IDE/')153 lp = []154 path=[]155 lib=[]156 if x64_host and x64_target:157 add_env(lp, prefix + '/VC/ATLMFC/LIB/amd64')158 159 add_env(lib, prefix + "/VC/ATLMFC/LIB/amd64")160 add_env(lib, prefix + "/VC/LIB/amd64")161 add_env(lib, prefix + "/VC/PlatformSDK/lib/amd64")162 add_env(lib, prefix + "/SDK/v2.0/LIBAMD64")163 add_env(path, prefix + "/VC/bin/amd64") 164 add_env(path, prefix + "/VC/PlatformSDK/bin/win64/amd64") 165 add_env(path, prefix + "/VC/PlatformSDK/bin") 166 add_env(path, prefix + "/VC/VCPackages") 167 add_env(path, prefix + "/Common7/IDE") 168 add_env(path, prefix + "/Common7/Tools") 169 add_env(path, prefix + "/Common7/Tools/bin") 170 add_env(path, prefix + "/SDK/v2.0/bin") 171 add_env(path, prefix + "C:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727")172 elif not x64_target:173 add_env(path, prefix + '/Common7/IDE')174 add_env(path, prefix + '/VC/BIN')175 add_env(path, prefix + '/Common7/Tools')176 add_env(path, prefix + '/Common7/Tools/bin')177 add_env(path, prefix + '/VC/PlatformSDK/bin')178 add_env(path, prefix + '/SDK/v2.0/bin')179 add_env(path, prefix + '/VC/VCPackages')180 add_env(path, 'C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727')181 add_env(lib, prefix + '/VC/ATLMFC/LIB')182 add_env(lib, prefix + '/VC/LIB')183 add_env(lib, prefix + '/VC/PlatformSDK/lib')184 add_env(lib, prefix + '/SDK/v2.0/lib')185 add_env(lp, prefix + '/VC/ATLMFC/LIB')186 add_env(lp, 'C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727')187 add_to_front_list('PATH', path)188 set_env_list('LIB',lib)189 set_env_list('LIBPATH', lp)190 return prefix + "/VC"191def _set_msvs_dev9(env, x64_host, x64_target, regv=None): # VS 2008192 if regv:193 prefix = regv194 else:195 prefixes = ['C:/Program Files (x86)/Microsoft Visual Studio 9.0',196 'C:/Program Files/Microsoft Visual Studio 9.0']197 prefix = _find_dir_list(prefixes)198 set_env('VSINSTALLDIR', prefix)199 set_env('VS90COMNTOOLS', prefix + '/Common7/Tools')200 set_env('VCINSTALLDIR', prefix +'/VC')201 set_env('FrameworkDir', 'C:/WINDOWS/Microsoft.NET/Framework')202 set_env('Framework35Version','v3.5')203 set_env('FrameworkVersion','v2.0.50727')204 set_env('FrameworkSDKDir', prefix +'/SDK/v3.5')205 set_env('WindowsSdkDir','C:/Program Files/Microsoft SDKs/Windows/v6.0A')206 # DevEnvDir has a trailing slash207 set_env('DevEnvDir', prefix + '/Common7/IDE/')208 inc = []209 add_env(inc, prefix + 'VC/ATLMFC/INCLUDE')210 add_env(inc, prefix + '/VC/INCLUDE')211 add_env(inc, 'C:/Program Files/Microsoft SDKs/Windows/v6.0A/include')212 set_env_list('INCLUDE',inc)213 path = []214 lib = []215 libpath = []216 if x64_target: # FIXME! 64b!!!!217 add_env(path, prefix + '/Common7/IDE')218 add_env(path, prefix + '/VC/BIN')219 add_env(path, prefix + '/Common7/Tools')220 add_env(path, prefix + '/VC/VCPackages')221 add_env(path, 'C:/Program Files/Microsoft SDKs/Windows/v6.0A/bin')222 add_env(path, 'C:/WINDOWS/Microsoft.NET/Framework/v3.5')223 add_env(path, 'C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727')224 add_env(lib, prefix +'/VC/ATLMFC/LIB/amdt64')225 add_env(lib, prefix +'/VC/LIB/amd64')226 add_env(lib, 'C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib/x64')227 add_env(libpath, 'C:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727')228 add_env(libpath, 'C:/WINDOWS/Microsoft.NET/Framework64/v3.5')229 add_env(libpath, 'C:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727')230 add_env(libpath, 'C:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727')231 add_env(libpath, prefix + '/VC/ATLMFC/LIB/amd64')232 add_env(libpath, prefix + '/VC/LIB/amd64')233 else:234 add_env(path, prefix + '/Common7/IDE')235 add_env(path, prefix + '/VC/BIN')236 add_env(path, prefix + '/Common7/Tools')237 add_env(path, prefix + '/VC/VCPackages')238 add_env(path, 'C:/Program Files/Microsoft SDKs/Windows/v6.0A/bin')239 add_env(path, 'C:/WINDOWS/Microsoft.NET/Framework/v3.5')240 add_env(path, 'C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727')241 add_env(lib, prefix +'/VC/LIB')242 add_env(lib, prefix +'/VC/ATLMFC/LIB')243 add_env(lib, 'C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib')244 add_env(libpath, 'C:/WINDOWS/Microsoft.NET/Framework/v3.5')245 add_env(libpath, 'C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727')246 add_env(libpath, prefix + '/VC/ATLMFC/LIB')247 add_env(libpath, prefix + '/VC/LIB')248 set_env_list('LIBPATH',libpath)249 set_env_list('LIB',lib)250 add_to_front_list('PATH',path)251 return prefix + "/VC"252def _set_msvs_dev10(env, x64_host, x64_target, regv=None): # VS 2010253 if regv:254 prefix = regv255 else:256 prefix = 'C:/Program Files (x86)/Microsoft Visual Studio 10.0'257 path = []258 lib = []259 libpath = []260 inc = []261 add_env(inc, prefix + '/VC/INCLUDE')262 add_env(inc, prefix + '/VC/ATLMFC/INCLUDE')263 add_env(inc, 'c:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include')264 set_env_list('INCLUDE',inc)265 set_env('Framework35Version','v3.5')266 set_env('FrameworkVersion', 'v4.0.20728')267 set_env('FrameworkVersion32', 'v4.0.20728')268 set_env('VCINSTALLDIR', prefix + '/VC')269 set_env('VS100COMNTOOLS', prefix + '/Common7/Tools')270 set_env('VSINSTALLDIR' , prefix)271 set_env('WindowsSdkDir', 'c:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A')272 # DevEnvDir has a trailing slash273 set_env('DevEnvDir', prefix + '/Common7/IDE/')274 if x64_target:275 set_env('FrameworkDir','c:/WINDOWS/Microsoft.NET/Framework64')276 set_env('FrameworkDIR64','c:/WINDOWS/Microsoft.NET/Framework64')277 set_env('FrameworkVersion64', 'v4.0.20728')278 set_env('Platform','X64')279 add_env(lib, prefix + '/VC/LIB/amd64')280 add_env(lib, prefix + '/VC/ATLMFC/LIB/amd64')281 add_env(lib, 'c:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/lib/x64')282 283 add_env(libpath, 'c:/WINDOWS/Microsoft.NET/Framework64/v4.0.20728')284 add_env(libpath, 'c:/WINDOWS/Microsoft.NET/Framework64/v3.5')285 add_env(libpath, prefix + '/VC/LIB/amd64')286 add_env(libpath, prefix + '/VC/ATLMFC/LIB/amd64')287 add_env(path, prefix + '/VC/BIN/amd64')288 add_env(path, 'c:/WINDOWS/Microsoft.NET/Framework64/v4.0.20728')289 add_env(path, 'C:/WINDOWS/Microsoft.NET/Framework64/v3.5')290 add_env(path, prefix + '/VC/VCPackages')291 add_env(path, prefix + '/Common7/IDE')292 add_env(path, prefix + '/Common7/Tools')293 add_env(path, 'C:/Program Files (x86)/HTML Help Workshop')294 add_env(path, 'C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/' +295 'bin/NETFX 4.0 Tools/x64')296 add_env(path, 'C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/bin/x64')297 add_env(path, 'C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/bin')298 else:299 set_env('FrameworkDir', 'c:/WINDOWS/Microsoft.NET/Framework')300 set_env('FrameworkDIR32', 'c:/WINDOWS/Microsoft.NET/Framework')301 302 add_env(lib, prefix + '/VC/LIB')303 add_env(lib, prefix + '/VC/ATLMFC/LIB')304 add_env(lib, 'c:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/lib')305 306 add_env(libpath, 'c:/WINDOWS/Microsoft.NET/Framework/v4.0.20728')307 add_env(libpath, 'c:/WINDOWS/Microsoft.NET/Framework/v3.5')308 add_env(libpath, prefix + '/VC/LIB')309 add_env(libpath, prefix + '/VC/ATLMFC/LIB')310 311 add_env(path, prefix + '/Common7/IDE/')312 add_env(path, prefix + '/VC/BIN')313 add_env(path, prefix +'/Common7/Tools')314 add_env(path, 'C:/WINDOWS/Microsoft.NET/Framework/v4.0.20728')315 add_env(path, 'C:/WINDOWS/Microsoft.NET/Framework/v3.5')316 add_env(path, prefix + '/VC/VCPackages')317 add_env(path, 'C:/Program Files (x86)/HTML Help Workshop')318 add_env(path, prefix + '/Team Tools/Performance Tools')319 add_env(path, 'C;/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/' +320 'bin/NETFX 4.0 Tools')321 add_env(path, 'C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/bin')322 set_env_list('LIBPATH',libpath)323 set_env_list('LIB',lib)324 add_to_front_list('PATH',path)325 return prefix + "/VC"326def _set_msvs_dev11(env, x64_host, x64_target, regv=None): # msvs2012327 progfi = 'C:/Program Files (x86)'328 if regv:329 prefix = regv330 else:331 prefix = progfi + '/Microsoft Visual Studio 11.0'332 sdkdir = progfi + '/Microsoft SDKs/Windows/v8.0'333 sdk8 = progfi + '/Microsoft SDKs/Windows/v8.0A'334 sdk7 = progfi + '/Microsoft SDKs/Windows/v7.0A'335 winkit = progfi + '/Windows Kits/8.0'336 path = []337 lib = []338 libpath = []339 inc = []340 add_env(inc, prefix + '/VC/INCLUDE')341 add_env(inc, prefix + '/VC/ATLMFC/INCLUDE')342 add_env(inc, winkit + '/include')343 add_env(inc, winkit + '/include/um')344 add_env(inc, winkit + '/include/shared')345 add_env(inc, winkit + '/include/winrt')346 set_env_list('INCLUDE',inc)347 set_env('Framework35Version','v3.5')348 set_env('FrameworkVersion', 'v4.0.30319')349 set_env('FrameworkVersion32', 'v4.0.30319')350 set_env('VCINSTALLDIR', prefix + '/VC/')351 set_env('VS110COMNTOOLS', prefix + '/Common7/Tools')352 set_env('VSINSTALLDIR' , prefix)353 set_env('WindowsSdkDir', winkit)354 if x64_target:355 set_env('FrameworkDir','c:/WINDOWS/Microsoft.NET/Framework64')356 set_env('FrameworkDIR64','c:/WINDOWS/Microsoft.NET/Framework64')357 set_env('FrameworkVersion64', 'v4.0.30319')358 set_env('Platform','X64')359 add_env(lib, prefix + '/VC/LIB/amd64')360 add_env(lib, prefix + '/VC/ATLMFC/LIB/amd64')361 add_env(lib, winkit + '/lib/win8/um/x64')362 add_env(libpath, 'c:/WINDOWS/Microsoft.NET/Framework64/v4.0.30319')363 add_env(libpath, 'c:/WINDOWS/Microsoft.NET/Framework64/v3.5')364 add_env(libpath, prefix + '/VC/LIB/amd64')365 add_env(libpath, prefix + '/VC/ATLMFC/LIB/amd64')366 add_env(libpath, winkit + '/References/CommonConfiguration/Neutral')367 add_env(libpath, sdkdir + 'ExtensionSDKs/Microsoft.VCLibs/11.0/' + 368 'References/CommonConfiguration/neutral')369 add_env(path, prefix + '/VC/BIN/amd64')370 add_env(path, 'c:/WINDOWS/Microsoft.NET/Framework64/v4.0.30319')371 add_env(path, 'C:/WINDOWS/Microsoft.NET/Framework64/v3.5')372 add_env(path, prefix + '/Common7/IDE/CommonExtensions/Microsoft/TestWindow')373 add_env(path, prefix + '/VC/VCPackages')374 add_env(path, prefix + '/Common7/IDE')375 add_env(path, prefix + '/Common7/Tools')376 add_env(path, 'C:/Program Files (x86)/HTML Help Workshop')377 add_env(path, prefix + '/Team Tools/Performance Tools/x64')378 add_env(path, prefix + '/Team Tools/Performance Tools')379 add_env(path, winkit + '/8.0/bin/x64')380 add_env(path, sdk8 + '/bin/NETFX 4.0 Tools/x64')381 add_env(path, sdk7 + '/Bin/x64')382 add_env(path, sdk8 + '/bin/NETFX 4.0 Tools')383 add_env(path, sdk7 + '/Bin')384 add_env(path, winkit + '/Windows Performance Toolkit')385 add_env(path, 'C:/Program Files/Microsoft SQL Server/110/Tools/Binn')386 else:387 set_env('FrameworkDir', 'c:/WINDOWS/Microsoft.NET/Framework')388 set_env('FrameworkDIR32', 'c:/WINDOWS/Microsoft.NET/Framework')389 add_env(lib, prefix + '/VC/LIB')390 add_env(lib, prefix + '/VC/ATLMFC/LIB')391 add_env(lib, winkit + '/lib/win8/um/x86')392 393 add_env(libpath, 'c:/WINDOWS/Microsoft.NET/Framework/v4.0.30319')394 add_env(libpath, 'c:/WINDOWS/Microsoft.NET/Framework/v3.5')395 add_env(libpath, prefix + '/VC/LIB')396 add_env(libpath, prefix + '/VC/ATLMFC/LIB')397 add_env(libpath, winkit + '/References/CommonConfiguration/Neutral')398 add_env(libpath, sdkdir + '/ExtensionSDKs/Microsoft.VCLibs/11.0/' +399 'References/CommonConfiguration/neutral')400 add_env(path, prefix + '/Common7/IDE/CommonExtensions/Microsoft/TestWindow')401 add_env(path, 'C:/Program Files (x86)/Microsoft SDKs/F#/3.0/Framework/v4.0')402 add_env(path, prefix + '/Common7/IDE')403 add_env(path, prefix + '/VC/BIN')404 add_env(path, prefix + '/Common7/Tools')405 add_env(path, 'C:/Windows/Microsoft.NET/Framework/v4.0.30319')406 add_env(path, 'C:/Windows/Microsoft.NET/Framework/v3.5')407 add_env(path, prefix + '/VC/VCPackages')408 add_env(path, 'C:/Program Files (x86)/HTML Help Workshop')409 add_env(path, prefix + '/Team Tools/Performance Tools')410 add_env(path, winkit + '/bin/x86')411 add_env(path, sdk8 + '/bin/NETFX 4.0 Tools')412 add_env(path, sdk7 + '/Bin')413 add_env(path, winkit + '/Windows Performance Toolkit')414 add_env(path, 'C:/Program Files/Microsoft SQL Server/110/Tools/Binn')415 set_env_list('LIBPATH',libpath)416 set_env_list('LIB',lib)417 add_to_front_list('PATH',path)418 return prefix + "/VC"419def _set_msvs_dev12(env, x64_host, x64_target, regv=None): # msvs2013420 progfi = 'C:/Program Files (x86)'421 if regv:422 prefix = regv423 else:424 prefix = progfi + '/Microsoft Visual Studio 12.0'425 sdk81a = progfi + '/Microsoft SDKs/Windows/v8.1A'426 sdk81 = progfi + '/Microsoft SDKs/Windows/v8.1'427 winkit = progfi + '/Windows Kits/8.1'428 path = []429 lib = []430 libpath = []431 inc = []432 add_env(inc, prefix + '/VC/INCLUDE')433 add_env(inc, prefix + '/VC/ATLMFC/INCLUDE')434 add_env(inc, winkit + '/include') # not used in msvs12435 add_env(inc, winkit + '/include/um')436 add_env(inc, winkit + '/include/shared')437 add_env(inc, winkit + '/include/winrt')438 set_env_list('INCLUDE',inc)439 set_env('Framework40Version','v4.0')440 set_env('FrameworkVersion', 'v4.0.30319')441 set_env('ExtensionSdkDir', 442 sdk81 + '/ExtensionSDKs')443 set_env('VCINSTALLDIR', prefix + '/VC/')444 set_env('VS120COMNTOOLS', prefix + '/Common7/Tools')445 set_env('VSINSTALLDIR' , prefix)446 set_env('WindowsSdkDir', winkit)447 set_env('VisualStudioVersion','12.0')448 set_env('WindowsSDK_ExecutablePath_x86',449 sdk81a + '/bin/NETFX 4.5.1 Tools/')450 if x64_target:451 set_env('WindowsSDK_ExecutablePath_x64',452 sdk81a +'/bin/NETFX 4.5.1 Tools/x64/')453 set_env('FrameworkDir','c:/WINDOWS/Microsoft.NET/Framework64')454 set_env('FrameworkDIR64','c:/WINDOWS/Microsoft.NET/Framework64')455 set_env('FrameworkVersion64', 'v4.0.30319')456 set_env('Platform','X64')457 add_env(lib, prefix + '/VC/LIB/amd64')458 add_env(lib, prefix + '/VC/ATLMFC/LIB/amd64')459 add_env(lib, winkit + '/lib/winv6.3/um/x64')460 add_env(libpath, 'c:/WINDOWS/Microsoft.NET/Framework64/v4.0.30319')461 add_env(libpath, prefix + '/VC/LIB/amd64')462 add_env(libpath, prefix + '/VC/ATLMFC/LIB/amd64')463 add_env(libpath, winkit + '/References/CommonConfiguration/Neutral')464 add_env(libpath, sdk81 + '/ExtensionSDKs/Microsoft.VCLibs/12.0/' + 465 'References/CommonConfiguration/neutral')466 add_env(path, prefix + '/Common7/IDE/CommonExtensions/Microsoft/TestWindow')467 add_env(path, prefix + '/VC/BIN/amd64')468 add_env(path, 'c:/WINDOWS/Microsoft.NET/Framework64/v4.0.30319')469 add_env(path, prefix + '/VC/VCPackages')470 add_env(path, prefix + '/Common7/IDE')471 add_env(path, prefix + '/Common7/Tools')472 add_env(path, 'C:/Program Files (x86)/HTML Help Workshop')473 add_env(path, prefix + '/Team Tools/Performance Tools/x64')474 add_env(path, prefix + '/Team Tools/Performance Tools')475 add_env(path, winkit + '/8.1/bin/x64')476 add_env(path, winkit + '/8.1/bin/x86')477 add_env(path, sdk81a + '/bin/NETFX 4.5.1 Tools/x64')478 add_env(path, winkit + '/Windows Performance Toolkit')479 else:480 set_env('FrameworkDir', 'c:/WINDOWS/Microsoft.NET/Framework')481 set_env('FrameworkDIR32', 'c:/WINDOWS/Microsoft.NET/Framework')482 set_env('FrameworkVersion32','v4.0.30319')483 add_env(lib, prefix + '/VC/LIB')484 add_env(lib, prefix + '/VC/ATLMFC/LIB')485 add_env(lib, winkit + '/lib/winv6.3/um/x86')486 487 add_env(libpath, 'c:/WINDOWS/Microsoft.NET/Framework/v4.0.30319')488 add_env(libpath, prefix + '/VC/LIB')489 add_env(libpath, prefix + '/VC/ATLMFC/LIB')490 add_env(libpath, winkit + '/References/CommonConfiguration/Neutral')491 add_env(libpath, sdk81 + '/ExtensionSDKs/Microsoft.VCLibs/12.0/' + 492 'References/CommonConfiguration/neutral')493 add_env(path, prefix + '/Common7/IDE/CommonExtensions/Microsoft/TestWindow')494 add_env(path, progfi + '/Microsoft SDKs/F#/3.1/Framework/v4.0')495 add_env(path, progfi + '/MSBuild/12.0/bin')496 add_env(path, prefix + '/Common7/IDE')497 add_env(path, prefix + '/VC/BIN')498 add_env(path, prefix + '/Common7/Tools')499 add_env(path, 'C:/Windows/Microsoft.NET/Framework/v4.0.30319')500 add_env(path, prefix + '/VC/VCPackages')501 add_env(path, progfi + '/HTML Help Workshop')502 add_env(path, prefix + '/Team Tools/Performance Tools')503 add_env(path, winkit + '/bin/x86')504 add_env(path, sdk81a + '/bin/NETFX 4.5.1 Tools')505 add_env(path, winkit + '/Windows Performance Toolkit')506 set_env_list('LIBPATH',libpath)507 set_env_list('LIB',lib)508 add_to_front_list('PATH',path)509 return prefix + "/VC"510def _get_winkit10_version(env, winkit10):511 # Find the UCRT Version. Could not locate a registry entry with512 # the information. Preview version of msvs2015/dev14 did not set513 # the env var. Poke around in the directory system as a last514 # resort. Could make this configrable515 winkit10version = None516 if 'UCRTVersion' in os.environ:517 winkit10version = os.environ['UCRTVersion']518 # Early versions of winkit10 that ship with MSVS2015(dev14) do not519 # have the the required stuff so people had to rely on SDK520 # 8.1. The early versions only have a ucrt subdirectory and not a521 # "shared", "um" or "winrt" directories. We use the "shared"522 # directory as our guide.523 if winkit10 and not winkit10version:524 # use glob and find youngest named directory. This code had525 # used os.path.getctime() but that gave the wrong result if an526 # older SDK was installed after a younger SDK was installed.527 dlist = glob(winkit10 + '/include/*')528 dlist.sort(reverse=True)529 for g in dlist:530 if (os.path.exists('{}/shared'.format(g)) and531 os.path.exists('{}/ucrt'.format(g)) ):532 winkit10version = os.path.basename(g)533 if winkit10version:534 complete = True535 msgb("UCRT Version", winkit10version)536 else:537 complete = False538 warn("Did not find winkit 10 version. RC tool may not be available")539 return (winkit10version,complete)540def _find_msvc_version_directory(root):541 ctime = 0542 msvc_ver = None543 for g in glob(root + '/*'):544 gtime = os.path.getctime(g)545 if gtime > ctime:546 msvc_ver = os.path.basename(g)547 ctime = gtime548 if not msvc_ver:549 die("Could not find MSVC version directory.")550 return msvc_ver551def _find_latest_subdir(d):552 ctime = 0553 for g in glob(d + '*'):554 gtime = os.path.getctime(g)555 if gtime > ctime:556 ctime = gtime557 subdir = g558 return subdir559def _ijoin(x,y):560 return '{}/{}'.format(x,y)561def msvc_dir_from_vc_dir(vc_dir):562 msvc_tools_root = vc_dir + '/Tools/MSVC'563 msvc_ver = _find_msvc_version_directory(msvc_tools_root)564 msvc_tools_root = _ijoin(msvc_tools_root,msvc_ver)565 #msgb('MSVC version', msvc_tools_root)566 return msvc_tools_root, msvc_ver567def set_msvc_compilers(env,msvc_tools_root):568 """set host/target paths for MSVS2017/DEV15. Also called from569 build_env.py when using an externally configured shell."""570 x64_to_x64 = '{}/bin/Host{}/{}/'.format(msvc_tools_root,'x64','x64')571 x64_to_x86 = '{}/bin/Host{}/{}/'.format(msvc_tools_root,'x64','x86')572 x86_to_x64 = '{}/bin/Host{}/{}/'.format(msvc_tools_root,'x86','x64')573 x86_to_x86 = '{}/bin/Host{}/{}/'.format(msvc_tools_root,'x86','x86')574 env['msvc_compilers'] = {}575 env['msvc_compilers']['ia32'] = {}576 env['msvc_compilers']['x86-64'] = {}577 env['msvc_compilers']['ia32']['ia32'] = x86_to_x64578 env['msvc_compilers']['ia32']['x86-64'] = x86_to_x86579 env['msvc_compilers']['x86-64']['ia32'] = x64_to_x86580 env['msvc_compilers']['x86-64']['x86-64'] = x64_to_x64581def _set_msvs_dev16(env, x64_host, x64_target, regv=None): # msvs 2019582 versions = ['Enterprise', 'Professional', 'Community']583 584 progfi = 'C:/Program Files (x86)'585 if regv:586 prefix = regv587 else:588 prefix = progfi + '/Microsoft Visual Studio/2019'589 if x64_target:590 tgt = 'x64'591 else:592 tgt = 'x86'593 found = False594 for v in versions:595 p = _ijoin(prefix,v)596 if os.path.exists(p):597 found = True598 break599 if not found:600 die('Could not find MSVS 2019 directory')601 vprefix = p602 winkit10 = progfi + '/Windows Kits/10' 603 winkit10version, winkit10complete = _get_winkit10_version(env,winkit10)604 #msgb('WINKIT10 VERSION', winkit10version)605 if winkit10complete == False:606 die('need a complete winkit10 for MSVS 2019 (dev 16)')607 env['rc_winkit'] = winkit10608 env['rc_winkit_number'] = winkit10version609 msvc_tools_root, msvc_ver = msvc_dir_from_vc_dir(vprefix + '/VC')610 611 netfx_sdk = progfi + '/Windows Kits/NETFXSDK/4.6.1/'612 613 path = []614 lib = []615 libpath = []616 inc = []617 618 add_env(inc, prefix + '/ATLMFC/include')619 add_env(inc, msvc_tools_root + '/include')620 add_env(inc, netfx_sdk + 'include/um')621 wki = '{}/include/{}'.format(winkit10, winkit10version)622 add_env(inc, wki + '/ucrt')623 add_env(inc, wki + '/shared')624 add_env(inc, wki + '/um')625 add_env(inc, wki + '/winrt')626 add_env(inc, wki + '/cppwinrt')627 # LIB628 wkl = '{}/lib/{}'.format(winkit10, winkit10version)629 lib1 = '{}/ATLMFC/lib/{}'.format(msvc_tools_root,tgt)630 lib2 = '{}/lib/{}'.format(msvc_tools_root,tgt)631 add_env(lib, lib1)632 add_env(lib, lib2)633 add_env(lib, '{}lib/um/{}'.format(netfx_sdk,tgt))634 add_env(lib, '{}/ucrt/{}'.format(wkl,tgt))635 add_env(lib, '{}/um/{}'.format(wkl,tgt))636 # LIBPATH637 add_env(libpath, lib1)638 add_env(libpath, lib2)639 add_env(libpath, winkit10 + '/UnionMetadata')640 add_env(libpath, winkit10 + '/References')641 s = ''642 if tgt == 'x64':643 s = '64'644 fwr = 'C:/windows/Microsoft.NET/Framework{}'.format(s)645 fwr64 = 'C:/windows/Microsoft.NET/Framework64'646 fwv = 'v4.0.30319'647 fwp = '{}/{}'.format(fwr,fwv)648 add_env(libpath, fwp)649 # PATH650 # locations for cross compilers changed in this version651 set_msvc_compilers(env, msvc_tools_root)652 x86_to_x64 = env['msvc_compilers']['ia32']['ia32'] 653 x86_to_x86 = env['msvc_compilers']['ia32']['x86-64']654 x64_to_x86 = env['msvc_compilers']['x86-64']['ia32'] 655 x64_to_x64 = env['msvc_compilers']['x86-64']['x86-64'] 656 657 cross = False658 if x64_host:659 if x64_target:660 cl_tgt_bin_dir = x64_to_x64661 else:662 cross = True663 cl_tgt_bin_dir = x64_to_x86664 cl_host_bin_dir = x64_to_x64665 else: 666 if x64_target:667 cross = True668 cl_tgt_bin_dir = x86_to_x64669 cl_host_bin_dir = x64_to_x86670 else:671 cl_tgt_bin_dir = x86_to_x86672 673 add_env(path, cl_tgt_bin_dir)674 # CL TARGET compiler gets DLLs from the HOST bin dir675 if cross:676 add_env(path, cl_host_bin_dir)677 678 add_env(path, '{}/Common7/IDE/VC/VCPackages'.format(msvc_tools_root))679 add_env(path, '{}/Common7/IDE/CommonExtensions/Microsoft/TestWindow'.format(msvc_tools_root))680 add_env(path, '{}/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer'.format(msvc_tools_root))681 add_env(path, '{}/MSBuild/15.0/bin/Roslyn'.format(msvc_tools_root))682 add_env(path, '{}/Team Tools/Performance Tools'.format(msvc_tools_root))683 684 add_env(path, progfi + '/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools')685 netfx_tools = progfi + '/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.6.1 Tools'686 add_env(path, netfx_tools)687 add_env(path, '{}/bin/{}'.format(winkit10,tgt))688 add_env(path, '{}/bin/{}/{}'.format(winkit10,winkit10version,tgt))689 add_env(path, '{}/MSBuild/15.0/bin'.format(vprefix))690 add_env(path, fwp)691 add_env(path, '{}/Common7/IDE'.format(vprefix))692 add_env(path, '{}/Common7/Tools'.format(vprefix))693 set_env_list('INCLUDE',inc)694 set_env_list('LIB',lib)695 set_env_list('LIBPATH',libpath)696 add_to_front_list('PATH',path)697 if 0:698 msgb("INCLUDE", "\n\t".join(inc))699 msgb("LIB", "\n\t".join(lib))700 msgb("LIBPATH", "\n\t".join(libpath))701 msgb("PATH", "\n\t".join(path))702 # Misc env variables. Not sure which are needed, if any703 set_env('NETFXSDKDir',netfx_sdk)704 set_env('DevEnvDir', vprefix + '/Common7/IDE/')705 set_env('ExtensionSdkDir', progfi + '/Microsoft SDKs/Windows Kits/10/ExtensionSDKs')706 set_env('Framework40Version','v4.0')707 set_env('FrameworkVersion',fwv)708 if x64_host:709 set_env('VSCMD_ARG_HOST_ARCH','x64')710 else:711 set_env('VSCMD_ARG_HOST_ARCH','x86')712 713 set_env('Platform',tgt)714 set_env('VSCMD_ARG_TGT_ARCH',tgt)715 716 if x64_target:717 set_env('FrameworkDir', fwr)718 set_env('FrameworkDIR64',fwr)719 set_env('FrameworkVersion64',fwv)720 else: 721 set_env('FrameworkDIR32',fwr)722 set_env('FrameworkVersion32',fwv)723 if x64_host:724 set_env('FrameworkDir', fwr64)725 set_env('FrameworkDIR64',fwr64)726 set_env('FrameworkVersion64',fwv)727 else:728 set_env('FrameworkDir', fwr)729 730 set_env('UCRTVersion', winkit10version)731 set_env('WindowsSDKLibVersion', winkit10version + '/')732 set_env('WindowsSDKVersion', winkit10version + '/')733 set_env('WindowsSdkVerBinPath', '{}/bin/{}/'.format(winkit10,winkit10version))734 set_env('WindowsSdkBinPath', winkit10 + '/bin/')735 set_env('WindowsSdkDir', winkit10 + '/')736 set_env('UniversalCRTSdkDir',winkit10 + '/')737 set_env('WindowsLibPath', winkit10 + '/UnionMetadata;' + winkit10 + '/References')738 739 set_env('VCIDEInstallDir', vprefix + '/Common7/IDE/VC/')740 set_env('VCINSTALLDIR', vprefix + '/VC/')741 set_env('VCToolsInstallDir', vprefix + '/VC/Tools/MSVC/' + msvc_ver + '/')742 set_env('VCToolsRedistDir', vprefix + '/VC/Redist/MSVC/' + msvc_ver + '/')743 set_env('VS150COMNTOOLS', vprefix + '/Common7/Tools/')744 set_env('VSINSTALLDIR', vprefix + '/')745 set_env('VisualStudioVersion', '15.0')746 747 set_env('WindowsSDK_ExecutablePath_x64', netfx_tools + '/x64/')748 set_env('WindowsSDK_ExecutablePath_x86', netfx_tools + '/')749 750 return vprefix + '/VC'751 752 753def _set_msvs_dev15(env, x64_host, x64_target, regv=None): # msvs 2017754 versions = ['Enterprise', 'Professional', 'Community']755 756 progfi = 'C:/Program Files (x86)'757 if regv:758 prefix = regv759 else:760 prefix = progfi + '/Microsoft Visual Studio/2017'761 if x64_target:762 tgt = 'x64'763 else:764 tgt = 'x86'765 found = False766 for v in versions:767 p = _ijoin(prefix,v)768 if os.path.exists(p):769 found = True770 break771 if not found:772 die('Could not find MSVS 2017 directory')773 vprefix = p774 #msgb('VPREFIX', vprefix)775 winkit10 = progfi + '/Windows Kits/10' 776 winkit10version, winkit10complete = _get_winkit10_version(env,winkit10)777 #msgb('WINKIT10 VERSION', winkit10version)778 if winkit10complete == False:779 die('need a complete winkit10 for MSVS 2017 (dev 15)')780 env['rc_winkit'] = winkit10781 env['rc_winkit_number'] = winkit10version782 msvc_tools_root, msvc_ver = msvc_dir_from_vc_dir(vprefix + '/VC')783 784 netfx_sdk = progfi + '/Windows Kits/NETFXSDK/4.6.1/'785 786 path = []787 lib = []788 libpath = []789 inc = []790 791 add_env(inc, prefix + '/ATLMFC/include')792 add_env(inc, msvc_tools_root + '/include')793 add_env(inc, netfx_sdk + 'include/um')794 wki = '{}/include/{}'.format(winkit10, winkit10version)795 add_env(inc, wki + '/ucrt')796 add_env(inc, wki + '/shared')797 add_env(inc, wki + '/um')798 add_env(inc, wki + '/winrt')799 # LIB800 wkl = '{}/lib/{}'.format(winkit10, winkit10version)801 lib1 = '{}/ATLMFC/lib/{}'.format(msvc_tools_root,tgt)802 lib2 = '{}/lib/{}'.format(msvc_tools_root,tgt)803 add_env(lib, lib1)804 add_env(lib, lib2)805 add_env(lib, '{}lib/um/{}'.format(netfx_sdk,tgt))806 add_env(lib, '{}/ucrt/{}'.format(wkl,tgt))807 add_env(lib, '{}/um/{}'.format(wkl,tgt))808 # LIBPATH809 add_env(libpath, lib1)810 add_env(libpath, lib2)811 add_env(libpath, winkit10 + '/UnionMetadata')812 add_env(libpath, winkit10 + '/References')813 s = ''814 if tgt == 'x64':815 s = '64'816 fwr = 'C:/windows/Microsoft.NET/Framework{}'.format(s)817 fwr64 = 'C:/windows/Microsoft.NET/Framework64'818 fwv = 'v4.0.30319'819 fwp = '{}/{}'.format(fwr,fwv)820 add_env(libpath, fwp)821 # PATH822 # locations for cross compilers changed in this version823 set_msvc_compilers(env, msvc_tools_root)824 x86_to_x64 = env['msvc_compilers']['ia32']['ia32'] 825 x86_to_x86 = env['msvc_compilers']['ia32']['x86-64']826 x64_to_x86 = env['msvc_compilers']['x86-64']['ia32'] 827 x64_to_x64 = env['msvc_compilers']['x86-64']['x86-64'] 828 829 cross = False830 if x64_host:831 if x64_target:832 cl_tgt_bin_dir = x64_to_x64833 else:834 cross = True835 cl_tgt_bin_dir = x64_to_x86836 cl_host_bin_dir = x64_to_x64837 else: 838 if x64_target:839 cross = True840 cl_tgt_bin_dir = x86_to_x64841 cl_host_bin_dir = x64_to_x86842 else:843 cl_tgt_bin_dir = x86_to_x86844 845 add_env(path, cl_tgt_bin_dir)846 # CL TARGET compiler gets DLLs from the HOST bin dir847 if cross:848 add_env(path, cl_host_bin_dir)849 850 add_env(path, '{}/Common7/IDE/VC/VCPackages'.format(msvc_tools_root))851 add_env(path, '{}/Common7/IDE/CommonExtensions/Microsoft/TestWindow'.format(msvc_tools_root))852 add_env(path, '{}/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer'.format(msvc_tools_root))853 add_env(path, '{}/MSBuild/15.0/bin/Roslyn'.format(msvc_tools_root))854 add_env(path, '{}/Team Tools/Performance Tools'.format(msvc_tools_root))855 856 add_env(path, progfi + '/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools')857 netfx_tools = progfi + '/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.6.1 Tools'858 add_env(path, netfx_tools)859 add_env(path, '{}/bin/{}'.format(winkit10,tgt))860 add_env(path, '{}/bin/{}/{}'.format(winkit10,winkit10version,tgt))861 add_env(path, '{}/MSBuild/15.0/bin'.format(vprefix))862 add_env(path, fwp)863 add_env(path, '{}/Common7/IDE'.format(vprefix))864 add_env(path, '{}/Common7/Tools'.format(vprefix))865 set_env_list('INCLUDE',inc)866 set_env_list('LIB',lib)867 set_env_list('LIBPATH',libpath)868 add_to_front_list('PATH',path)869 if 0:870 msgb("INCLUDE", "\n\t".join(inc))871 msgb("LIB", "\n\t".join(lib))872 msgb("LIBPATH", "\n\t".join(libpath))873 msgb("PATH", "\n\t".join(path))874 # Misc env variables. Not sure which are needed, if any875 set_env('NETFXSDKDir',netfx_sdk)876 set_env('DevEnvDir', vprefix + '/Common7/IDE/')877 set_env('ExtensionSdkDir', progfi + '/Microsoft SDKs/Windows Kits/10/ExtensionSDKs')878 set_env('Framework40Version','v4.0')879 set_env('FrameworkVersion',fwv)880 if x64_host:881 set_env('VSCMD_ARG_HOST_ARCH','x64')882 else:883 set_env('VSCMD_ARG_HOST_ARCH','x86')884 885 set_env('Platform',tgt)886 set_env('VSCMD_ARG_TGT_ARCH',tgt)887 888 if x64_target:889 set_env('FrameworkDir', fwr)890 set_env('FrameworkDIR64',fwr)891 set_env('FrameworkVersion64',fwv)892 else: 893 set_env('FrameworkDIR32',fwr)894 set_env('FrameworkVersion32',fwv)895 if x64_host:896 set_env('FrameworkDir', fwr64)897 set_env('FrameworkDIR64',fwr64)898 set_env('FrameworkVersion64',fwv)899 else:900 set_env('FrameworkDir', fwr)901 902 set_env('UCRTVersion', winkit10version)903 set_env('WindowsSDKLibVersion', winkit10version + '/')904 set_env('WindowsSDKVersion', winkit10version + '/')905 set_env('WindowsSdkVerBinPath', '{}/bin/{}/'.format(winkit10,winkit10version))906 set_env('WindowsSdkBinPath', winkit10 + '/bin/')907 set_env('WindowsSdkDir', winkit10 + '/')908 set_env('UniversalCRTSdkDir',winkit10 + '/')909 set_env('WindowsLibPath', winkit10 + '/UnionMetadata;' + winkit10 + '/References')910 911 set_env('VCIDEInstallDir', vprefix + '/Common7/IDE/VC/')912 set_env('VCINSTALLDIR', vprefix + '/VC/')913 set_env('VCToolsInstallDir', vprefix + '/VC/Tools/MSVC/' + msvc_ver + '/')914 set_env('VCToolsRedistDir', vprefix + '/VC/Redist/MSVC/' + msvc_ver + '/')915 set_env('VS150COMNTOOLS', vprefix + '/Common7/Tools/')916 set_env('VSINSTALLDIR', vprefix + '/')917 set_env('VisualStudioVersion', '15.0')918 919 set_env('WindowsSDK_ExecutablePath_x64', netfx_tools + '/x64/')920 set_env('WindowsSDK_ExecutablePath_x86', netfx_tools + '/')921 922 return vprefix + '/VC'923def _set_msvs_dev14(env, x64_host, x64_target, regv=None): # msvs 2015924 progfi = 'C:/Program Files (x86)'925 if regv:926 prefix = regv927 else:928 prefix = progfi + '/Microsoft Visual Studio 14.0'929 930 sdk81a = progfi + '/Microsoft SDKs/Windows/v8.1A'931 sdk81 = progfi + '/Microsoft SDKs/Windows/v8.1'932 sdk10a = progfi + '/Microsoft SDKs/Windows/v10.0A'933 if os.path.exists(sdk10a):934 sdk81a = None935 sdk81 = None936 else:937 sdk10a = None938 939 winkit8 = progfi + '/Windows Kits/8.1'940 winkit10 = progfi + '/Windows Kits/10'941 if os.path.exists(winkit10):942 winkit = winkit10943 sdk81 = None944 sdk81a = None945 else:946 winkit = winkit8947 winkit10 = None948 winkit10version, winkit10complete = _get_winkit10_version(env,winkit10)949 # if winkit10complete is False, we need to fall back on 950 # winkit8 for some stuff951 if winkit10complete:952 env['rc_winkit'] = winkit10953 env['rc_winkit_number'] = winkit10version954 else:955 env['rc_winkit'] = winkit8956 path = []957 lib = []958 libpath = []959 inc = []960 add_env(inc, prefix + '/VC/INCLUDE')961 add_env(inc, prefix + '/VC/ATLMFC/INCLUDE')962 if winkit10version:963 t = '{}/include/{}'.format(winkit10,winkit10version)964 add_env(inc, t + '/ucrt')965 if winkit10version and winkit10complete:966 add_env(inc, t + '/shared')967 add_env(inc, t + '/um')968 add_env(inc, t + '/winrt')969 else:970 add_env(inc, winkit8 + '/include') # not used in msvs12971 add_env(inc, winkit8 + '/include/shared')972 add_env(inc, winkit8 + '/include/um')973 add_env(inc, winkit8 + '/include/winrt')974 set_env_list('INCLUDE',inc)975 set_env('Framework40Version', 'v4.0')976 set_env('FrameworkVersion', 'v4.0.30319')977 #set_env('ExtensionSdkDir', sdk81 + '/ExtensionSDKs')978 set_env('VCINSTALLDIR', prefix + '/VC/')979 set_env('VS140COMNTOOLS', prefix + '/Common7/Tools')980 set_env('VSINSTALLDIR' , prefix)981 set_env('WindowsSdkDir', winkit + '/')982 set_env('VisualStudioVersion','14.0')983 if sdk10a:984 set_env('WindowsSDK_ExecutablePath_x86',985 sdk10a + '/bin/NETFX 4.6.1 Tools/')986 elif sdk81a:987 set_env('WindowsSDK_ExecutablePath_x86',988 sdk81a + '/bin/NETFX 4.5.1 Tools/')989 990 if x64_target:991 if sdk10a:992 set_env('WindowsSDK_ExecutablePath_x64',993 sdk10a +'/bin/NETFX 4.6.1 Tools/x64/')994 elif sdk81a:995 set_env('WindowsSDK_ExecutablePath_x64',996 sdk81a +'/bin/NETFX 4.5.1 Tools/x64/')997 set_env('FrameworkDir','c:/WINDOWS/Microsoft.NET/Framework64')998 set_env('FrameworkDIR64','c:/WINDOWS/Microsoft.NET/Framework64')999 set_env('FrameworkVersion64', 'v4.0.30319')1000 set_env('Platform','X64')1001 add_env(lib, prefix + '/VC/LIB/amd64')1002 add_env(lib, prefix + '/VC/ATLMFC/LIB/amd64')1003 if winkit10version:1004 add_env(lib, winkit10 + '/lib/{}/ucrt/x64'.format(winkit10version))1005 if winkit10version and winkit10complete:1006 add_env(lib, winkit10 + '/lib/{}/um/x64'.format(winkit10version))1007 else:1008 add_env(lib, winkit8 + '/lib/winv6.3/um/x64')1009 add_env(libpath, 'c:/WINDOWS/Microsoft.NET/Framework64/v4.0.30319')1010 add_env(libpath, prefix + '/VC/LIB/amd64')1011 add_env(libpath, prefix + '/VC/ATLMFC/LIB/amd64')1012 if not winkit10:1013 add_env(libpath, winkit + '/References/CommonConfiguration/Neutral')1014 # next one is usually not present and I am unclear of value/need1015 #if sdk81:1016 # add_env(libpath, sdk81 + '/ExtensionSDKs/Microsoft.VCLibs/14.0/' + 1017 # 'References/CommonConfiguration/neutral')1018 add_env(path, prefix + '/Common7/IDE/CommonExtensions/Microsoft/TestWindow')1019 add_env(path, prefix + '/VC/BIN/amd64')1020 add_env(path, 'c:/WINDOWS/Microsoft.NET/Framework64/v4.0.30319')1021 add_env(path, prefix + '/VC/VCPackages')1022 add_env(path, prefix + '/Common7/IDE')1023 add_env(path, prefix + '/Common7/Tools')1024 add_env(path, 'C:/Program Files (x86)/HTML Help Workshop')1025 add_env(path, prefix + '/Team Tools/Performance Tools/x64')1026 add_env(path, prefix + '/Team Tools/Performance Tools')1027 1028 if winkit10complete:1029 t = winkit101030 else:1031 t = winkit81032 add_env(path, t + '/bin/x64')1033 add_env(path, t + '/bin/x86')1034 1035 if sdk10a:1036 b = _find_latest_subdir(sdk10a + '/bin/')1037 add_env(path, b + '/x64')1038 elif sdk81a:1039 add_env(path, sdk81a + '/bin/NETFX 4.5.1 Tools/x64')1040 else: # 32b1041 set_env('FrameworkDir', 'c:/WINDOWS/Microsoft.NET/Framework')1042 set_env('FrameworkDIR32', 'c:/WINDOWS/Microsoft.NET/Framework')1043 set_env('FrameworkVersion32','v4.0.30319')1044 add_env(lib, prefix + '/VC/LIB')1045 add_env(lib, prefix + '/VC/ATLMFC/LIB')1046 if winkit10version:1047 add_env(lib, winkit10 + '/lib/{}/ucrt/x86'.format(winkit10version))1048 if winkit10version and winkit10complete:1049 add_env(lib, winkit10 + '/lib/{}/um/x86'.format(winkit10version))1050 else:1051 add_env(lib, winkit8 + '/lib/winv6.3/um/x86')1052 1053 add_env(libpath, 'c:/WINDOWS/Microsoft.NET/Framework/v4.0.30319')1054 add_env(libpath, prefix + '/VC/LIB')1055 add_env(libpath, prefix + '/VC/ATLMFC/LIB')1056 if not winkit10complete:1057 add_env(libpath, winkit8 + '/References/CommonConfiguration/Neutral')...
config.py
Source:config.py
...33 def __repr__(self):34 return '<ConfigurationErrorException({0})>'.format(self.name)35 def __str__(self):36 return '{0} is misconfigured. (See previouse traceback)'.format(self.name)37def set_env(name, default=None, required=True, post=lambda x:x):38 """39 Helper function to check for environment variables and40 set them up in globals. If default is a callable, then41 name will be set to the return value of default().42 You can optionally set a post function that will 43 be run on the variable. (Useful for setting the type).44 """45 g = globals()46 try:47 g[name] = os.environ.get('LSGEN_'+name, default)48 if g[name] == default and callable(default):49 g[name] = default()50 g[name] = post(g[name])51 except:52 traceback.print_exc()53 print '=' * 5054 raise ConfigurationErrorException(name)55 if g[name] is None and required:56 raise RequiredConfigurationException(name)57set_env('LDAP_URI')58set_env('LDAP_BASE')59set_env('LDAP_DOMAIN', required=False)60set_env('LDAP_AUTH_FILTER', 'objectCategory=Person')61set_env('LDAP_FILTER', 'objectCategory=Person')62set_env('LDAP_USERNAME_ATTR', 'uid')63set_env('LDAP_NAME_ATTR', 'cn')64set_env('LDAP_USERNAME_REGEX', required=False, post=_re_compile)65set_env('LDAP_TIMEOUT', 5, post=int)66set_env('LDAP_SIZELIMIT', 10, post=int)67set_env('LDAP_BIND_USER', '')68set_env('LDAP_BIND_PASSWD', '')69set_env('LDAP_CACERTFILE', '/etc/ssl/certs/ca-certificates.crt', required=False)70set_env('LOGIN_REGEX', '^[a-zA-Z0-9\-\._]+$', post=_re_compile)71set_env('SEARCH_REGEX', '^[a-zA-Z0-9\-\._\* ]+$', post=_re_compile)72set_env('SECRET', default=_secret_gen)73set_env('USE_CDN', True, post=_eval_boolean)74set_env('DEBUG', False, post=_eval_boolean)75def _initialize():76 ldap.set_option(ldap.OPT_SIZELIMIT, LDAP_SIZELIMIT)77 if LDAP_URI.startswith('ldaps://'):78 ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, LDAP_CACERTFILE)79 # create import regex from given options80 if LDAP_USERNAME_REGEX:81 regex = LDAP_USERNAME_REGEX.pattern82 else:83 regex = LOGIN_REGEX.pattern84 # strip beginning and ending markers so regex can be85 # inserted into another expression86 if regex.startswith('^'):87 regex = regex[1:]88 if regex.endswith('$'):...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!