d6e91e1e09eb466206a264ca7561cbe8c4bd195d3977ead18403fc526e352ee75f78a77ac7bb4b76977a3a0a12c8b8db0b98f10a219c0719259f825d1f59a3 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547
  1. #!/usr/bin/env python3
  2. # Copyright (c) 2012 Google Inc. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """Unit tests for the MSVSSettings.py file."""
  6. import unittest
  7. import gyp.MSVSSettings as MSVSSettings
  8. from io import StringIO
  9. class TestSequenceFunctions(unittest.TestCase):
  10. def setUp(self):
  11. self.stderr = StringIO()
  12. def _ExpectedWarnings(self, expected):
  13. """Compares recorded lines to expected warnings."""
  14. self.stderr.seek(0)
  15. actual = self.stderr.read().split("\n")
  16. actual = [line for line in actual if line]
  17. self.assertEqual(sorted(expected), sorted(actual))
  18. def testValidateMSVSSettings_tool_names(self):
  19. """Tests that only MSVS tool names are allowed."""
  20. MSVSSettings.ValidateMSVSSettings(
  21. {
  22. "VCCLCompilerTool": {},
  23. "VCLinkerTool": {},
  24. "VCMIDLTool": {},
  25. "foo": {},
  26. "VCResourceCompilerTool": {},
  27. "VCLibrarianTool": {},
  28. "VCManifestTool": {},
  29. "ClCompile": {},
  30. },
  31. self.stderr,
  32. )
  33. self._ExpectedWarnings(
  34. ["Warning: unrecognized tool foo", "Warning: unrecognized tool ClCompile"]
  35. )
  36. def testValidateMSVSSettings_settings(self):
  37. """Tests that for invalid MSVS settings."""
  38. MSVSSettings.ValidateMSVSSettings(
  39. {
  40. "VCCLCompilerTool": {
  41. "AdditionalIncludeDirectories": "folder1;folder2",
  42. "AdditionalOptions": ["string1", "string2"],
  43. "AdditionalUsingDirectories": "folder1;folder2",
  44. "AssemblerListingLocation": "a_file_name",
  45. "AssemblerOutput": "0",
  46. "BasicRuntimeChecks": "5",
  47. "BrowseInformation": "fdkslj",
  48. "BrowseInformationFile": "a_file_name",
  49. "BufferSecurityCheck": "true",
  50. "CallingConvention": "-1",
  51. "CompileAs": "1",
  52. "DebugInformationFormat": "2",
  53. "DefaultCharIsUnsigned": "true",
  54. "Detect64BitPortabilityProblems": "true",
  55. "DisableLanguageExtensions": "true",
  56. "DisableSpecificWarnings": "string1;string2",
  57. "EnableEnhancedInstructionSet": "1",
  58. "EnableFiberSafeOptimizations": "true",
  59. "EnableFunctionLevelLinking": "true",
  60. "EnableIntrinsicFunctions": "true",
  61. "EnablePREfast": "true",
  62. "Enableprefast": "bogus",
  63. "ErrorReporting": "1",
  64. "ExceptionHandling": "1",
  65. "ExpandAttributedSource": "true",
  66. "FavorSizeOrSpeed": "1",
  67. "FloatingPointExceptions": "true",
  68. "FloatingPointModel": "1",
  69. "ForceConformanceInForLoopScope": "true",
  70. "ForcedIncludeFiles": "file1;file2",
  71. "ForcedUsingFiles": "file1;file2",
  72. "GeneratePreprocessedFile": "1",
  73. "GenerateXMLDocumentationFiles": "true",
  74. "IgnoreStandardIncludePath": "true",
  75. "InlineFunctionExpansion": "1",
  76. "KeepComments": "true",
  77. "MinimalRebuild": "true",
  78. "ObjectFile": "a_file_name",
  79. "OmitDefaultLibName": "true",
  80. "OmitFramePointers": "true",
  81. "OpenMP": "true",
  82. "Optimization": "1",
  83. "PrecompiledHeaderFile": "a_file_name",
  84. "PrecompiledHeaderThrough": "a_file_name",
  85. "PreprocessorDefinitions": "string1;string2",
  86. "ProgramDataBaseFileName": "a_file_name",
  87. "RuntimeLibrary": "1",
  88. "RuntimeTypeInfo": "true",
  89. "ShowIncludes": "true",
  90. "SmallerTypeCheck": "true",
  91. "StringPooling": "true",
  92. "StructMemberAlignment": "1",
  93. "SuppressStartupBanner": "true",
  94. "TreatWChar_tAsBuiltInType": "true",
  95. "UndefineAllPreprocessorDefinitions": "true",
  96. "UndefinePreprocessorDefinitions": "string1;string2",
  97. "UseFullPaths": "true",
  98. "UsePrecompiledHeader": "1",
  99. "UseUnicodeResponseFiles": "true",
  100. "WarnAsError": "true",
  101. "WarningLevel": "1",
  102. "WholeProgramOptimization": "true",
  103. "XMLDocumentationFileName": "a_file_name",
  104. "ZZXYZ": "bogus",
  105. },
  106. "VCLinkerTool": {
  107. "AdditionalDependencies": "file1;file2",
  108. "AdditionalDependencies_excluded": "file3",
  109. "AdditionalLibraryDirectories": "folder1;folder2",
  110. "AdditionalManifestDependencies": "file1;file2",
  111. "AdditionalOptions": "a string1",
  112. "AddModuleNamesToAssembly": "file1;file2",
  113. "AllowIsolation": "true",
  114. "AssemblyDebug": "2",
  115. "AssemblyLinkResource": "file1;file2",
  116. "BaseAddress": "a string1",
  117. "CLRImageType": "2",
  118. "CLRThreadAttribute": "2",
  119. "CLRUnmanagedCodeCheck": "true",
  120. "DataExecutionPrevention": "2",
  121. "DelayLoadDLLs": "file1;file2",
  122. "DelaySign": "true",
  123. "Driver": "2",
  124. "EmbedManagedResourceFile": "file1;file2",
  125. "EnableCOMDATFolding": "2",
  126. "EnableUAC": "true",
  127. "EntryPointSymbol": "a string1",
  128. "ErrorReporting": "2",
  129. "FixedBaseAddress": "2",
  130. "ForceSymbolReferences": "file1;file2",
  131. "FunctionOrder": "a_file_name",
  132. "GenerateDebugInformation": "true",
  133. "GenerateManifest": "true",
  134. "GenerateMapFile": "true",
  135. "HeapCommitSize": "a string1",
  136. "HeapReserveSize": "a string1",
  137. "IgnoreAllDefaultLibraries": "true",
  138. "IgnoreDefaultLibraryNames": "file1;file2",
  139. "IgnoreEmbeddedIDL": "true",
  140. "IgnoreImportLibrary": "true",
  141. "ImportLibrary": "a_file_name",
  142. "KeyContainer": "a_file_name",
  143. "KeyFile": "a_file_name",
  144. "LargeAddressAware": "2",
  145. "LinkIncremental": "2",
  146. "LinkLibraryDependencies": "true",
  147. "LinkTimeCodeGeneration": "2",
  148. "ManifestFile": "a_file_name",
  149. "MapExports": "true",
  150. "MapFileName": "a_file_name",
  151. "MergedIDLBaseFileName": "a_file_name",
  152. "MergeSections": "a string1",
  153. "MidlCommandFile": "a_file_name",
  154. "ModuleDefinitionFile": "a_file_name",
  155. "OptimizeForWindows98": "1",
  156. "OptimizeReferences": "2",
  157. "OutputFile": "a_file_name",
  158. "PerUserRedirection": "true",
  159. "Profile": "true",
  160. "ProfileGuidedDatabase": "a_file_name",
  161. "ProgramDatabaseFile": "a_file_name",
  162. "RandomizedBaseAddress": "2",
  163. "RegisterOutput": "true",
  164. "ResourceOnlyDLL": "true",
  165. "SetChecksum": "true",
  166. "ShowProgress": "2",
  167. "StackCommitSize": "a string1",
  168. "StackReserveSize": "a string1",
  169. "StripPrivateSymbols": "a_file_name",
  170. "SubSystem": "2",
  171. "SupportUnloadOfDelayLoadedDLL": "true",
  172. "SuppressStartupBanner": "true",
  173. "SwapRunFromCD": "true",
  174. "SwapRunFromNet": "true",
  175. "TargetMachine": "2",
  176. "TerminalServerAware": "2",
  177. "TurnOffAssemblyGeneration": "true",
  178. "TypeLibraryFile": "a_file_name",
  179. "TypeLibraryResourceID": "33",
  180. "UACExecutionLevel": "2",
  181. "UACUIAccess": "true",
  182. "UseLibraryDependencyInputs": "true",
  183. "UseUnicodeResponseFiles": "true",
  184. "Version": "a string1",
  185. },
  186. "VCMIDLTool": {
  187. "AdditionalIncludeDirectories": "folder1;folder2",
  188. "AdditionalOptions": "a string1",
  189. "CPreprocessOptions": "a string1",
  190. "DefaultCharType": "1",
  191. "DLLDataFileName": "a_file_name",
  192. "EnableErrorChecks": "1",
  193. "ErrorCheckAllocations": "true",
  194. "ErrorCheckBounds": "true",
  195. "ErrorCheckEnumRange": "true",
  196. "ErrorCheckRefPointers": "true",
  197. "ErrorCheckStubData": "true",
  198. "GenerateStublessProxies": "true",
  199. "GenerateTypeLibrary": "true",
  200. "HeaderFileName": "a_file_name",
  201. "IgnoreStandardIncludePath": "true",
  202. "InterfaceIdentifierFileName": "a_file_name",
  203. "MkTypLibCompatible": "true",
  204. "notgood": "bogus",
  205. "OutputDirectory": "a string1",
  206. "PreprocessorDefinitions": "string1;string2",
  207. "ProxyFileName": "a_file_name",
  208. "RedirectOutputAndErrors": "a_file_name",
  209. "StructMemberAlignment": "1",
  210. "SuppressStartupBanner": "true",
  211. "TargetEnvironment": "1",
  212. "TypeLibraryName": "a_file_name",
  213. "UndefinePreprocessorDefinitions": "string1;string2",
  214. "ValidateParameters": "true",
  215. "WarnAsError": "true",
  216. "WarningLevel": "1",
  217. },
  218. "VCResourceCompilerTool": {
  219. "AdditionalOptions": "a string1",
  220. "AdditionalIncludeDirectories": "folder1;folder2",
  221. "Culture": "1003",
  222. "IgnoreStandardIncludePath": "true",
  223. "notgood2": "bogus",
  224. "PreprocessorDefinitions": "string1;string2",
  225. "ResourceOutputFileName": "a string1",
  226. "ShowProgress": "true",
  227. "SuppressStartupBanner": "true",
  228. "UndefinePreprocessorDefinitions": "string1;string2",
  229. },
  230. "VCLibrarianTool": {
  231. "AdditionalDependencies": "file1;file2",
  232. "AdditionalLibraryDirectories": "folder1;folder2",
  233. "AdditionalOptions": "a string1",
  234. "ExportNamedFunctions": "string1;string2",
  235. "ForceSymbolReferences": "a string1",
  236. "IgnoreAllDefaultLibraries": "true",
  237. "IgnoreSpecificDefaultLibraries": "file1;file2",
  238. "LinkLibraryDependencies": "true",
  239. "ModuleDefinitionFile": "a_file_name",
  240. "OutputFile": "a_file_name",
  241. "SuppressStartupBanner": "true",
  242. "UseUnicodeResponseFiles": "true",
  243. },
  244. "VCManifestTool": {
  245. "AdditionalManifestFiles": "file1;file2",
  246. "AdditionalOptions": "a string1",
  247. "AssemblyIdentity": "a string1",
  248. "ComponentFileName": "a_file_name",
  249. "DependencyInformationFile": "a_file_name",
  250. "GenerateCatalogFiles": "true",
  251. "InputResourceManifests": "a string1",
  252. "ManifestResourceFile": "a_file_name",
  253. "OutputManifestFile": "a_file_name",
  254. "RegistrarScriptFile": "a_file_name",
  255. "ReplacementsFile": "a_file_name",
  256. "SuppressStartupBanner": "true",
  257. "TypeLibraryFile": "a_file_name",
  258. "UpdateFileHashes": "truel",
  259. "UpdateFileHashesSearchPath": "a_file_name",
  260. "UseFAT32Workaround": "true",
  261. "UseUnicodeResponseFiles": "true",
  262. "VerboseOutput": "true",
  263. },
  264. },
  265. self.stderr,
  266. )
  267. self._ExpectedWarnings(
  268. [
  269. "Warning: for VCCLCompilerTool/BasicRuntimeChecks, "
  270. "index value (5) not in expected range [0, 4)",
  271. "Warning: for VCCLCompilerTool/BrowseInformation, "
  272. "invalid literal for int() with base 10: 'fdkslj'",
  273. "Warning: for VCCLCompilerTool/CallingConvention, "
  274. "index value (-1) not in expected range [0, 4)",
  275. "Warning: for VCCLCompilerTool/DebugInformationFormat, "
  276. "converted value for 2 not specified.",
  277. "Warning: unrecognized setting VCCLCompilerTool/Enableprefast",
  278. "Warning: unrecognized setting VCCLCompilerTool/ZZXYZ",
  279. "Warning: for VCLinkerTool/TargetMachine, "
  280. "converted value for 2 not specified.",
  281. "Warning: unrecognized setting VCMIDLTool/notgood",
  282. "Warning: unrecognized setting VCResourceCompilerTool/notgood2",
  283. "Warning: for VCManifestTool/UpdateFileHashes, "
  284. "expected bool; got 'truel'"
  285. "",
  286. ]
  287. )
  288. def testValidateMSBuildSettings_settings(self):
  289. """Tests that for invalid MSBuild settings."""
  290. MSVSSettings.ValidateMSBuildSettings(
  291. {
  292. "ClCompile": {
  293. "AdditionalIncludeDirectories": "folder1;folder2",
  294. "AdditionalOptions": ["string1", "string2"],
  295. "AdditionalUsingDirectories": "folder1;folder2",
  296. "AssemblerListingLocation": "a_file_name",
  297. "AssemblerOutput": "NoListing",
  298. "BasicRuntimeChecks": "StackFrameRuntimeCheck",
  299. "BrowseInformation": "false",
  300. "BrowseInformationFile": "a_file_name",
  301. "BufferSecurityCheck": "true",
  302. "BuildingInIDE": "true",
  303. "CallingConvention": "Cdecl",
  304. "CompileAs": "CompileAsC",
  305. "CompileAsManaged": "true",
  306. "CreateHotpatchableImage": "true",
  307. "DebugInformationFormat": "ProgramDatabase",
  308. "DisableLanguageExtensions": "true",
  309. "DisableSpecificWarnings": "string1;string2",
  310. "EnableEnhancedInstructionSet": "StreamingSIMDExtensions",
  311. "EnableFiberSafeOptimizations": "true",
  312. "EnablePREfast": "true",
  313. "Enableprefast": "bogus",
  314. "ErrorReporting": "Prompt",
  315. "ExceptionHandling": "SyncCThrow",
  316. "ExpandAttributedSource": "true",
  317. "FavorSizeOrSpeed": "Neither",
  318. "FloatingPointExceptions": "true",
  319. "FloatingPointModel": "Precise",
  320. "ForceConformanceInForLoopScope": "true",
  321. "ForcedIncludeFiles": "file1;file2",
  322. "ForcedUsingFiles": "file1;file2",
  323. "FunctionLevelLinking": "false",
  324. "GenerateXMLDocumentationFiles": "true",
  325. "IgnoreStandardIncludePath": "true",
  326. "InlineFunctionExpansion": "OnlyExplicitInline",
  327. "IntrinsicFunctions": "false",
  328. "MinimalRebuild": "true",
  329. "MultiProcessorCompilation": "true",
  330. "ObjectFileName": "a_file_name",
  331. "OmitDefaultLibName": "true",
  332. "OmitFramePointers": "true",
  333. "OpenMPSupport": "true",
  334. "Optimization": "Disabled",
  335. "PrecompiledHeader": "NotUsing",
  336. "PrecompiledHeaderFile": "a_file_name",
  337. "PrecompiledHeaderOutputFile": "a_file_name",
  338. "PreprocessKeepComments": "true",
  339. "PreprocessorDefinitions": "string1;string2",
  340. "PreprocessOutputPath": "a string1",
  341. "PreprocessSuppressLineNumbers": "false",
  342. "PreprocessToFile": "false",
  343. "ProcessorNumber": "33",
  344. "ProgramDataBaseFileName": "a_file_name",
  345. "RuntimeLibrary": "MultiThreaded",
  346. "RuntimeTypeInfo": "true",
  347. "ShowIncludes": "true",
  348. "SmallerTypeCheck": "true",
  349. "StringPooling": "true",
  350. "StructMemberAlignment": "1Byte",
  351. "SuppressStartupBanner": "true",
  352. "TrackerLogDirectory": "a_folder",
  353. "TreatSpecificWarningsAsErrors": "string1;string2",
  354. "TreatWarningAsError": "true",
  355. "TreatWChar_tAsBuiltInType": "true",
  356. "UndefineAllPreprocessorDefinitions": "true",
  357. "UndefinePreprocessorDefinitions": "string1;string2",
  358. "UseFullPaths": "true",
  359. "UseUnicodeForAssemblerListing": "true",
  360. "WarningLevel": "TurnOffAllWarnings",
  361. "WholeProgramOptimization": "true",
  362. "XMLDocumentationFileName": "a_file_name",
  363. "ZZXYZ": "bogus",
  364. },
  365. "Link": {
  366. "AdditionalDependencies": "file1;file2",
  367. "AdditionalLibraryDirectories": "folder1;folder2",
  368. "AdditionalManifestDependencies": "file1;file2",
  369. "AdditionalOptions": "a string1",
  370. "AddModuleNamesToAssembly": "file1;file2",
  371. "AllowIsolation": "true",
  372. "AssemblyDebug": "",
  373. "AssemblyLinkResource": "file1;file2",
  374. "BaseAddress": "a string1",
  375. "BuildingInIDE": "true",
  376. "CLRImageType": "ForceIJWImage",
  377. "CLRSupportLastError": "Enabled",
  378. "CLRThreadAttribute": "MTAThreadingAttribute",
  379. "CLRUnmanagedCodeCheck": "true",
  380. "CreateHotPatchableImage": "X86Image",
  381. "DataExecutionPrevention": "false",
  382. "DelayLoadDLLs": "file1;file2",
  383. "DelaySign": "true",
  384. "Driver": "NotSet",
  385. "EmbedManagedResourceFile": "file1;file2",
  386. "EnableCOMDATFolding": "false",
  387. "EnableUAC": "true",
  388. "EntryPointSymbol": "a string1",
  389. "FixedBaseAddress": "false",
  390. "ForceFileOutput": "Enabled",
  391. "ForceSymbolReferences": "file1;file2",
  392. "FunctionOrder": "a_file_name",
  393. "GenerateDebugInformation": "true",
  394. "GenerateMapFile": "true",
  395. "HeapCommitSize": "a string1",
  396. "HeapReserveSize": "a string1",
  397. "IgnoreAllDefaultLibraries": "true",
  398. "IgnoreEmbeddedIDL": "true",
  399. "IgnoreSpecificDefaultLibraries": "a_file_list",
  400. "ImageHasSafeExceptionHandlers": "true",
  401. "ImportLibrary": "a_file_name",
  402. "KeyContainer": "a_file_name",
  403. "KeyFile": "a_file_name",
  404. "LargeAddressAware": "false",
  405. "LinkDLL": "true",
  406. "LinkErrorReporting": "SendErrorReport",
  407. "LinkStatus": "true",
  408. "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration",
  409. "ManifestFile": "a_file_name",
  410. "MapExports": "true",
  411. "MapFileName": "a_file_name",
  412. "MergedIDLBaseFileName": "a_file_name",
  413. "MergeSections": "a string1",
  414. "MidlCommandFile": "a_file_name",
  415. "MinimumRequiredVersion": "a string1",
  416. "ModuleDefinitionFile": "a_file_name",
  417. "MSDOSStubFileName": "a_file_name",
  418. "NoEntryPoint": "true",
  419. "OptimizeReferences": "false",
  420. "OutputFile": "a_file_name",
  421. "PerUserRedirection": "true",
  422. "PreventDllBinding": "true",
  423. "Profile": "true",
  424. "ProfileGuidedDatabase": "a_file_name",
  425. "ProgramDatabaseFile": "a_file_name",
  426. "RandomizedBaseAddress": "false",
  427. "RegisterOutput": "true",
  428. "SectionAlignment": "33",
  429. "SetChecksum": "true",
  430. "ShowProgress": "LinkVerboseREF",
  431. "SpecifySectionAttributes": "a string1",
  432. "StackCommitSize": "a string1",
  433. "StackReserveSize": "a string1",
  434. "StripPrivateSymbols": "a_file_name",
  435. "SubSystem": "Console",
  436. "SupportNobindOfDelayLoadedDLL": "true",
  437. "SupportUnloadOfDelayLoadedDLL": "true",
  438. "SuppressStartupBanner": "true",
  439. "SwapRunFromCD": "true",
  440. "SwapRunFromNET": "true",
  441. "TargetMachine": "MachineX86",
  442. "TerminalServerAware": "false",
  443. "TrackerLogDirectory": "a_folder",
  444. "TreatLinkerWarningAsErrors": "true",
  445. "TurnOffAssemblyGeneration": "true",
  446. "TypeLibraryFile": "a_file_name",
  447. "TypeLibraryResourceID": "33",
  448. "UACExecutionLevel": "AsInvoker",
  449. "UACUIAccess": "true",
  450. "Version": "a string1",
  451. },
  452. "ResourceCompile": {
  453. "AdditionalIncludeDirectories": "folder1;folder2",
  454. "AdditionalOptions": "a string1",
  455. "Culture": "0x236",
  456. "IgnoreStandardIncludePath": "true",
  457. "NullTerminateStrings": "true",
  458. "PreprocessorDefinitions": "string1;string2",
  459. "ResourceOutputFileName": "a string1",
  460. "ShowProgress": "true",
  461. "SuppressStartupBanner": "true",
  462. "TrackerLogDirectory": "a_folder",
  463. "UndefinePreprocessorDefinitions": "string1;string2",
  464. },
  465. "Midl": {
  466. "AdditionalIncludeDirectories": "folder1;folder2",
  467. "AdditionalOptions": "a string1",
  468. "ApplicationConfigurationMode": "true",
  469. "ClientStubFile": "a_file_name",
  470. "CPreprocessOptions": "a string1",
  471. "DefaultCharType": "Signed",
  472. "DllDataFileName": "a_file_name",
  473. "EnableErrorChecks": "EnableCustom",
  474. "ErrorCheckAllocations": "true",
  475. "ErrorCheckBounds": "true",
  476. "ErrorCheckEnumRange": "true",
  477. "ErrorCheckRefPointers": "true",
  478. "ErrorCheckStubData": "true",
  479. "GenerateClientFiles": "Stub",
  480. "GenerateServerFiles": "None",
  481. "GenerateStublessProxies": "true",
  482. "GenerateTypeLibrary": "true",
  483. "HeaderFileName": "a_file_name",
  484. "IgnoreStandardIncludePath": "true",
  485. "InterfaceIdentifierFileName": "a_file_name",
  486. "LocaleID": "33",
  487. "MkTypLibCompatible": "true",
  488. "OutputDirectory": "a string1",
  489. "PreprocessorDefinitions": "string1;string2",
  490. "ProxyFileName": "a_file_name",
  491. "RedirectOutputAndErrors": "a_file_name",
  492. "ServerStubFile": "a_file_name",
  493. "StructMemberAlignment": "NotSet",
  494. "SuppressCompilerWarnings": "true",
  495. "SuppressStartupBanner": "true",
  496. "TargetEnvironment": "Itanium",
  497. "TrackerLogDirectory": "a_folder",
  498. "TypeLibFormat": "NewFormat",
  499. "TypeLibraryName": "a_file_name",
  500. "UndefinePreprocessorDefinitions": "string1;string2",
  501. "ValidateAllParameters": "true",
  502. "WarnAsError": "true",
  503. "WarningLevel": "1",
  504. },
  505. "Lib": {
  506. "AdditionalDependencies": "file1;file2",
  507. "AdditionalLibraryDirectories": "folder1;folder2",
  508. "AdditionalOptions": "a string1",
  509. "DisplayLibrary": "a string1",
  510. "ErrorReporting": "PromptImmediately",
  511. "ExportNamedFunctions": "string1;string2",
  512. "ForceSymbolReferences": "a string1",
  513. "IgnoreAllDefaultLibraries": "true",
  514. "IgnoreSpecificDefaultLibraries": "file1;file2",
  515. "LinkTimeCodeGeneration": "true",
  516. "MinimumRequiredVersion": "a string1",
  517. "ModuleDefinitionFile": "a_file_name",
  518. "Name": "a_file_name",
  519. "OutputFile": "a_file_name",
  520. "RemoveObjects": "file1;file2",
  521. "SubSystem": "Console",
  522. "SuppressStartupBanner": "true",
  523. "TargetMachine": "MachineX86i",
  524. "TrackerLogDirectory": "a_folder",
  525. "TreatLibWarningAsErrors": "true",
  526. "UseUnicodeResponseFiles": "true",
  527. "Verbose": "true",
  528. },
  529. "Manifest": {
  530. "AdditionalManifestFiles": "file1;file2",
  531. "AdditionalOptions": "a string1",
  532. "AssemblyIdentity": "a string1",
  533. "ComponentFileName": "a_file_name",
  534. "EnableDPIAwareness": "fal",
  535. "GenerateCatalogFiles": "truel",
  536. "GenerateCategoryTags": "true",
  537. "InputResourceManifests": "a string1",
  538. "ManifestFromManagedAssembly": "a_file_name",
  539. "notgood3": "bogus",
  540. "OutputManifestFile": "a_file_name",
  541. "OutputResourceManifests": "a string1",
  542. "RegistrarScriptFile": "a_file_name",
  543. "ReplacementsFile": "a_file_name",
  544. "SuppressDependencyElement": "true",
  545. "SuppressStartupBanner": "true",
  546. "TrackerLogDirectory": "a_folder",
  547. "TypeLibraryFile": "a_file_name",
  548. "UpdateFileHashes": "true",
  549. "UpdateFileHashesSearchPath": "a_file_name",
  550. "VerboseOutput": "true",
  551. },
  552. "ProjectReference": {
  553. "LinkLibraryDependencies": "true",
  554. "UseLibraryDependencyInputs": "true",
  555. },
  556. "ManifestResourceCompile": {"ResourceOutputFileName": "a_file_name"},
  557. "": {
  558. "EmbedManifest": "true",
  559. "GenerateManifest": "true",
  560. "IgnoreImportLibrary": "true",
  561. "LinkIncremental": "false",
  562. },
  563. },
  564. self.stderr,
  565. )
  566. self._ExpectedWarnings(
  567. [
  568. "Warning: unrecognized setting ClCompile/Enableprefast",
  569. "Warning: unrecognized setting ClCompile/ZZXYZ",
  570. "Warning: unrecognized setting Manifest/notgood3",
  571. "Warning: for Manifest/GenerateCatalogFiles, "
  572. "expected bool; got 'truel'",
  573. "Warning: for Lib/TargetMachine, unrecognized enumerated value "
  574. "MachineX86i",
  575. "Warning: for Manifest/EnableDPIAwareness, expected bool; got 'fal'",
  576. ]
  577. )
  578. def testConvertToMSBuildSettings_empty(self):
  579. """Tests an empty conversion."""
  580. msvs_settings = {}
  581. expected_msbuild_settings = {}
  582. actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(
  583. msvs_settings, self.stderr
  584. )
  585. self.assertEqual(expected_msbuild_settings, actual_msbuild_settings)
  586. self._ExpectedWarnings([])
  587. def testConvertToMSBuildSettings_minimal(self):
  588. """Tests a minimal conversion."""
  589. msvs_settings = {
  590. "VCCLCompilerTool": {
  591. "AdditionalIncludeDirectories": "dir1",
  592. "AdditionalOptions": "/foo",
  593. "BasicRuntimeChecks": "0",
  594. },
  595. "VCLinkerTool": {
  596. "LinkTimeCodeGeneration": "1",
  597. "ErrorReporting": "1",
  598. "DataExecutionPrevention": "2",
  599. },
  600. }
  601. expected_msbuild_settings = {
  602. "ClCompile": {
  603. "AdditionalIncludeDirectories": "dir1",
  604. "AdditionalOptions": "/foo",
  605. "BasicRuntimeChecks": "Default",
  606. },
  607. "Link": {
  608. "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration",
  609. "LinkErrorReporting": "PromptImmediately",
  610. "DataExecutionPrevention": "true",
  611. },
  612. }
  613. actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(
  614. msvs_settings, self.stderr
  615. )
  616. self.assertEqual(expected_msbuild_settings, actual_msbuild_settings)
  617. self._ExpectedWarnings([])
  618. def testConvertToMSBuildSettings_warnings(self):
  619. """Tests conversion that generates warnings."""
  620. msvs_settings = {
  621. "VCCLCompilerTool": {
  622. "AdditionalIncludeDirectories": "1",
  623. "AdditionalOptions": "2",
  624. # These are incorrect values:
  625. "BasicRuntimeChecks": "12",
  626. "BrowseInformation": "21",
  627. "UsePrecompiledHeader": "13",
  628. "GeneratePreprocessedFile": "14",
  629. },
  630. "VCLinkerTool": {
  631. # These are incorrect values:
  632. "Driver": "10",
  633. "LinkTimeCodeGeneration": "31",
  634. "ErrorReporting": "21",
  635. "FixedBaseAddress": "6",
  636. },
  637. "VCResourceCompilerTool": {
  638. # Custom
  639. "Culture": "1003"
  640. },
  641. }
  642. expected_msbuild_settings = {
  643. "ClCompile": {
  644. "AdditionalIncludeDirectories": "1",
  645. "AdditionalOptions": "2",
  646. },
  647. "Link": {},
  648. "ResourceCompile": {
  649. # Custom
  650. "Culture": "0x03eb"
  651. },
  652. }
  653. actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(
  654. msvs_settings, self.stderr
  655. )
  656. self.assertEqual(expected_msbuild_settings, actual_msbuild_settings)
  657. self._ExpectedWarnings(
  658. [
  659. "Warning: while converting VCCLCompilerTool/BasicRuntimeChecks to "
  660. "MSBuild, index value (12) not in expected range [0, 4)",
  661. "Warning: while converting VCCLCompilerTool/BrowseInformation to "
  662. "MSBuild, index value (21) not in expected range [0, 3)",
  663. "Warning: while converting VCCLCompilerTool/UsePrecompiledHeader to "
  664. "MSBuild, index value (13) not in expected range [0, 3)",
  665. "Warning: while converting "
  666. "VCCLCompilerTool/GeneratePreprocessedFile to "
  667. "MSBuild, value must be one of [0, 1, 2]; got 14",
  668. "Warning: while converting VCLinkerTool/Driver to "
  669. "MSBuild, index value (10) not in expected range [0, 4)",
  670. "Warning: while converting VCLinkerTool/LinkTimeCodeGeneration to "
  671. "MSBuild, index value (31) not in expected range [0, 5)",
  672. "Warning: while converting VCLinkerTool/ErrorReporting to "
  673. "MSBuild, index value (21) not in expected range [0, 3)",
  674. "Warning: while converting VCLinkerTool/FixedBaseAddress to "
  675. "MSBuild, index value (6) not in expected range [0, 3)",
  676. ]
  677. )
  678. def testConvertToMSBuildSettings_full_synthetic(self):
  679. """Tests conversion of all the MSBuild settings."""
  680. msvs_settings = {
  681. "VCCLCompilerTool": {
  682. "AdditionalIncludeDirectories": "folder1;folder2;folder3",
  683. "AdditionalOptions": "a_string",
  684. "AdditionalUsingDirectories": "folder1;folder2;folder3",
  685. "AssemblerListingLocation": "a_file_name",
  686. "AssemblerOutput": "0",
  687. "BasicRuntimeChecks": "1",
  688. "BrowseInformation": "2",
  689. "BrowseInformationFile": "a_file_name",
  690. "BufferSecurityCheck": "true",
  691. "CallingConvention": "0",
  692. "CompileAs": "1",
  693. "DebugInformationFormat": "4",
  694. "DefaultCharIsUnsigned": "true",
  695. "Detect64BitPortabilityProblems": "true",
  696. "DisableLanguageExtensions": "true",
  697. "DisableSpecificWarnings": "d1;d2;d3",
  698. "EnableEnhancedInstructionSet": "0",
  699. "EnableFiberSafeOptimizations": "true",
  700. "EnableFunctionLevelLinking": "true",
  701. "EnableIntrinsicFunctions": "true",
  702. "EnablePREfast": "true",
  703. "ErrorReporting": "1",
  704. "ExceptionHandling": "2",
  705. "ExpandAttributedSource": "true",
  706. "FavorSizeOrSpeed": "0",
  707. "FloatingPointExceptions": "true",
  708. "FloatingPointModel": "1",
  709. "ForceConformanceInForLoopScope": "true",
  710. "ForcedIncludeFiles": "file1;file2;file3",
  711. "ForcedUsingFiles": "file1;file2;file3",
  712. "GeneratePreprocessedFile": "1",
  713. "GenerateXMLDocumentationFiles": "true",
  714. "IgnoreStandardIncludePath": "true",
  715. "InlineFunctionExpansion": "2",
  716. "KeepComments": "true",
  717. "MinimalRebuild": "true",
  718. "ObjectFile": "a_file_name",
  719. "OmitDefaultLibName": "true",
  720. "OmitFramePointers": "true",
  721. "OpenMP": "true",
  722. "Optimization": "3",
  723. "PrecompiledHeaderFile": "a_file_name",
  724. "PrecompiledHeaderThrough": "a_file_name",
  725. "PreprocessorDefinitions": "d1;d2;d3",
  726. "ProgramDataBaseFileName": "a_file_name",
  727. "RuntimeLibrary": "0",
  728. "RuntimeTypeInfo": "true",
  729. "ShowIncludes": "true",
  730. "SmallerTypeCheck": "true",
  731. "StringPooling": "true",
  732. "StructMemberAlignment": "1",
  733. "SuppressStartupBanner": "true",
  734. "TreatWChar_tAsBuiltInType": "true",
  735. "UndefineAllPreprocessorDefinitions": "true",
  736. "UndefinePreprocessorDefinitions": "d1;d2;d3",
  737. "UseFullPaths": "true",
  738. "UsePrecompiledHeader": "1",
  739. "UseUnicodeResponseFiles": "true",
  740. "WarnAsError": "true",
  741. "WarningLevel": "2",
  742. "WholeProgramOptimization": "true",
  743. "XMLDocumentationFileName": "a_file_name",
  744. },
  745. "VCLinkerTool": {
  746. "AdditionalDependencies": "file1;file2;file3",
  747. "AdditionalLibraryDirectories": "folder1;folder2;folder3",
  748. "AdditionalLibraryDirectories_excluded": "folder1;folder2;folder3",
  749. "AdditionalManifestDependencies": "file1;file2;file3",
  750. "AdditionalOptions": "a_string",
  751. "AddModuleNamesToAssembly": "file1;file2;file3",
  752. "AllowIsolation": "true",
  753. "AssemblyDebug": "0",
  754. "AssemblyLinkResource": "file1;file2;file3",
  755. "BaseAddress": "a_string",
  756. "CLRImageType": "1",
  757. "CLRThreadAttribute": "2",
  758. "CLRUnmanagedCodeCheck": "true",
  759. "DataExecutionPrevention": "0",
  760. "DelayLoadDLLs": "file1;file2;file3",
  761. "DelaySign": "true",
  762. "Driver": "1",
  763. "EmbedManagedResourceFile": "file1;file2;file3",
  764. "EnableCOMDATFolding": "0",
  765. "EnableUAC": "true",
  766. "EntryPointSymbol": "a_string",
  767. "ErrorReporting": "0",
  768. "FixedBaseAddress": "1",
  769. "ForceSymbolReferences": "file1;file2;file3",
  770. "FunctionOrder": "a_file_name",
  771. "GenerateDebugInformation": "true",
  772. "GenerateManifest": "true",
  773. "GenerateMapFile": "true",
  774. "HeapCommitSize": "a_string",
  775. "HeapReserveSize": "a_string",
  776. "IgnoreAllDefaultLibraries": "true",
  777. "IgnoreDefaultLibraryNames": "file1;file2;file3",
  778. "IgnoreEmbeddedIDL": "true",
  779. "IgnoreImportLibrary": "true",
  780. "ImportLibrary": "a_file_name",
  781. "KeyContainer": "a_file_name",
  782. "KeyFile": "a_file_name",
  783. "LargeAddressAware": "2",
  784. "LinkIncremental": "1",
  785. "LinkLibraryDependencies": "true",
  786. "LinkTimeCodeGeneration": "2",
  787. "ManifestFile": "a_file_name",
  788. "MapExports": "true",
  789. "MapFileName": "a_file_name",
  790. "MergedIDLBaseFileName": "a_file_name",
  791. "MergeSections": "a_string",
  792. "MidlCommandFile": "a_file_name",
  793. "ModuleDefinitionFile": "a_file_name",
  794. "OptimizeForWindows98": "1",
  795. "OptimizeReferences": "0",
  796. "OutputFile": "a_file_name",
  797. "PerUserRedirection": "true",
  798. "Profile": "true",
  799. "ProfileGuidedDatabase": "a_file_name",
  800. "ProgramDatabaseFile": "a_file_name",
  801. "RandomizedBaseAddress": "1",
  802. "RegisterOutput": "true",
  803. "ResourceOnlyDLL": "true",
  804. "SetChecksum": "true",
  805. "ShowProgress": "0",
  806. "StackCommitSize": "a_string",
  807. "StackReserveSize": "a_string",
  808. "StripPrivateSymbols": "a_file_name",
  809. "SubSystem": "2",
  810. "SupportUnloadOfDelayLoadedDLL": "true",
  811. "SuppressStartupBanner": "true",
  812. "SwapRunFromCD": "true",
  813. "SwapRunFromNet": "true",
  814. "TargetMachine": "3",
  815. "TerminalServerAware": "2",
  816. "TurnOffAssemblyGeneration": "true",
  817. "TypeLibraryFile": "a_file_name",
  818. "TypeLibraryResourceID": "33",
  819. "UACExecutionLevel": "1",
  820. "UACUIAccess": "true",
  821. "UseLibraryDependencyInputs": "false",
  822. "UseUnicodeResponseFiles": "true",
  823. "Version": "a_string",
  824. },
  825. "VCResourceCompilerTool": {
  826. "AdditionalIncludeDirectories": "folder1;folder2;folder3",
  827. "AdditionalOptions": "a_string",
  828. "Culture": "1003",
  829. "IgnoreStandardIncludePath": "true",
  830. "PreprocessorDefinitions": "d1;d2;d3",
  831. "ResourceOutputFileName": "a_string",
  832. "ShowProgress": "true",
  833. "SuppressStartupBanner": "true",
  834. "UndefinePreprocessorDefinitions": "d1;d2;d3",
  835. },
  836. "VCMIDLTool": {
  837. "AdditionalIncludeDirectories": "folder1;folder2;folder3",
  838. "AdditionalOptions": "a_string",
  839. "CPreprocessOptions": "a_string",
  840. "DefaultCharType": "0",
  841. "DLLDataFileName": "a_file_name",
  842. "EnableErrorChecks": "2",
  843. "ErrorCheckAllocations": "true",
  844. "ErrorCheckBounds": "true",
  845. "ErrorCheckEnumRange": "true",
  846. "ErrorCheckRefPointers": "true",
  847. "ErrorCheckStubData": "true",
  848. "GenerateStublessProxies": "true",
  849. "GenerateTypeLibrary": "true",
  850. "HeaderFileName": "a_file_name",
  851. "IgnoreStandardIncludePath": "true",
  852. "InterfaceIdentifierFileName": "a_file_name",
  853. "MkTypLibCompatible": "true",
  854. "OutputDirectory": "a_string",
  855. "PreprocessorDefinitions": "d1;d2;d3",
  856. "ProxyFileName": "a_file_name",
  857. "RedirectOutputAndErrors": "a_file_name",
  858. "StructMemberAlignment": "3",
  859. "SuppressStartupBanner": "true",
  860. "TargetEnvironment": "1",
  861. "TypeLibraryName": "a_file_name",
  862. "UndefinePreprocessorDefinitions": "d1;d2;d3",
  863. "ValidateParameters": "true",
  864. "WarnAsError": "true",
  865. "WarningLevel": "4",
  866. },
  867. "VCLibrarianTool": {
  868. "AdditionalDependencies": "file1;file2;file3",
  869. "AdditionalLibraryDirectories": "folder1;folder2;folder3",
  870. "AdditionalLibraryDirectories_excluded": "folder1;folder2;folder3",
  871. "AdditionalOptions": "a_string",
  872. "ExportNamedFunctions": "d1;d2;d3",
  873. "ForceSymbolReferences": "a_string",
  874. "IgnoreAllDefaultLibraries": "true",
  875. "IgnoreSpecificDefaultLibraries": "file1;file2;file3",
  876. "LinkLibraryDependencies": "true",
  877. "ModuleDefinitionFile": "a_file_name",
  878. "OutputFile": "a_file_name",
  879. "SuppressStartupBanner": "true",
  880. "UseUnicodeResponseFiles": "true",
  881. },
  882. "VCManifestTool": {
  883. "AdditionalManifestFiles": "file1;file2;file3",
  884. "AdditionalOptions": "a_string",
  885. "AssemblyIdentity": "a_string",
  886. "ComponentFileName": "a_file_name",
  887. "DependencyInformationFile": "a_file_name",
  888. "EmbedManifest": "true",
  889. "GenerateCatalogFiles": "true",
  890. "InputResourceManifests": "a_string",
  891. "ManifestResourceFile": "my_name",
  892. "OutputManifestFile": "a_file_name",
  893. "RegistrarScriptFile": "a_file_name",
  894. "ReplacementsFile": "a_file_name",
  895. "SuppressStartupBanner": "true",
  896. "TypeLibraryFile": "a_file_name",
  897. "UpdateFileHashes": "true",
  898. "UpdateFileHashesSearchPath": "a_file_name",
  899. "UseFAT32Workaround": "true",
  900. "UseUnicodeResponseFiles": "true",
  901. "VerboseOutput": "true",
  902. },
  903. }
  904. expected_msbuild_settings = {
  905. "ClCompile": {
  906. "AdditionalIncludeDirectories": "folder1;folder2;folder3",
  907. "AdditionalOptions": "a_string /J",
  908. "AdditionalUsingDirectories": "folder1;folder2;folder3",
  909. "AssemblerListingLocation": "a_file_name",
  910. "AssemblerOutput": "NoListing",
  911. "BasicRuntimeChecks": "StackFrameRuntimeCheck",
  912. "BrowseInformation": "true",
  913. "BrowseInformationFile": "a_file_name",
  914. "BufferSecurityCheck": "true",
  915. "CallingConvention": "Cdecl",
  916. "CompileAs": "CompileAsC",
  917. "DebugInformationFormat": "EditAndContinue",
  918. "DisableLanguageExtensions": "true",
  919. "DisableSpecificWarnings": "d1;d2;d3",
  920. "EnableEnhancedInstructionSet": "NotSet",
  921. "EnableFiberSafeOptimizations": "true",
  922. "EnablePREfast": "true",
  923. "ErrorReporting": "Prompt",
  924. "ExceptionHandling": "Async",
  925. "ExpandAttributedSource": "true",
  926. "FavorSizeOrSpeed": "Neither",
  927. "FloatingPointExceptions": "true",
  928. "FloatingPointModel": "Strict",
  929. "ForceConformanceInForLoopScope": "true",
  930. "ForcedIncludeFiles": "file1;file2;file3",
  931. "ForcedUsingFiles": "file1;file2;file3",
  932. "FunctionLevelLinking": "true",
  933. "GenerateXMLDocumentationFiles": "true",
  934. "IgnoreStandardIncludePath": "true",
  935. "InlineFunctionExpansion": "AnySuitable",
  936. "IntrinsicFunctions": "true",
  937. "MinimalRebuild": "true",
  938. "ObjectFileName": "a_file_name",
  939. "OmitDefaultLibName": "true",
  940. "OmitFramePointers": "true",
  941. "OpenMPSupport": "true",
  942. "Optimization": "Full",
  943. "PrecompiledHeader": "Create",
  944. "PrecompiledHeaderFile": "a_file_name",
  945. "PrecompiledHeaderOutputFile": "a_file_name",
  946. "PreprocessKeepComments": "true",
  947. "PreprocessorDefinitions": "d1;d2;d3",
  948. "PreprocessSuppressLineNumbers": "false",
  949. "PreprocessToFile": "true",
  950. "ProgramDataBaseFileName": "a_file_name",
  951. "RuntimeLibrary": "MultiThreaded",
  952. "RuntimeTypeInfo": "true",
  953. "ShowIncludes": "true",
  954. "SmallerTypeCheck": "true",
  955. "StringPooling": "true",
  956. "StructMemberAlignment": "1Byte",
  957. "SuppressStartupBanner": "true",
  958. "TreatWarningAsError": "true",
  959. "TreatWChar_tAsBuiltInType": "true",
  960. "UndefineAllPreprocessorDefinitions": "true",
  961. "UndefinePreprocessorDefinitions": "d1;d2;d3",
  962. "UseFullPaths": "true",
  963. "WarningLevel": "Level2",
  964. "WholeProgramOptimization": "true",
  965. "XMLDocumentationFileName": "a_file_name",
  966. },
  967. "Link": {
  968. "AdditionalDependencies": "file1;file2;file3",
  969. "AdditionalLibraryDirectories": "folder1;folder2;folder3",
  970. "AdditionalManifestDependencies": "file1;file2;file3",
  971. "AdditionalOptions": "a_string",
  972. "AddModuleNamesToAssembly": "file1;file2;file3",
  973. "AllowIsolation": "true",
  974. "AssemblyDebug": "",
  975. "AssemblyLinkResource": "file1;file2;file3",
  976. "BaseAddress": "a_string",
  977. "CLRImageType": "ForceIJWImage",
  978. "CLRThreadAttribute": "STAThreadingAttribute",
  979. "CLRUnmanagedCodeCheck": "true",
  980. "DataExecutionPrevention": "",
  981. "DelayLoadDLLs": "file1;file2;file3",
  982. "DelaySign": "true",
  983. "Driver": "Driver",
  984. "EmbedManagedResourceFile": "file1;file2;file3",
  985. "EnableCOMDATFolding": "",
  986. "EnableUAC": "true",
  987. "EntryPointSymbol": "a_string",
  988. "FixedBaseAddress": "false",
  989. "ForceSymbolReferences": "file1;file2;file3",
  990. "FunctionOrder": "a_file_name",
  991. "GenerateDebugInformation": "true",
  992. "GenerateMapFile": "true",
  993. "HeapCommitSize": "a_string",
  994. "HeapReserveSize": "a_string",
  995. "IgnoreAllDefaultLibraries": "true",
  996. "IgnoreEmbeddedIDL": "true",
  997. "IgnoreSpecificDefaultLibraries": "file1;file2;file3",
  998. "ImportLibrary": "a_file_name",
  999. "KeyContainer": "a_file_name",
  1000. "KeyFile": "a_file_name",
  1001. "LargeAddressAware": "true",
  1002. "LinkErrorReporting": "NoErrorReport",
  1003. "LinkTimeCodeGeneration": "PGInstrument",
  1004. "ManifestFile": "a_file_name",
  1005. "MapExports": "true",
  1006. "MapFileName": "a_file_name",
  1007. "MergedIDLBaseFileName": "a_file_name",
  1008. "MergeSections": "a_string",
  1009. "MidlCommandFile": "a_file_name",
  1010. "ModuleDefinitionFile": "a_file_name",
  1011. "NoEntryPoint": "true",
  1012. "OptimizeReferences": "",
  1013. "OutputFile": "a_file_name",
  1014. "PerUserRedirection": "true",
  1015. "Profile": "true",
  1016. "ProfileGuidedDatabase": "a_file_name",
  1017. "ProgramDatabaseFile": "a_file_name",
  1018. "RandomizedBaseAddress": "false",
  1019. "RegisterOutput": "true",
  1020. "SetChecksum": "true",
  1021. "ShowProgress": "NotSet",
  1022. "StackCommitSize": "a_string",
  1023. "StackReserveSize": "a_string",
  1024. "StripPrivateSymbols": "a_file_name",
  1025. "SubSystem": "Windows",
  1026. "SupportUnloadOfDelayLoadedDLL": "true",
  1027. "SuppressStartupBanner": "true",
  1028. "SwapRunFromCD": "true",
  1029. "SwapRunFromNET": "true",
  1030. "TargetMachine": "MachineARM",
  1031. "TerminalServerAware": "true",
  1032. "TurnOffAssemblyGeneration": "true",
  1033. "TypeLibraryFile": "a_file_name",
  1034. "TypeLibraryResourceID": "33",
  1035. "UACExecutionLevel": "HighestAvailable",
  1036. "UACUIAccess": "true",
  1037. "Version": "a_string",
  1038. },
  1039. "ResourceCompile": {
  1040. "AdditionalIncludeDirectories": "folder1;folder2;folder3",
  1041. "AdditionalOptions": "a_string",
  1042. "Culture": "0x03eb",
  1043. "IgnoreStandardIncludePath": "true",
  1044. "PreprocessorDefinitions": "d1;d2;d3",
  1045. "ResourceOutputFileName": "a_string",
  1046. "ShowProgress": "true",
  1047. "SuppressStartupBanner": "true",
  1048. "UndefinePreprocessorDefinitions": "d1;d2;d3",
  1049. },
  1050. "Midl": {
  1051. "AdditionalIncludeDirectories": "folder1;folder2;folder3",
  1052. "AdditionalOptions": "a_string",
  1053. "CPreprocessOptions": "a_string",
  1054. "DefaultCharType": "Unsigned",
  1055. "DllDataFileName": "a_file_name",
  1056. "EnableErrorChecks": "All",
  1057. "ErrorCheckAllocations": "true",
  1058. "ErrorCheckBounds": "true",
  1059. "ErrorCheckEnumRange": "true",
  1060. "ErrorCheckRefPointers": "true",
  1061. "ErrorCheckStubData": "true",
  1062. "GenerateStublessProxies": "true",
  1063. "GenerateTypeLibrary": "true",
  1064. "HeaderFileName": "a_file_name",
  1065. "IgnoreStandardIncludePath": "true",
  1066. "InterfaceIdentifierFileName": "a_file_name",
  1067. "MkTypLibCompatible": "true",
  1068. "OutputDirectory": "a_string",
  1069. "PreprocessorDefinitions": "d1;d2;d3",
  1070. "ProxyFileName": "a_file_name",
  1071. "RedirectOutputAndErrors": "a_file_name",
  1072. "StructMemberAlignment": "4",
  1073. "SuppressStartupBanner": "true",
  1074. "TargetEnvironment": "Win32",
  1075. "TypeLibraryName": "a_file_name",
  1076. "UndefinePreprocessorDefinitions": "d1;d2;d3",
  1077. "ValidateAllParameters": "true",
  1078. "WarnAsError": "true",
  1079. "WarningLevel": "4",
  1080. },
  1081. "Lib": {
  1082. "AdditionalDependencies": "file1;file2;file3",
  1083. "AdditionalLibraryDirectories": "folder1;folder2;folder3",
  1084. "AdditionalOptions": "a_string",
  1085. "ExportNamedFunctions": "d1;d2;d3",
  1086. "ForceSymbolReferences": "a_string",
  1087. "IgnoreAllDefaultLibraries": "true",
  1088. "IgnoreSpecificDefaultLibraries": "file1;file2;file3",
  1089. "ModuleDefinitionFile": "a_file_name",
  1090. "OutputFile": "a_file_name",
  1091. "SuppressStartupBanner": "true",
  1092. "UseUnicodeResponseFiles": "true",
  1093. },
  1094. "Manifest": {
  1095. "AdditionalManifestFiles": "file1;file2;file3",
  1096. "AdditionalOptions": "a_string",
  1097. "AssemblyIdentity": "a_string",
  1098. "ComponentFileName": "a_file_name",
  1099. "GenerateCatalogFiles": "true",
  1100. "InputResourceManifests": "a_string",
  1101. "OutputManifestFile": "a_file_name",
  1102. "RegistrarScriptFile": "a_file_name",
  1103. "ReplacementsFile": "a_file_name",
  1104. "SuppressStartupBanner": "true",
  1105. "TypeLibraryFile": "a_file_name",
  1106. "UpdateFileHashes": "true",
  1107. "UpdateFileHashesSearchPath": "a_file_name",
  1108. "VerboseOutput": "true",
  1109. },
  1110. "ManifestResourceCompile": {"ResourceOutputFileName": "my_name"},
  1111. "ProjectReference": {
  1112. "LinkLibraryDependencies": "true",
  1113. "UseLibraryDependencyInputs": "false",
  1114. },
  1115. "": {
  1116. "EmbedManifest": "true",
  1117. "GenerateManifest": "true",
  1118. "IgnoreImportLibrary": "true",
  1119. "LinkIncremental": "false",
  1120. },
  1121. }
  1122. self.maxDiff = 9999 # on failure display a long diff
  1123. actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(
  1124. msvs_settings, self.stderr
  1125. )
  1126. self.assertEqual(expected_msbuild_settings, actual_msbuild_settings)
  1127. self._ExpectedWarnings([])
  1128. def testConvertToMSBuildSettings_actual(self):
  1129. """Tests the conversion of an actual project.
  1130. A VS2008 project with most of the options defined was created through the
  1131. VS2008 IDE. It was then converted to VS2010. The tool settings found in
  1132. the .vcproj and .vcxproj files were converted to the two dictionaries
  1133. msvs_settings and expected_msbuild_settings.
  1134. Note that for many settings, the VS2010 converter adds macros like
  1135. %(AdditionalIncludeDirectories) to make sure than inherited values are
  1136. included. Since the Gyp projects we generate do not use inheritance,
  1137. we removed these macros. They were:
  1138. ClCompile:
  1139. AdditionalIncludeDirectories: ';%(AdditionalIncludeDirectories)'
  1140. AdditionalOptions: ' %(AdditionalOptions)'
  1141. AdditionalUsingDirectories: ';%(AdditionalUsingDirectories)'
  1142. DisableSpecificWarnings: ';%(DisableSpecificWarnings)',
  1143. ForcedIncludeFiles: ';%(ForcedIncludeFiles)',
  1144. ForcedUsingFiles: ';%(ForcedUsingFiles)',
  1145. PreprocessorDefinitions: ';%(PreprocessorDefinitions)',
  1146. UndefinePreprocessorDefinitions:
  1147. ';%(UndefinePreprocessorDefinitions)',
  1148. Link:
  1149. AdditionalDependencies: ';%(AdditionalDependencies)',
  1150. AdditionalLibraryDirectories: ';%(AdditionalLibraryDirectories)',
  1151. AdditionalManifestDependencies:
  1152. ';%(AdditionalManifestDependencies)',
  1153. AdditionalOptions: ' %(AdditionalOptions)',
  1154. AddModuleNamesToAssembly: ';%(AddModuleNamesToAssembly)',
  1155. AssemblyLinkResource: ';%(AssemblyLinkResource)',
  1156. DelayLoadDLLs: ';%(DelayLoadDLLs)',
  1157. EmbedManagedResourceFile: ';%(EmbedManagedResourceFile)',
  1158. ForceSymbolReferences: ';%(ForceSymbolReferences)',
  1159. IgnoreSpecificDefaultLibraries:
  1160. ';%(IgnoreSpecificDefaultLibraries)',
  1161. ResourceCompile:
  1162. AdditionalIncludeDirectories: ';%(AdditionalIncludeDirectories)',
  1163. AdditionalOptions: ' %(AdditionalOptions)',
  1164. PreprocessorDefinitions: ';%(PreprocessorDefinitions)',
  1165. Manifest:
  1166. AdditionalManifestFiles: ';%(AdditionalManifestFiles)',
  1167. AdditionalOptions: ' %(AdditionalOptions)',
  1168. InputResourceManifests: ';%(InputResourceManifests)',
  1169. """
  1170. msvs_settings = {
  1171. "VCCLCompilerTool": {
  1172. "AdditionalIncludeDirectories": "dir1",
  1173. "AdditionalOptions": "/more",
  1174. "AdditionalUsingDirectories": "test",
  1175. "AssemblerListingLocation": "$(IntDir)\\a",
  1176. "AssemblerOutput": "1",
  1177. "BasicRuntimeChecks": "3",
  1178. "BrowseInformation": "1",
  1179. "BrowseInformationFile": "$(IntDir)\\e",
  1180. "BufferSecurityCheck": "false",
  1181. "CallingConvention": "1",
  1182. "CompileAs": "1",
  1183. "DebugInformationFormat": "4",
  1184. "DefaultCharIsUnsigned": "true",
  1185. "Detect64BitPortabilityProblems": "true",
  1186. "DisableLanguageExtensions": "true",
  1187. "DisableSpecificWarnings": "abc",
  1188. "EnableEnhancedInstructionSet": "1",
  1189. "EnableFiberSafeOptimizations": "true",
  1190. "EnableFunctionLevelLinking": "true",
  1191. "EnableIntrinsicFunctions": "true",
  1192. "EnablePREfast": "true",
  1193. "ErrorReporting": "2",
  1194. "ExceptionHandling": "2",
  1195. "ExpandAttributedSource": "true",
  1196. "FavorSizeOrSpeed": "2",
  1197. "FloatingPointExceptions": "true",
  1198. "FloatingPointModel": "1",
  1199. "ForceConformanceInForLoopScope": "false",
  1200. "ForcedIncludeFiles": "def",
  1201. "ForcedUsingFiles": "ge",
  1202. "GeneratePreprocessedFile": "2",
  1203. "GenerateXMLDocumentationFiles": "true",
  1204. "IgnoreStandardIncludePath": "true",
  1205. "InlineFunctionExpansion": "1",
  1206. "KeepComments": "true",
  1207. "MinimalRebuild": "true",
  1208. "ObjectFile": "$(IntDir)\\b",
  1209. "OmitDefaultLibName": "true",
  1210. "OmitFramePointers": "true",
  1211. "OpenMP": "true",
  1212. "Optimization": "3",
  1213. "PrecompiledHeaderFile": "$(IntDir)\\$(TargetName).pche",
  1214. "PrecompiledHeaderThrough": "StdAfx.hd",
  1215. "PreprocessorDefinitions": "WIN32;_DEBUG;_CONSOLE",
  1216. "ProgramDataBaseFileName": "$(IntDir)\\vc90b.pdb",
  1217. "RuntimeLibrary": "3",
  1218. "RuntimeTypeInfo": "false",
  1219. "ShowIncludes": "true",
  1220. "SmallerTypeCheck": "true",
  1221. "StringPooling": "true",
  1222. "StructMemberAlignment": "3",
  1223. "SuppressStartupBanner": "false",
  1224. "TreatWChar_tAsBuiltInType": "false",
  1225. "UndefineAllPreprocessorDefinitions": "true",
  1226. "UndefinePreprocessorDefinitions": "wer",
  1227. "UseFullPaths": "true",
  1228. "UsePrecompiledHeader": "0",
  1229. "UseUnicodeResponseFiles": "false",
  1230. "WarnAsError": "true",
  1231. "WarningLevel": "3",
  1232. "WholeProgramOptimization": "true",
  1233. "XMLDocumentationFileName": "$(IntDir)\\c",
  1234. },
  1235. "VCLinkerTool": {
  1236. "AdditionalDependencies": "zx",
  1237. "AdditionalLibraryDirectories": "asd",
  1238. "AdditionalManifestDependencies": "s2",
  1239. "AdditionalOptions": "/mor2",
  1240. "AddModuleNamesToAssembly": "d1",
  1241. "AllowIsolation": "false",
  1242. "AssemblyDebug": "1",
  1243. "AssemblyLinkResource": "d5",
  1244. "BaseAddress": "23423",
  1245. "CLRImageType": "3",
  1246. "CLRThreadAttribute": "1",
  1247. "CLRUnmanagedCodeCheck": "true",
  1248. "DataExecutionPrevention": "0",
  1249. "DelayLoadDLLs": "d4",
  1250. "DelaySign": "true",
  1251. "Driver": "2",
  1252. "EmbedManagedResourceFile": "d2",
  1253. "EnableCOMDATFolding": "1",
  1254. "EnableUAC": "false",
  1255. "EntryPointSymbol": "f5",
  1256. "ErrorReporting": "2",
  1257. "FixedBaseAddress": "1",
  1258. "ForceSymbolReferences": "d3",
  1259. "FunctionOrder": "fssdfsd",
  1260. "GenerateDebugInformation": "true",
  1261. "GenerateManifest": "false",
  1262. "GenerateMapFile": "true",
  1263. "HeapCommitSize": "13",
  1264. "HeapReserveSize": "12",
  1265. "IgnoreAllDefaultLibraries": "true",
  1266. "IgnoreDefaultLibraryNames": "flob;flok",
  1267. "IgnoreEmbeddedIDL": "true",
  1268. "IgnoreImportLibrary": "true",
  1269. "ImportLibrary": "f4",
  1270. "KeyContainer": "f7",
  1271. "KeyFile": "f6",
  1272. "LargeAddressAware": "2",
  1273. "LinkIncremental": "0",
  1274. "LinkLibraryDependencies": "false",
  1275. "LinkTimeCodeGeneration": "1",
  1276. "ManifestFile": "$(IntDir)\\$(TargetFileName).2intermediate.manifest",
  1277. "MapExports": "true",
  1278. "MapFileName": "d5",
  1279. "MergedIDLBaseFileName": "f2",
  1280. "MergeSections": "f5",
  1281. "MidlCommandFile": "f1",
  1282. "ModuleDefinitionFile": "sdsd",
  1283. "OptimizeForWindows98": "2",
  1284. "OptimizeReferences": "2",
  1285. "OutputFile": "$(OutDir)\\$(ProjectName)2.exe",
  1286. "PerUserRedirection": "true",
  1287. "Profile": "true",
  1288. "ProfileGuidedDatabase": "$(TargetDir)$(TargetName).pgdd",
  1289. "ProgramDatabaseFile": "Flob.pdb",
  1290. "RandomizedBaseAddress": "1",
  1291. "RegisterOutput": "true",
  1292. "ResourceOnlyDLL": "true",
  1293. "SetChecksum": "false",
  1294. "ShowProgress": "1",
  1295. "StackCommitSize": "15",
  1296. "StackReserveSize": "14",
  1297. "StripPrivateSymbols": "d3",
  1298. "SubSystem": "1",
  1299. "SupportUnloadOfDelayLoadedDLL": "true",
  1300. "SuppressStartupBanner": "false",
  1301. "SwapRunFromCD": "true",
  1302. "SwapRunFromNet": "true",
  1303. "TargetMachine": "1",
  1304. "TerminalServerAware": "1",
  1305. "TurnOffAssemblyGeneration": "true",
  1306. "TypeLibraryFile": "f3",
  1307. "TypeLibraryResourceID": "12",
  1308. "UACExecutionLevel": "2",
  1309. "UACUIAccess": "true",
  1310. "UseLibraryDependencyInputs": "true",
  1311. "UseUnicodeResponseFiles": "false",
  1312. "Version": "333",
  1313. },
  1314. "VCResourceCompilerTool": {
  1315. "AdditionalIncludeDirectories": "f3",
  1316. "AdditionalOptions": "/more3",
  1317. "Culture": "3084",
  1318. "IgnoreStandardIncludePath": "true",
  1319. "PreprocessorDefinitions": "_UNICODE;UNICODE2",
  1320. "ResourceOutputFileName": "$(IntDir)/$(InputName)3.res",
  1321. "ShowProgress": "true",
  1322. },
  1323. "VCManifestTool": {
  1324. "AdditionalManifestFiles": "sfsdfsd",
  1325. "AdditionalOptions": "afdsdafsd",
  1326. "AssemblyIdentity": "sddfdsadfsa",
  1327. "ComponentFileName": "fsdfds",
  1328. "DependencyInformationFile": "$(IntDir)\\mt.depdfd",
  1329. "EmbedManifest": "false",
  1330. "GenerateCatalogFiles": "true",
  1331. "InputResourceManifests": "asfsfdafs",
  1332. "ManifestResourceFile":
  1333. "$(IntDir)\\$(TargetFileName).embed.manifest.resfdsf",
  1334. "OutputManifestFile": "$(TargetPath).manifestdfs",
  1335. "RegistrarScriptFile": "sdfsfd",
  1336. "ReplacementsFile": "sdffsd",
  1337. "SuppressStartupBanner": "false",
  1338. "TypeLibraryFile": "sfsd",
  1339. "UpdateFileHashes": "true",
  1340. "UpdateFileHashesSearchPath": "sfsd",
  1341. "UseFAT32Workaround": "true",
  1342. "UseUnicodeResponseFiles": "false",
  1343. "VerboseOutput": "true",
  1344. },
  1345. }
  1346. expected_msbuild_settings = {
  1347. "ClCompile": {
  1348. "AdditionalIncludeDirectories": "dir1",
  1349. "AdditionalOptions": "/more /J",
  1350. "AdditionalUsingDirectories": "test",
  1351. "AssemblerListingLocation": "$(IntDir)a",
  1352. "AssemblerOutput": "AssemblyCode",
  1353. "BasicRuntimeChecks": "EnableFastChecks",
  1354. "BrowseInformation": "true",
  1355. "BrowseInformationFile": "$(IntDir)e",
  1356. "BufferSecurityCheck": "false",
  1357. "CallingConvention": "FastCall",
  1358. "CompileAs": "CompileAsC",
  1359. "DebugInformationFormat": "EditAndContinue",
  1360. "DisableLanguageExtensions": "true",
  1361. "DisableSpecificWarnings": "abc",
  1362. "EnableEnhancedInstructionSet": "StreamingSIMDExtensions",
  1363. "EnableFiberSafeOptimizations": "true",
  1364. "EnablePREfast": "true",
  1365. "ErrorReporting": "Queue",
  1366. "ExceptionHandling": "Async",
  1367. "ExpandAttributedSource": "true",
  1368. "FavorSizeOrSpeed": "Size",
  1369. "FloatingPointExceptions": "true",
  1370. "FloatingPointModel": "Strict",
  1371. "ForceConformanceInForLoopScope": "false",
  1372. "ForcedIncludeFiles": "def",
  1373. "ForcedUsingFiles": "ge",
  1374. "FunctionLevelLinking": "true",
  1375. "GenerateXMLDocumentationFiles": "true",
  1376. "IgnoreStandardIncludePath": "true",
  1377. "InlineFunctionExpansion": "OnlyExplicitInline",
  1378. "IntrinsicFunctions": "true",
  1379. "MinimalRebuild": "true",
  1380. "ObjectFileName": "$(IntDir)b",
  1381. "OmitDefaultLibName": "true",
  1382. "OmitFramePointers": "true",
  1383. "OpenMPSupport": "true",
  1384. "Optimization": "Full",
  1385. "PrecompiledHeader": "NotUsing", # Actual conversion gives ''
  1386. "PrecompiledHeaderFile": "StdAfx.hd",
  1387. "PrecompiledHeaderOutputFile": "$(IntDir)$(TargetName).pche",
  1388. "PreprocessKeepComments": "true",
  1389. "PreprocessorDefinitions": "WIN32;_DEBUG;_CONSOLE",
  1390. "PreprocessSuppressLineNumbers": "true",
  1391. "PreprocessToFile": "true",
  1392. "ProgramDataBaseFileName": "$(IntDir)vc90b.pdb",
  1393. "RuntimeLibrary": "MultiThreadedDebugDLL",
  1394. "RuntimeTypeInfo": "false",
  1395. "ShowIncludes": "true",
  1396. "SmallerTypeCheck": "true",
  1397. "StringPooling": "true",
  1398. "StructMemberAlignment": "4Bytes",
  1399. "SuppressStartupBanner": "false",
  1400. "TreatWarningAsError": "true",
  1401. "TreatWChar_tAsBuiltInType": "false",
  1402. "UndefineAllPreprocessorDefinitions": "true",
  1403. "UndefinePreprocessorDefinitions": "wer",
  1404. "UseFullPaths": "true",
  1405. "WarningLevel": "Level3",
  1406. "WholeProgramOptimization": "true",
  1407. "XMLDocumentationFileName": "$(IntDir)c",
  1408. },
  1409. "Link": {
  1410. "AdditionalDependencies": "zx",
  1411. "AdditionalLibraryDirectories": "asd",
  1412. "AdditionalManifestDependencies": "s2",
  1413. "AdditionalOptions": "/mor2",
  1414. "AddModuleNamesToAssembly": "d1",
  1415. "AllowIsolation": "false",
  1416. "AssemblyDebug": "true",
  1417. "AssemblyLinkResource": "d5",
  1418. "BaseAddress": "23423",
  1419. "CLRImageType": "ForceSafeILImage",
  1420. "CLRThreadAttribute": "MTAThreadingAttribute",
  1421. "CLRUnmanagedCodeCheck": "true",
  1422. "DataExecutionPrevention": "",
  1423. "DelayLoadDLLs": "d4",
  1424. "DelaySign": "true",
  1425. "Driver": "UpOnly",
  1426. "EmbedManagedResourceFile": "d2",
  1427. "EnableCOMDATFolding": "false",
  1428. "EnableUAC": "false",
  1429. "EntryPointSymbol": "f5",
  1430. "FixedBaseAddress": "false",
  1431. "ForceSymbolReferences": "d3",
  1432. "FunctionOrder": "fssdfsd",
  1433. "GenerateDebugInformation": "true",
  1434. "GenerateMapFile": "true",
  1435. "HeapCommitSize": "13",
  1436. "HeapReserveSize": "12",
  1437. "IgnoreAllDefaultLibraries": "true",
  1438. "IgnoreEmbeddedIDL": "true",
  1439. "IgnoreSpecificDefaultLibraries": "flob;flok",
  1440. "ImportLibrary": "f4",
  1441. "KeyContainer": "f7",
  1442. "KeyFile": "f6",
  1443. "LargeAddressAware": "true",
  1444. "LinkErrorReporting": "QueueForNextLogin",
  1445. "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration",
  1446. "ManifestFile": "$(IntDir)$(TargetFileName).2intermediate.manifest",
  1447. "MapExports": "true",
  1448. "MapFileName": "d5",
  1449. "MergedIDLBaseFileName": "f2",
  1450. "MergeSections": "f5",
  1451. "MidlCommandFile": "f1",
  1452. "ModuleDefinitionFile": "sdsd",
  1453. "NoEntryPoint": "true",
  1454. "OptimizeReferences": "true",
  1455. "OutputFile": "$(OutDir)$(ProjectName)2.exe",
  1456. "PerUserRedirection": "true",
  1457. "Profile": "true",
  1458. "ProfileGuidedDatabase": "$(TargetDir)$(TargetName).pgdd",
  1459. "ProgramDatabaseFile": "Flob.pdb",
  1460. "RandomizedBaseAddress": "false",
  1461. "RegisterOutput": "true",
  1462. "SetChecksum": "false",
  1463. "ShowProgress": "LinkVerbose",
  1464. "StackCommitSize": "15",
  1465. "StackReserveSize": "14",
  1466. "StripPrivateSymbols": "d3",
  1467. "SubSystem": "Console",
  1468. "SupportUnloadOfDelayLoadedDLL": "true",
  1469. "SuppressStartupBanner": "false",
  1470. "SwapRunFromCD": "true",
  1471. "SwapRunFromNET": "true",
  1472. "TargetMachine": "MachineX86",
  1473. "TerminalServerAware": "false",
  1474. "TurnOffAssemblyGeneration": "true",
  1475. "TypeLibraryFile": "f3",
  1476. "TypeLibraryResourceID": "12",
  1477. "UACExecutionLevel": "RequireAdministrator",
  1478. "UACUIAccess": "true",
  1479. "Version": "333",
  1480. },
  1481. "ResourceCompile": {
  1482. "AdditionalIncludeDirectories": "f3",
  1483. "AdditionalOptions": "/more3",
  1484. "Culture": "0x0c0c",
  1485. "IgnoreStandardIncludePath": "true",
  1486. "PreprocessorDefinitions": "_UNICODE;UNICODE2",
  1487. "ResourceOutputFileName": "$(IntDir)%(Filename)3.res",
  1488. "ShowProgress": "true",
  1489. },
  1490. "Manifest": {
  1491. "AdditionalManifestFiles": "sfsdfsd",
  1492. "AdditionalOptions": "afdsdafsd",
  1493. "AssemblyIdentity": "sddfdsadfsa",
  1494. "ComponentFileName": "fsdfds",
  1495. "GenerateCatalogFiles": "true",
  1496. "InputResourceManifests": "asfsfdafs",
  1497. "OutputManifestFile": "$(TargetPath).manifestdfs",
  1498. "RegistrarScriptFile": "sdfsfd",
  1499. "ReplacementsFile": "sdffsd",
  1500. "SuppressStartupBanner": "false",
  1501. "TypeLibraryFile": "sfsd",
  1502. "UpdateFileHashes": "true",
  1503. "UpdateFileHashesSearchPath": "sfsd",
  1504. "VerboseOutput": "true",
  1505. },
  1506. "ProjectReference": {
  1507. "LinkLibraryDependencies": "false",
  1508. "UseLibraryDependencyInputs": "true",
  1509. },
  1510. "": {
  1511. "EmbedManifest": "false",
  1512. "GenerateManifest": "false",
  1513. "IgnoreImportLibrary": "true",
  1514. "LinkIncremental": "",
  1515. },
  1516. "ManifestResourceCompile": {
  1517. "ResourceOutputFileName":
  1518. "$(IntDir)$(TargetFileName).embed.manifest.resfdsf"
  1519. },
  1520. }
  1521. self.maxDiff = 9999 # on failure display a long diff
  1522. actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(
  1523. msvs_settings, self.stderr
  1524. )
  1525. self.assertEqual(expected_msbuild_settings, actual_msbuild_settings)
  1526. self._ExpectedWarnings([])
  1527. if __name__ == "__main__":
  1528. unittest.main()