a ;jg@sddlZddlZddlZddlZddlmZddlm Z Gddde j Z Gddde j Z Gdd d e j Z d d ZGd d d e j ZGddde j ZGddde j ZejjddZejjejjedvddddZdS)N)utilc@s.eZdZeddddgZejjddZ dS)TestIntentInOuttestssrc regression inout.f90cCs`tjdtjdddd}tt|jj|tjdtjd}|j|t|gds\JdS)NZdtype)r rr ) nparangefloat32pytestZraises ValueErrormodulefooallclose)selfxrJ/usr/local/lib/python3.9/site-packages/numpy/f2py/tests/test_regression.py test_inouts  zTestIntentInOut.test_inoutN) __name__ __module__ __qualname__rgetpathsourcesrmarkslowrrrrrr src@s.eZdZeddddgZejjddZ dS)TestNegativeBoundsrrZnegative_boundszissue_20853.f90cCs^td}d}d}dd}|jj|||d|||d}tjdtjd}t||sZJdS) N icSs ||dS)Nrr)Zxlxhrrrubound&sz0TestNegativeBounds.test_negbound..ubound)is_Zie_Zarr r )r rrrrr)rZxvecZxlowZxhighr%rvalZexpvalrrr test_negbounds  z TestNegativeBounds.test_negboundN) rrrrrrrrr r)rrrrr!sr!c@s.eZdZeddddgZejjddZ dS)TestNumpyVersionAttributerrrrcCs8t|jdsJt|jjts"Jtj|jjks4JdS)N__f2py_numpy_version__)hasattrr isinstancer+strr __version__)rrrrtest_numpy_version_attribute3sz6TestNumpyVersionAttribute.test_numpy_version_attributeN) rrrrrrrrr r0rrrrr*.sr*cCs.tj}t|}dD]}||vsJqdS)N)zfortranobject.czfortranobject.h)r Zf2pyZ get_includeoslistdir)incdirZ fnames_in_dirfnamerrrtest_include_path@s  r5c@sVeZdZeddddgZdeddddedddgZejj ddZ d S) TestIncludeFilesrrrz incfile.f90z-Iz--include-paths cCs"d}|jdd}||ksJdS)Ng@g@g@)radd)rexpresrrr test_gh25344LszTestIncludeFiles.test_gh25344N) rrrrrroptionsrrr r:rrrrr6Gs r6c@s>eZdZeddddgZejjddZ ejjddZ d S) TestF77Commentsrrrz f77comments.fcCsRtjdtjd}tjdtjd}|j||}|ddks>J|ddksNJdSNr r rrr arrayZint32rZtestsubrx1Zx2r9rrr test_gh26148Vs zTestF77Comments.test_gh26148cCs0tjddtjdd}|j}t||dS)Nrr'r r )r rrrZtestsub2nptZassert_allclose)rexpectedr9rrr test_gh26466^s zTestF77Comments.test_gh26466N) rrrrrrrrr rErHrrrrr<Rs  r<c@s.eZdZeddddgZejjddZ dS)TestF90Contiuationrrrf90continuation.f90cCsRtjdtjd}tjdtjd}|j||}|ddks>J|ddksNJdSr=rArCrrr test_gh26148bis z TestF90Contiuation.test_gh26148bN) rrrrrrrrr rKrrrrrIesrIc Cs^z$tjtddddgdgdd}Wn4tyX}zdt|vsDJWYd}~n d}~00dS) NrrrrJz -lfoo.barBlah) module_namezlparen got assign)r build_moduler RuntimeErrorr.ZaaZrerrrrr test_gh26623qs rQ)LinuxDarwinz$Unsupported on this platform for now)reasonc Cs`z&tjtddddgddgdd}Wn4tyZ}zd t|vsFJWYd}~n d}~00dS) Nrrrzf77fixedform.f95z--f77flags='-ffixed-form -O2'z--f90flags="-ffixed-form -Og"rL)r;rMZunknown_subroutine_)rrNr ImportErrorr.rPrrr test_gh25784~s rV)r1rplatformnumpyr Z numpy.testingZtestingrFrZF2PyTestrr!r*r5r6r<rIrr rQZskipifsystemrVrrrrs"