
qQc           @   s  d  Z  d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m	 Z	 d Z
 d Z d Z e j d	 k r d d
 l m Z e   d k r d Z q d Z n d Z e j e d k e  d e j e j f d     Y Z d   Z e d k re	 e    n  d S(   s"   Tests for distutils.msvc9compiler.iN(   t   DistutilsPlatformError(   t   support(   t   run_unittests  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
          manifestVersion="1.0">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="asInvoker" uiAccess="false">
        </requestedExecutionLevel>
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.CRT"
         version="9.0.21022.8" processorArchitecture="x86"
         publicKeyToken="XXXX">
      </assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>
s  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
          manifestVersion="1.0">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="asInvoker" uiAccess="false">
        </requestedExecutionLevel>
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.CRT"
         version="9.0.21022.8" processorArchitecture="x86"
         publicKeyToken="XXXX">
      </assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.MFC"
        version="9.0.21022.8" processorArchitecture="x86"
        publicKeyToken="XXXX"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>
s  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
          manifestVersion="1.0">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="asInvoker" uiAccess="false">
        </requestedExecutionLevel>
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>

  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.MFC"
        version="9.0.21022.8" processorArchitecture="x86"
        publicKeyToken="XXXX"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>t   win32(   t   get_build_versiong       @s)   These tests are only for MSVC8.0 or aboves   These tests are only for win32t   msvc9compilerTestCasec           B   s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C   sc   d d l  m } d   } d d l m } | j } | | _ z |  j t | d  Wd  | | _ Xd  S(   Ni(   t   query_vcvarsallc         S   s   d  S(   N(   t   None(   t   version(    (    s8   /sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyt   _find_vcvarsallo   s    (   t   msvc9compilers   wont find this version(   t   distutils.msvc9compilerR   t	   distutilsR
   t   find_vcvarsallt   assertRaisesR    (   t   selfR   R	   R
   t   old_find_vcvarsall(    (    s8   /sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyt   test_no_compilerj   s    			c         C   s   d d l  m } |  j t | j d d  d } | j | d  } |  j | d k  d d  l } | j } | j | d	  } |  j	 | d   | j | d
  } |  j d | k  d  S(   Ni(   t   Regt   xxxs   Control Panel\Desktopu   dragfullwindowsu   0u   1u   2t   xxxxs   Control Panelt   Desktop(   u   0u   1u   2(   R   R   R   t   KeyErrort	   get_valuet
   assertTruet   _winregt   HKEY_CURRENT_USERt	   read_keyst   assertEqualR   (   R   R   t   patht   vR   t   HKCUt   keys(    (    s8   /sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyt   test_reg_class{   s    	c         C   s   d d l  m } |  j   } t j j | d  } t | d  } z | j t  Wd  | j	   X|   } | j
 |  t |  } z2 d j g  | j   D] } | j   ^ q  } Wd  | j	   X|  j | t  d  S(   Ni(   t   MSVCCompilert   manifestt   ws   
(   R   R"   t   mkdtempt   osR   t   joint   opent   writet"   _MANIFEST_WITH_MULTIPLE_REFERENCESt   closet   _remove_visual_c_reft	   readlinest   rstripR   t   _CLEANED_MANIFEST(   R   R"   t   tempdirR#   t   ft   compilert   linet   content(    (    s8   /sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyt   test_remove_visual_c_ref   s    	2c         C   s   d d l  m } |  j   } t j j | d  } t | d  } z | j t  Wd  | j	   X|   } | j
 |  } |  j | d   d  S(   Ni(   R"   R#   R$   (   R   R"   R%   R&   R   R'   R(   R)   t"   _MANIFEST_WITH_ONLY_MSVC_REFERENCER+   R,   t   assertIsR   (   R   R"   R0   R#   R1   R2   t   got(    (    s8   /sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyt   test_remove_entire_manifest   s    	(   t   __name__t
   __module__R   R!   R5   R9   (    (    (    s8   /sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyR   f   s   			c           C   s   t  j t  S(   N(   t   unittestt	   makeSuiteR   (    (    (    s8   /sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyt
   test_suite   s    t   __main__(   t   __doc__t   sysR<   R&   t   distutils.errorsR    t   distutils.testsR   t   test.test_supportR   R6   R*   R/   t   platformt   distutils.msvccompilerR   R   t   SKIP_MESSAGEt
   skipUnlesst   TempdirManagert   TestCaseR   R>   R:   (    (    (    s8   /sys/lib/python2.7/distutils/tests/test_msvc9compiler.pyt   <module>   s*    		L	