o
    z¨Êh�  ã                   @   sè   d dl Z d dlZd dlZd dlZd dlmZ ddlm	Z	 G dd„ de	j
ƒZG dd„ de	j
ƒZG dd	„ d	e	j
ƒZd
d„ ZG dd„ de	j
ƒZG dd„ de	j
ƒZG dd„ de	j
ƒZejjdd„ ƒZejjejje ¡ dvdd�dd„ ƒƒZdS )é    Né   )Úutilc                   @   ó.   e Zd Ze dddd¡gZejjdd„ ƒZ	dS )ÚTestIntentInOutÚtestsÚsrcÚ
regressionú	inout.f90c                 C   s`   t jdt jd�d d d… }t t| jj|¡ t jdt jd�}| j |¡ t  |g d¢¡s.J ‚d S )Né   ©Údtypeé   é   )r   r   r   )	ÚnpÚarangeÚfloat32ÚpytestÚraisesÚ
ValueErrorÚmoduleÚfooÚallclose)ÚselfÚx© r   úR/var/www/html/env/lib/python3.10/site-packages/numpy/f2py/tests/test_regression.pyÚ
test_inout   s
   zTestIntentInOut.test_inoutN)
Ú__name__Ú
__module__Ú__qualname__r   ÚgetpathÚsourcesr   ÚmarkÚslowr   r   r   r   r   r      ó    r   c                   @   r   )ÚTestNegativeBoundsr   r   Únegative_boundszissue_20853.f90c                 C   s^   t  d¡}d}d}dd„ }| jj|||d |||ƒ… d�}t jdt jd�}t  ||¡s-J ‚d S )	Né   iúÿÿÿé   c                 S   s   ||  d S )Nr   r   )ÚxlÚxhr   r   r   Úubound&   s   z0TestNegativeBounds.test_negbound.<locals>.ubound)Úis_Úie_Úarré   r   )r   r   r   r   r   r   )r   ÚxvecÚxlowÚxhighr+   ÚrvalÚexpvalr   r   r   Útest_negbound   s   

ÿz TestNegativeBounds.test_negboundN)
r   r   r   r   r    r!   r   r"   r#   r5   r   r   r   r   r%      r$   r%   c                   @   r   )ÚTestNumpyVersionAttributer   r   r   r	   c                 C   s8   t | jdƒsJ ‚t| jjtƒsJ ‚tj| jjksJ ‚d S )NÚ__f2py_numpy_version__)Úhasattrr   Ú
isinstancer7   Ústrr   Ú__version__)r   r   r   r   Útest_numpy_version_attribute3   s   z6TestNumpyVersionAttribute.test_numpy_version_attributeN)
r   r   r   r   r    r!   r   r"   r#   r<   r   r   r   r   r6   .   s    r6   c                  C   s.   t j ¡ } t | ¡}dD ]}||v sJ ‚qd S )N)zfortranobject.czfortranobject.h)r   Úf2pyÚget_includeÚosÚlistdir)ÚincdirÚfnames_in_dirÚfnamer   r   r   Útest_include_path@   s
   

ÿrD   c                   @   sV   e Zd Ze dddd¡gZde ddd¡› �de ddd¡› �gZejj	dd„ ƒZ
d	S )
ÚTestIncludeFilesr   r   r   zincfile.f90z-Iz--include-paths c                 C   s"   d}| j  dd¡}||ksJ ‚d S )Ng      @g      @g      @)r   Úadd)r   ÚexpÚresr   r   r   Útest_gh25344L   s   zTestIncludeFiles.test_gh25344N)r   r   r   r   r    r!   Úoptionsr   r"   r#   rI   r   r   r   r   rE   G   s    ÿrE   c                   @   s>   e Zd Ze dddd¡gZejjdd„ ƒZ	ejjdd„ ƒZ
d	S )
ÚTestF77Commentsr   r   r   zf77comments.fc                 C   óR   t jdt jd�}t jdt jd�}| j ||¡}|d dksJ ‚|d dks'J ‚d S ©Nr   r   é   r   é   r   é   ©r   ÚarrayÚint32r   Útestsub©r   Úx1Úx2rH   r   r   r   Útest_gh26148V   ó
   zTestF77Comments.test_gh26148c                 C   s0   t jddt jd�d }| j ¡ }t ||¡ d S )Nr   r/   r   r   )r   r   r   r   Útestsub2ÚnptÚassert_allclose)r   ÚexpectedrH   r   r   r   Útest_gh26466^   s   
zTestF77Comments.test_gh26466N)r   r   r   r   r    r!   r   r"   r#   rX   r^   r   r   r   r   rK   R   s    
rK   c                   @   r   )ÚTestF90Contiuationr   r   r   úf90continuation.f90c                 C   rL   rM   rQ   rU   r   r   r   Útest_gh26148bi   rY   z TestF90Contiuation.test_gh26148bN)
r   r   r   r   r    r!   r   r"   r#   ra   r   r   r   r   r_   e   r$   r_   c               
   C   s^   zt jt  dddd¡gdgdd�} W d S  ty. } zdt|ƒvs#J ‚W Y d }~d S d }~ww )	Nr   r   r   r`   z	-lfoo.barÚBlah)Úmodule_namezlparen got assign)r   Úbuild_moduler    ÚRuntimeErrorr:   ©ÚaaÚrerrr   r   r   Útest_gh26623q   s   ý€ÿri   )ÚLinuxÚDarwinz$Unsupported on this platform for now)Úreasonc               
   C   s`   zt jt  dddd¡gddgdd�} W d S  ty/ } zd	t|ƒv s$J ‚W Y d }~d S d }~ww )
Nr   r   r   zf77fixedform.f95z--f77flags='-ffixed-form -O2'z--f90flags="-ffixed-form -Og"rb   )rJ   rc   Úunknown_subroutine_)r   rd   r    ÚImportErrorr:   rf   r   r   r   Útest_gh25784~   s   ýù	€ÿro   )r?   r   ÚplatformÚnumpyr   Únumpy.testingÚtestingr[   Ú r   ÚF2PyTestr   r%   r6   rD   rE   rK   r_   r"   r#   ri   ÚskipifÚsystemro   r   r   r   r   Ú<module>   s$    
