ó
q®¸Qc           @   sÛ   d  Z  d d l Z d d l Z d d l m Z d d l m Z m Z m Z d d l	 m
 Z
 d d l m Z d d l m Z d e f d	 „  ƒ  YZ d
 e j e j f d „  ƒ  YZ d „  Z e d k r× e j d d ƒ n  d S(   s   Tests for distutils.ccompiler.iÿÿÿÿN(   t   captured_stdout(   t   gen_lib_optionst	   CCompilert   get_default_compiler(   t   customize_compiler(   t   debug(   t   supportt   FakeCompilerc           B   s/   e  Z d  „  Z d „  Z d d „ Z d „  Z RS(   c         C   s   d | S(   Ns   -L(    (   t   selft   dir(    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyt   library_dir_option   s    c         C   s   d d | g S(   Ns   -cools   -R(    (   R   R	   (    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyt   runtime_library_dir_option   s    i    c         C   s   d S(   Nt   found(    (   R   t   dirst   libR   (    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyt   find_library_file   s    c         C   s   d | S(   Ns   -l(    (   R   R   (    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyt   library_option   s    (   t   __name__t
   __module__R
   R   R   R   (    (    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyR      s   		t   CCompilerTestCasec           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   sz   t  ƒ  } d d g } d g } t j j d d ƒ d g } t | | | | ƒ } d d d	 d
 d d g } |  j | | ƒ d  S(   Nt   lib1t   lib2t   runlib1R	   t   namet   name2s   -Llib1s   -Llib2s   -cools	   -Rrunlib1R   s   -lname2(   R   t   ost   patht   joinR   t   assertEqual(   R   t   compilert   libdirst
   runlibdirst   libst   optst   wanted(    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyt   test_gen_lib_options   s    			c         C   sÁ   d t  f d „  ƒ  Y} | ƒ  } t ƒ   } | j d ƒ Wd  QX| j d ƒ |  j | j ƒ  d ƒ t t _ zF t ƒ   } | j d ƒ Wd  QX| j d ƒ |  j | j ƒ  d ƒ Wd  t	 t _ Xd  S(   Nt   MyCCompilerc           B   s   e  Z i  Z RS(    (   R   R   t   executables(    (    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyR$   (   s   t   xxxi    t    s   xxx
(
   R   R    t   debug_printt   seekR   t   readt   TrueR   t   DEBUGt   False(   R   R$   R   t   stdout(    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyt   test_debug_print&   s    		c         C   sn   t  ƒ  d k r d  Sd t j d <d t j d <d d
 d „  ƒ  Y} | ƒ  } t | ƒ |  j | j d d	 ƒ d  S(   Nt   unixt   my_art   ARs   -arflagst   ARFLAGSR   c           B   s   e  Z d  Z d „  Z RS(   R0   c         [   s   | |  _  d  S(   N(   t   exes(   R   t   kw(    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyt   set_executablesG   s    (   R   R   t   compiler_typeR6   (    (    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyR   D   s   t   archivers   my_ar -arflags(    (   R   R   t   environR   R   R4   (   R   R   t   comp(    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyt   test_customize_compiler:   s    	
(   R   R   R#   R/   R;   (    (    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyR      s   		c           C   s   t  j t ƒ S(   N(   t   unittestt	   makeSuiteR   (    (    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyt
   test_suiteN   s    t   __main__t   defaultTestR>   (   t   __doc__R   R<   t   test.test_supportR    t   distutils.ccompilerR   R   R   t   distutils.sysconfigR   t	   distutilsR   t   distutils.testsR   t   objectR   t   EnvironGuardt   TestCaseR   R>   R   t   main(    (    (    s4   /sys/lib/python2.7/distutils/tests/test_ccompiler.pyt   <module>   s   5	