o
    ZZh                     @   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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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ejjG dd de	j
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   Zdtype      )r   r   r   )	nparangefloat32pytestZraises
ValueErrormodulefooallclose)selfx r   O/var/www/auris/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   )TestDataOnlyMultiModuler   r   r   zdatonly.f90c                 C   s@   | j jjdks	J | j jjdksJ d}| j ddksJ d S )Nd   i     i  )r   ZdatonlyZ	max_valueZdatZmax_Zsimple_subroutine)r   Zint_inr   r   r   	test_mdat   s   z!TestDataOnlyMultiModule.test_mdatN)
r   r   r   r   r   r   r   r    r!   r&   r   r   r   r   r#      r"   r#   c                   @   r   )TestNegativeBoundsr   r   Z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   )Zxlxhr   r   r   ubound2   s   z0TestNegativeBounds.test_negbound.<locals>.ubound)is_Zie_Zarr   r   )r   r   r   r   r   r   )r   ZxvecZxlowZxhighr+   rvalZexpvalr   r   r   test_negbound+   s   

z TestNegativeBounds.test_negboundN)
r   r   r   r   r   r   r   r    r!   r/   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   
isinstancer1   strr   __version__r   r   r   r   test_numpy_version_attribute?   s   z6TestNumpyVersionAttribute.test_numpy_version_attributeN)
r   r   r   r   r   r   r   r    r!   r7   r   r   r   r   r0   :       r0   c                  C   s.   t j } t| }dD ]}||v sJ qd S )N)zfortranobject.czfortranobject.h)r   Zf2pyZget_includeoslistdir)ZincdirZfnames_in_dirfnamer   r   r   test_include_pathL   s
   

r<   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_gh25344X   s   zTestIncludeFiles.test_gh25344N)r   r   r   r   r   r   optionsr   r    r!   rA   r   r   r   r   r=   S   s    r=   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      r   arrayZint32r   Ztestsubr   x1Zx2r@   r   r   r   test_gh26148b   
   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   Ztestsub2nptZassert_allclose)r   expectedr@   r   r   r   test_gh26466j   s   
zTestF77Comments.test_gh26466N)r   r   r   r   r   r   r   r    r!   rL   rP   r   r   r   r   rC   ^   s    
rC   c                   @   r   )TestF90Contiuationr   r   r   f90continuation.f90c                 C   rD   rE   rH   rJ   r   r   r   test_gh26148bu   rM   z TestF90Contiuation.test_gh26148bN)
r   r   r   r   r   r   r   r    r!   rS   r   r   r   r   rQ   q   r"   rQ   c                   @   r   )TestLowerF2PYDirectivesr   r   r   zlower_f2py_fortran.f90c                 C   s   | j d d S )Nr   )r   Zinquire_nextr6   r   r   r   test_gh28014   s   z$TestLowerF2PYDirectives.test_gh28014N)
r   r   r   r   r   r   r   r    r!   rU   r   r   r   r   rT   }   r"   rT   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   rR   z	-lfoo.barBlah)module_namezlparen got assign)r   build_moduler   RuntimeErrorr4   ZaaZrerrr   r   r   test_gh26623   s   r[   )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"rV   )rB   rW   Zunknown_subroutine_)r   rX   r   ImportErrorr4   rZ   r   r   r   test_gh25784   s   	r`   c                   @   r   )TestAssignmentOnlyModulesr   r   r   zassignOnlyModule.f90c                 C   s:   | j jjdks	J | j jjdksJ | j jjdksJ d S )N      H   )r   	f_globalsZn_maxZi_maxZj_maxr6   r   r   r   test_gh27167   s   z&TestAssignmentOnlyModules.test_gh27167N)
r   r   r   r   r   r   r   r    r!   rf   r   r   r   r   ra      r8   ra   )r9   r   platformnumpyr   Znumpy.testingtestingrN    r   ZF2PyTestr   r#   r'   r0   r<   r=   rC   rQ   rT   r    r!   r[   Zskipifsystemr`   ra   r   r   r   r   <module>   s,    	
