B
     \                 @   sl   d dl mZmZ d dlZddlmZmZmZ d dlm	Z
 d dlmZmZ G dd deZed	krhe
  dS )
    )print_functionabsolute_importN   )TestCaseoverride_configtag)unittest_support)jittypesc               @   s@   e Zd ZdZdd Zdd Zdd Zedd	d
 Zdd Z	dS )TestDebugInfozF
    These tests only checks the compiled assembly for debuginfo.
    c             C   s   | | ||S )N)compileZinspect_asm)selffnsig r   9lib/python3.7/site-packages/numba/tests/test_debuginfo.py_getasm   s    
zTestDebugInfo._getasmc             C   s>   | j ||d}td|tj}|d k	}| j||d| d d S )N)r   z\.section.+debugzdebug info not found in:
%s)msg)r   researchIZassertEqual)r   r   r   expectZasmmZgotr   r   r   _check   s    zTestDebugInfo._checkc             C   s,   t ddddd }| j|tjfdd d S )NTF)nopythondebugc             S   s   | S )Nr   )xr   r   r   foo   s    z3TestDebugInfo.test_no_debuginfo_in_asm.<locals>.foo)r   r   )r	   r   r
   int32)r   r   r   r   r   test_no_debuginfo_in_asm   s    z&TestDebugInfo.test_no_debuginfo_in_asmZ	importantc             C   s,   t ddddd }| j|tjfdd d S )NT)r   r   c             S   s   | S )Nr   )r   r   r   r   r   !   s    z0TestDebugInfo.test_debuginfo_in_asm.<locals>.foo)r   r   )r	   r   r
   r   )r   r   r   r   r   test_debuginfo_in_asm   s    z#TestDebugInfo.test_debuginfo_in_asmc          	   C   sh   t ddT tdddd }| j|tjfdd tddd	d
d }| j|tjfdd W d Q R X d S )NZDEBUGINFO_DEFAULTr   T)r   c             S   s   | S )Nr   )r   r   r   r   r   *   s    z4TestDebugInfo.test_environment_override.<locals>.foo)r   r   F)r   r   c             S   s   | S )Nr   )r   r   r   r   bar0   s    z4TestDebugInfo.test_environment_override.<locals>.bar)r   r	   r   r
   r   )r   r   r!   r   r   r   test_environment_override'   s
    z'TestDebugInfo.test_environment_overrideN)
__name__
__module____qualname____doc__r   r   r   r   r    r"   r   r   r   r   r   
   s   r   __main__)Z
__future__r   r   r   Zsupportr   r   r   Znumbar   Zunittestr	   r
   r   r#   mainr   r   r   r   <module>   s   ,