ó
\K]c           @  s|   d  d l  m Z d  d l m Z d  d l m Z m Z m Z m Z d  d l	 m
 Z
 d d l m Z d e f d     YZ d	 S(
   iĸĸĸĸ(   t   print_function(   t   Pipeline(   t   jitt   generated_jitt   typest   objmode(   t
   FunctionIRi   (   t   TestCaset   TestCustomPipelinec           B  s,   e  Z d    Z d   Z d   Z d   Z RS(   c           s<   t  t |   j   d t f   f d     Y    |  _ d  S(   Nt   CustomPipelinec             s,   e  Z g  Z   f d    Z   f d   Z RS(   c           s&   |  j  j |  t   |   j |  S(   N(   t   custom_pipeline_cachet   appendt   supert   compile_extra(   t   selft   func(   R	   (    s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyR      s    c           s,   |  j  j |  t   |   j | | |  S(   N(   R
   R   R   t
   compile_ir(   R   t   func_irt   argst   kwargs(   R	   (    s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyR      s    (   t   __name__t
   __module__R
   R   R   (    (   R	   (    s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyR	      s   (   R   R   t   setUpR   t   pipeline_class(   R   (    (   R	   s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyR   
   s    c         C  sg   |  j  |  j j g   t d |  j  d    } |  j | d  d  |  j  |  j j | j g  d  S(   NR   c         S  s   |  S(   N(    (   t   x(    (    s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyt   foo!   s    i   (   t   assertListEqualR   R
   R   t   assertEqualt   py_func(   R   R   (    (    s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyt   test_jit_custom_pipeline   s
    c           ss   |  j  |  j j g   d     t d |  j    f d    } |  j | d  d  |  j  |  j j   g  d  S(   Nc         S  s   |  S(   N(    (   R   (    (    s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyt   inner,   s    R   c           s   t  |  t j  r   Sd  S(   N(   t
   isinstanceR   t   Integer(   R   (   R   (    s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyR   /   s    i   (   R   R   R
   R   R   (   R   R   (    (   R   s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyt"   test_generated_jit_custom_pipeline)   s    	!c         C  sī   |  j  |  j j g   t d |  j  d    } d } |  j | |  | d  |  j t |  j j  d  |  j j d } |  j | | j  |  j j d } |  j | t	  d  S(   NR   c         S  s*   t  d d   |  t d  7}  Wd  QX|  S(   NR   t   intpi   (   R   t   int(   R   (    (    s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyR   ;   s    i{   i   i   i    (
   R   R   R
   R   R   t   lent   assertIsR   t   assertIsInstanceR   (   R   R   t   argt   firstt   second(    (    s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyt   test_objmode_custom_pipeline8   s    (   R   R   R   R   R!   R*   (    (    (    s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyR   	   s   			N(   t
   __future__R    t   numba.compilerR   t   numbaR   R   R   R   t   numba.irR   t   supportR   R   (    (    (    s8   lib/python2.7/site-packages/numba/tests/test_pipeline.pyt   <module>   s
   "