File: //lib/python3/dist-packages/numpy/f2py/tests/__pycache__/test_compile_function.cpython-310.pyc
o
6��a� � @ s� d Z ddlZddlZddlZddlmZ ddlZddlZddl m
Z
ddlmZ dd� Z
ej�d d
dgdd
g�ejjdd�dd� ��Zdd� Zdd� Zej�dddg�dd� �ZdS )z0See https://github.com/numpy/numpy/pull/11937.
� N)�
import_module)�assert_equal� )�utilc C s, t �� s t�d� t �� st�d� d S d S )NzNeeds C compilerzNeeds FORTRAN 77 compiler)r �has_c_compiler�pytest�skip�has_f77_compiler� r
r
�H/usr/lib/python3/dist-packages/numpy/f2py/tests/test_compile_function.py�setup_module s
�r �
extra_argsz--nooptz--debugz--noopt --debug� z$Imported module seems never deleted.)�reasonc
C s� d}t �� }t �� }t�� }tj�|tt� � �d �}|d fD ]:}zt�
|� tjj
||| |d�}W t�
|� nt�
|� w t|d� tjdkrYt|�}|�� } t| d� tj|= qd S )NzT
integer function foo()
foo = 10 + 5
return
end
z.f)�
modulenamer
� source_fnr �win32� )r �get_module_dir�get_temp_module_name�os�getcwd�path�join�str�uuid�uuid4�chdir�numpy�f2py�compiler �sys�platformr �foo�modules)
r
�fsource�moddir�modname�cwd�targetr �ret_val�return_check�calc_resultr
r
r �test_f2py_init_compile s.
�
��r- c C s t j�d�} t| d� d S )N� invalidr )r r r r )r* r
r
r �test_f2py_init_compile_failureV s r/ c C s8 zt j} dt _tj�d�}t|d� W | t _d S | t _w )Nzdoes not existr. � )r! �
executabler r r r )�tempr* r
r
r �test_f2py_init_compile_bad_cmd] s r3 r% z'program test_f2py
end program test_f2pys'