MSVSSettings_test.py 64 KB

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