File: //usr/lib/python3/dist-packages/gyp/__pycache__/MSVSSettings_test.cpython-39.pyc
a
r�^� � @ sn d Z zddlmZ W n ey2 ddlmZ Y n0 ddlZddlmZ G dd� dej�Ze dkrje�
� dS )z(Unit tests for the MSVSSettings.py file.� )�StringIONc @ s\ e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zdd� ZdS )�TestSequenceFunctionsc C s t � | _d S )N)r �stderr��self� r �7/usr/lib/python3/dist-packages/gyp/MSVSSettings_test.py�setUp s zTestSequenceFunctions.setUpc C sB | j �d� | j �� �d�}dd� |D �}| �t|�t|�� dS )z-Compares recorded lines to expected warnings.r �
c S s g | ]}|r|�qS r r )�.0�liner r r �
<listcomp> � z;TestSequenceFunctions._ExpectedWarnings.<locals>.<listcomp>N)r �seek�read�split�assertEqual�sorted)r ZexpectedZactualr r r �_ExpectedWarnings s z'TestSequenceFunctions._ExpectedWarningsc C s2 t �i i i i i i i i d�| j� | �ddg� dS )z,Tests that only MSVS tool names are allowed.)�VCCLCompilerTool�VCLinkerTool�
VCMIDLToolZfoo�VCResourceCompilerTool�VCLibrarianTool�VCManifestTool� ClCompilezWarning: unrecognized tool fooz$Warning: unrecognized tool ClCompileN��MSVSSettingsZValidateMSVSSettingsr r r r r r �#testValidateMSVSSettings_tool_names s ��
�z9TestSequenceFunctions.testValidateMSVSSettings_tool_namesc R C s� t �dddgdddddddd d
dddddd
ddddd
d
d
dd
dd
dddd
ddd
ddddddd
ddddd
ddddd
dddddd
ddd
ddd
d�@ddddddddddddddddddddddddddddddddddddddddddddddddd
dddddddddddddddddddddddddddddd�Ndddd
dd
dddddddddddd
ddddd
dd
ddddd
d�ddddd
dddddd�
ddddddddddddd�ddddddddddddddddddd�d�| j� | �g d�� dS )z%Tests that for invalid MSVS settings.�folder1;folder2�string1�string2�a_file_name�0�5Zfdkslj�truez-1�1�2�string1;string2�bogus�file1;file2)@�AdditionalIncludeDirectories�AdditionalOptions�AdditionalUsingDirectories�AssemblerListingLocation�AssemblerOutput�BasicRuntimeChecks�BrowseInformation�BrowseInformationFile�BufferSecurityCheck�CallingConvention� CompileAs�DebugInformationFormat�DefaultCharIsUnsigned�Detect64BitPortabilityProblems�DisableLanguageExtensions�DisableSpecificWarnings�EnableEnhancedInstructionSet�EnableFiberSafeOptimizations�EnableFunctionLevelLinking�EnableIntrinsicFunctions�
EnablePREfast�
Enableprefast�ErrorReporting�ExceptionHandling�ExpandAttributedSource�FavorSizeOrSpeed�FloatingPointExceptions�FloatingPointModel�ForceConformanceInForLoopScope�ForcedIncludeFiles�ForcedUsingFiles�GeneratePreprocessedFile�GenerateXMLDocumentationFiles�IgnoreStandardIncludePath�InlineFunctionExpansion�KeepComments�MinimalRebuild�
ObjectFile�OmitDefaultLibName�OmitFramePointers�OpenMP�Optimization�PrecompiledHeaderFile�PrecompiledHeaderThrough�PreprocessorDefinitions�ProgramDataBaseFileName�RuntimeLibrary�RuntimeTypeInfo�ShowIncludes�SmallerTypeCheck�
StringPooling�StructMemberAlignment�SuppressStartupBanner�TreatWChar_tAsBuiltInType�"UndefineAllPreprocessorDefinitions�UndefinePreprocessorDefinitions�UseFullPaths�UsePrecompiledHeader�UseUnicodeResponseFiles�WarnAsError�WarningLevel�WholeProgramOptimization�XMLDocumentationFileName�ZZXYZZfile3� a string1�33)N�AdditionalDependenciesZAdditionalDependencies_excluded�AdditionalLibraryDirectories�AdditionalManifestDependenciesr, �AddModuleNamesToAssembly�AllowIsolation�
AssemblyDebug�AssemblyLinkResource�BaseAddress�CLRImageType�CLRThreadAttribute�CLRUnmanagedCodeCheck�DataExecutionPrevention�
DelayLoadDLLs� DelaySign�Driver�EmbedManagedResourceFile�EnableCOMDATFolding� EnableUAC�EntryPointSymbolrA �FixedBaseAddress�ForceSymbolReferences�
FunctionOrder�GenerateDebugInformation�GenerateManifest�GenerateMapFile�HeapCommitSize�HeapReserveSize�IgnoreAllDefaultLibraries�IgnoreDefaultLibraryNames�IgnoreEmbeddedIDL�IgnoreImportLibrary�
ImportLibrary�KeyContainer�KeyFile�LargeAddressAware�LinkIncremental�LinkLibraryDependencies�LinkTimeCodeGeneration�ManifestFile�
MapExports�MapFileName�MergedIDLBaseFileName�
MergeSections�MidlCommandFile�ModuleDefinitionFile�OptimizeForWindows98�OptimizeReferences�
OutputFile�PerUserRedirection�Profile�ProfileGuidedDatabase�ProgramDatabaseFile�RandomizedBaseAddress�RegisterOutput�ResourceOnlyDLL�SetChecksum�ShowProgress�StackCommitSize�StackReserveSize�StripPrivateSymbols� SubSystem�SupportUnloadOfDelayLoadedDLLr_ �
SwapRunFromCD�SwapRunFromNet�
TargetMachine�TerminalServerAware�TurnOffAssemblyGeneration�TypeLibraryFile�TypeLibraryResourceID�UACExecutionLevel�UACUIAccess�UseLibraryDependencyInputsre �Version)r+ r, �CPreprocessOptions�DefaultCharType�DLLDataFileName�EnableErrorChecks�ErrorCheckAllocations�ErrorCheckBounds�ErrorCheckEnumRange�ErrorCheckRefPointers�ErrorCheckStubData�GenerateStublessProxies�GenerateTypeLibrary�HeaderFileNamerL �InterfaceIdentifierFileName�MkTypLibCompatibleZnotgood�OutputDirectoryrW �
ProxyFileName�RedirectOutputAndErrorsr^ r_ �TargetEnvironment�TypeLibraryNamerb �ValidateParametersrf rg �1003)
r, r+ �CulturerL Znotgood2rW �ResourceOutputFileNamer� r_ rb )rm rn r, �ExportNamedFunctionsr� r� �IgnoreSpecificDefaultLibrariesr� r� r� r_ re �truel)�AdditionalManifestFilesr, �AssemblyIdentity�ComponentFileName�DependencyInformationFile�GenerateCatalogFiles�InputResourceManifests�ManifestResourceFile�OutputManifestFile�RegistrarScriptFile�ReplacementsFiler_ r� �UpdateFileHashes�UpdateFileHashesSearchPath�UseFAT32Workaroundre �
VerboseOutput)r r r r r r )
z^Warning: for VCCLCompilerTool/BasicRuntimeChecks, index value (5) not in expected range [0, 4)zaWarning: for VCCLCompilerTool/BrowseInformation, invalid literal for int() with base 10: 'fdkslj'z^Warning: for VCCLCompilerTool/CallingConvention, index value (-1) not in expected range [0, 4)zZWarning: for VCCLCompilerTool/DebugInformationFormat, converted value for 2 not specified.z<Warning: unrecognized setting VCCLCompilerTool/Enableprefastz4Warning: unrecognized setting VCCLCompilerTool/ZZXYZzMWarning: for VCLinkerTool/TargetMachine, converted value for 2 not specified.z0Warning: unrecognized setting VCMIDLTool/notgoodz=Warning: unrecognized setting VCResourceCompilerTool/notgood2zHWarning: for VCManifestTool/UpdateFileHashes, expected bool; got 'truel'Nr r r r r �!testValidateMSVSSettings_settings- s� �B�P� ���� � [� � ]z7TestSequenceFunctions.testValidateMSVSSettings_settingsc Y C sH t �dddgddddddddd d
dddddd
dddddddddddddddddddddddddddddddddddddddddddddddddddddd�Gdddddddddddd d!dd"dddd#dddddd ddddddddd$ddddddd%dd&dddddddddddddddddddddd'ddddd(dddddd)ddddddd*ddd+�Uddd,ddddddddd-�dddddd.dd/dddddd0d1ddddddddddddd#ddd2dd3ddddd4d5�&ddddd6ddddddddddd(dd7ddddd8�ddddd9d:dddddddddddddddd;�ddd<�d=diddddd>�d?� | j� | �g d@�� dAS )Bz(Tests that for invalid MSBuild settings.r r r! r"