+
    eil  c                   s   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	 ^ RI
t
^ RIHt ^ RIHt ^RIHt R t]! RR	4      tROR
 lt]
P*                  ! RR7      R 4       t]
P*                  ! RR7      R 4       t]
P*                  ! RR7      R 4       t]
P*                  ! RR7      R 4       t]
P*                  ! RR7      R 4       t]
P*                  ! RR7      R 4       tR tR tR tR tR t R t!]
PD                  PG                  ]PH                  RP8*  RR7      R 4       t%]
PD                  PG                  ] PL                  ! 4       R8g  ;'       g    ]PH                  RP8*  RR7      R 4       t']
PD                  PP                  R 4       t)R  t*R! t+R" t,R# t-R$ t.R% t/R& t0R' t1R( t2R) t3R* t4R+ t5R, t6R- t7]
PD                  Pq                  R.R7      R/ 4       t9R0 t:R1 t;R2 t<R3 t=R4 t>R5 t?R6 t@R7 tAR8 tB]
PD                  Pq                  R.R7      R9 4       tC]
PD                  PG                  ] PL                  ! 4       R8g  ;'       g    ]PH                  RP8*  R:R7      R; 4       tD]
PD                  PG                  ] PL                  ! 4       R8g  ;'       g    ]PH                  RP8*  R:R7      R< 4       tER= tFR> tGR? tHR@ tIRA tJRB tKRC tLRD tMRE tNRF tORG tPRH tQRI tRRJ tSRK tTRL tURM tVRN tWR# )Qi    N)
namedtuple)Path)main)NOGIL_BUILD)utilc                  s    \         P                  ! 4       '       g   \        P                  ! R 4       R# \	        4        R# )z$CLI command needs a Fortran compilerN)r   Zhas_fortran_compilerpytestskipf2pycli     C/usr/lib64/python3.14/site-packages/numpy/f2py/tests/test_f2py2e.pycompiler_check_f2pyclir      s#    $$&&:;	r	   PPathsz(finp, f90inp, pyf, wrap77, wrap90, cmodfc                s    \        V 4      p\        VP                  R4      VP                  R4      VP                  R4      VP                  V R24      VP                  V R24      VP                  V R24      R7      # )a8  Takes in a temporary file for testing and returns the expected output and input paths

Here expected output is essentially one of any of the possible generated
files.

..note::

     Since this does not actually run f2py, none of these are guaranteed to
     exist, and module names are typically incorrect

Parameters
----------
fname_inp : str
            The input filename
mname : str, optional
            The name of the module, untitled by default

Returns
-------
genp : NamedTuple PPaths
        The possible paths which are generated, not all of which exist
z.fz.f90.pyfz-f2pywrappers.fz-f2pywrappers2.f90module.c)finpf90inppyfZwrap77wrap90Zcmodf)r   r   Zwith_suffixZ	with_name)Z	fname_inpmnameZbpaths   && r
   get_io_pathsr   %   s~    . OEt$  (f%%89%(:;<oox01 r	   Zsession)Zscopec                    \         P                  ! RRRR4      P                  4       pV P                  4       R,          pVP	                  VRR7       V# )'Generates a single f90 file for testingtestssrcclizhiworld.f90z	hello.f90asciiencodingr   Zgetpath	read_textZgetbasetemp
write_texttmpdir_factoryfdatfn   &  r
   hello_world_f90r%   L   sI     <<}=GGID		#	#	%	3BMM$M)Ir	   c                    \         P                  ! RRRR4      P                  4       pV P                  4       R,          pVP	                  VRR7       V# )z(F90 file for testing warnings in gh23598r   r   Zcrackfortranzgh23598Warn.f90r   r   r   r    r$   r
   gh23598_warnr'   U   sK     <<8IJTTVD		#	#	%(9	9BMM$M)Ir	   c                r&   )z8F90 file for testing disallowed CLI arguments in ghff819r   r   r   zgh_22819.pyfr   r   r   r    r$   r
   gh22819_clir(   ^   sI     <<~>HHJD		#	#	%	6BMM$M)Ir	   c                r   )'Generates a single f77 file for testingr   r   r   zhi77.fzhello.fr   r   r   r    r$   r
   hello_world_f77r*   g   sI     <<x8BBDD		#	#	%		1BMM$M)Ir	   c                r   )r)   r   r   Zreturn_realzfoo77.fzfoo.fr   r   r   r    r$   r
   retreal_f77r+   p   sI     <<yAKKMD		#	#	%	/BMM$M)Ir	   c                sJ   \         P                  ! RRRR4      P                  4       p\         P                  ! RRRR4      P                  4       pV P                  4       R,          pV P                  4       R,          pVP	                  VRR	7       VP	                  VRR	7       V# )
r   r   r   f2cmapzisoFortranEnvMap.f90z.f2py_f2cmapz
f2cmap.f90Zmapfiler   r   r   )r!   r"   r,   r#   Zfmaps   &    r
   
f2cmap_f90r-   x   s     <<2HISSUD\\'5(NCMMOF		#	#	%	4B%%')3DMM$M)OOFWO-Ir	   c                s   \        V4      pVP                  \        RRV 2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        VP                  P                  R4       Uu. uF&  qDP                  4       '       g   K  VP                  NK(  	  ppRRR4       R# u upi   + '       g   i     R# ; i)zCheck that module names are handled correctly
gh-22819
Essentially, the -m name cannot be used to import the module, so the module
named in the .pyf needs to be used instead

CLI :: -m and a .pyf file
argvf2py -m blah Z*N)r   setattrsyssplitr   	switchdirparentr   ZrglobZis_fileZname)capfdr(   monkeypatchipathZitemZ	gen_paths   &&&   r
   test_gh22819_clir9      s     EV}UG%<%B%B%DE		%	%	+0<<+=+=c+BU+B4llnYTYY+B	U 
&	%U 
&	%	%s$   (CB< B<0C<CC	c           	     s   \        V4      pVP                  \        RRV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        P                  ! \        RR7      ;_uu_ 4        \        4        RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)z6Only one .pyf file allowed
gh-22819
CLI :: .pyf files
r.   r/   z
 hello.pyfzOnly one .pyf file per call)ZmatchN)r   r0   r1   r2   r   r3   r4   r   raisesZ
ValueErrorr   )r5   r(   r6   r7   s   &&& r
   test_gh22819_many_pyfr;      s}    
 EV}UG:%F%L%L%NO		%	%]]:-JKKI L 
&	%KK 
&	%	%s$   %B2B	B2B/*B22C	c                 s\   \        VR R7      pVP                  pVP                  \        RRV R2P	                  4       4       \
        P                  ! VP                  4      ;_uu_ 4        \        4        VP                  P                  4       pRRR4       R#   + '       g   i     R# ; i)testr   r.   f2py z -m testN)r   r   r0   r1   r2   r   r3   r4   r   r   r   )r5   r'   r6   foutlr7   Zwrapperr8   r
   test_gh23598_warnr@      sz    V4ELLEV
wh%%') 
	%	%	,,((* 
&	%	%	%s   +%BB+	c                sl   \        V4      p\        V4      P                  R,           pVP                  \        RRV RV 2P	                  4       4       \
        P                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rVRRR4       R#   + '       g   i     R# ; i)zAEnsures that a signature file is generated via the CLI
CLI :: -h
r   r.   zf2py -h  N)
r   Zstemr0   r1   r2   r   r3   r4   r   
readouterr)r5   r%   r6   r7   Zopathout_   &&&    r
   test_gen_pyfrF      s     !E!&&/EVxwaw%?%E%E%GH		%	%	!!# 
&	%	%	%s   ;B""B3	c                .   \        V4      pVP                  \        RRV 2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rERRR4       R#   + '       g   i     R# ; i)z@Ensures that a signature file can be dumped to stdout
CLI :: -h
r.   zf2py -h stdout N	r   r0   r1   r2   r   r3   r4   r   rB   r5   r%   r6   r7   rC   rD   r8   r
   test_gen_pyf_stdoutrJ      sg     !EVug%>%D%D%FG		%	%	!!# 
&	%	%	%   BB	c           	     s   \        V4      pVP                  \        RRV 2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        R4      P                  RRR7       \        P                  ! \        4      ;_uu_ 4        \        4        V P                  4       w  rERRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zbEnsures that the CLI refuses to overwrite signature files
CLI :: -h without --overwrite-signature
r.   f2py -h faker.pyf 	faker.pyf	Fake newsr   r   N)r   r0   r1   r2   r   r3   r4   r   r   r:   
SystemExitr   rB   )r5   r%   r6   r7   rD   errr8   r
   test_gen_pyf_no_overwriterQ      s     !EV'9%%A%G%G%IJ		%	%[$$[7$C]]:&&I%%'FA ' 
&	%&& 
&	%	%s$   ?CC
	8C
CCC.	zPython 3.12 required)Zreasonc                rG   )z8Check that modules are named correctly

CLI :: defaults
r.   zf2py --backend meson -c N)	r   r0   r1   r2   r   r3   r4   r   rB   rI   r8   r
   test_untitled_clirR      si     !EV'?w%G%M%M%OP		%	% !!# 
&	%	%	%rK   ZLinuxzCompiler and 3.12 requiredc           	     s`   Rp\        WR7      pVP                  pVP                  \        RRV RV 2P	                  4       4       \
        P                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rgRRR4       VP                  \        RRR.4       \
        P                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rgRRR4       R	pVP                  \        RRV R
V R2P	                  4       4       \
        P                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rgRRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)ziCheck that no distutils imports are performed on 3.12
CLI :: --fcompiler --help-link --backend distutils
hir=   r.   r>   z -c --fcompiler=gfortran -m Nf2pyz--help-linkZhi2z -c -m z --backend distutils)r   r   r0   r1   r2   r   r3   r4   r   rB   r   )r5   r%   r6   MNAMEr?   r7   rC   rD      &&&     r
   !test_no_py312_distutils_fcompilerrW      sH   
 E6ELLEVuUG#?wGMMO 
	%	% !!# 
& Vfm, 
	%	%	!!# 
& EVuUG75'1EFLLN 
	%	%	!!# 
&	% 
&	% 
&	% 
&	%	%s$   .E6F	F6F		F	F-	c                s   \        VRR7      pVP                  pRpRpVP                  \        RRV RV 2P	                  4       4       \
        P                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rxVP	                  4        F  p	K  	  VP	                  4        F  p
K  	  RRR4       R#   + '       g   i     R# ; i)	z1Tests that functions can be skipped
CLI :: skip:
r<   r=   t0 t4 t8 sd s8 s4td s0r.   r>   z -m test skip: N
r   r   r0   r1   r2   r   r3   r4   r   rB   )r5   r+   r6   r?   r7   toskipZ	remainingrC   rP   skeyrkey   &&&        r
   test_f2py_skipr_     s    
 F3EJJE FIV
wofX.4468 
	%	%	##%LLNDN OO%D% 
&	%	%	%   1ACC	c                s   \        VRR7      pVP                  pRpRpVP                  \        RRV RV 2P	                  4       4       \
        P                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rxVP	                  4        F  p	K  	  VP	                  4        F  p
K  	  RRR4       R#   + '       g   i     R# ; i)	z6Test that functions can be kept by only:
CLI :: only:
r<   r=   rX   rY   r.   r>   z -m test only: NrZ   )r5   r+   r6   r?   r7   r[   tokeeprC   rP   r\   r]   r^   r
   test_f2py_onlyrb   $  s     F3EJJE FFV
wofX.4468 
	%	%	##%LLNDN LLNDN 
&	%	%	%r`   c                s   \        VRR7      pVP                  pRp\        V4      pRpRp	VP                  \        RRV RV	 R	V R
V 2P                  4       4       \        P                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rVP                  4        F  pK  	  VP                  4        F  pK  	  RRR4       R#   + '       g   i     R# ; i)zZTests that it is possible to return to file processing mode
CLI :: :
BUG: numpy-gh #20520
r<   r=   rX   ztd s0 hiblahr.   r>    -m z only: z : N)r   r   r   r0   r1   r2   r   r3   r4   r   rB   )r5   r%   r+   r6   r?   r7   r[   Zipath2ra   r   rC   rP   r\   r]   s   &&&&          r
   test_file_processing_switchre   ;  s     F3EJJE F/"FFE
wd5'F8<BB 	
 
	%	%	##%LLNDN LLNDN 
&	%	%	%s   ACC*	c                s.   Rp\        WR7      pVP                  pVP                  \        RRV RV 2P	                  4       4       \
        P                  ! VP                  4      ;_uu_ 4        \        4        RRR4       R#   + '       g   i     R# ; i)z@Checks the generation of files based on a module name
CLI :: -m
rS   r=   r.   r>   rd   N)	r   r   r0   r1   r2   r   r3   r4   r   )r5   r%   r6   rU   r?   r7   r8   r
   test_mod_gen_f77rf   Y  sk     E6ELLEVuUG4w%?%E%E%GH		%	%	 
&	%	%	%s   .BB	c           	     s   Rp\        WR7      pVP                  pVP                  \        RRV RV R2P	                  4       4       \
        P                  ! VP                  4      ;_uu_ 4        \        4        \        R4      P                  4       ;_uu_ 4       pVP                  4       pRRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)	zuCheck that pyf files are correctly generated with module structure
CLI :: -m <name> -h pyf_file
BUG: numpy-gh #20520
rS   r=   r.   r>   rd   z
 -h hi.pyfzhi.pyfN)r   r   r0   r1   r2   r   r3   r4   r   r   openread)r5   r*   r6   rU   r?   r7   ZhipyfZpyfdatrV   r
   test_mod_gen_gh25263ri   j  s    
 E6EJJEVuUG4wj%I%O%O%QR		%	%	(^  ""eZZ\F # 
&	%"" 
&	%	%s$   /,CB>	,C>C	CC"	c                s   \        VRR7      pVP                  p\        P                  ! R4      p\        P                  ! R4      pVP	                  \
        RRV R2P                  4       4       \        P                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rxRRR4       VP	                  \
        RRV R	2P                  4       4       \        P                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rxRRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)
z@Lowers cases by flag or when -h is present

CLI :: --[no-]lower
r<   r=   zHI\(\)zhi\(\)r.   r>   z -m test --lowerNz -m test --no-lower)r   r   recompiler0   r1   r2   r   r3   r4   r   rB   	r5   r*   r6   r?   r7   ZcapshiZcapslorC   rD   	   &&&      r
   test_lower_cmodrn   z  s    
 7EJJEZZ	"FZZ	"FVuUG3C%D%J%J%LM		%	%	!!# 
& Vw&9:@@BD		%	%	!!# 
&	% 
&	% 
&	%	%s   D4E4E	E	c           	     s   \        VRR7      pVP                  p\        P                  ! R4      p\        P                  ! R4      pVP	                  \
        RRV RVP                   R2P                  4       4       \        P                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rxR	R	R	4       VP	                  \
        RRV RVP                   R
2P                  4       4       \        P                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rxR	R	R	4       R	#   + '       g   i     L; i  + '       g   i     R	# ; i)zVLowers cases in signature files by flag or when -h is present

CLI :: --[no-]lower -h
r<   r=   z	Block: HIz	Block: hir.   r>   z -h z -m test --overwrite-signatureNz) -m test --overwrite-signature --no-lower)r   r   rj   rk   r0   r1   r   r2   r   r3   r4   r   rB   rl   rm   r
   test_lower_sigro     s   
 7EJJEZZ%FZZ%F 
wd599+%CDJJL 
	%	%	!!# 
& 
wd599+%NO		 
	%	%	!!# 
&	% 
&	% 
&	%	%s   $E'E!E	!E2	c           
     sB   \        V4      pRpRpVP                  \        RRV RV RV 2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rgRRR4       R#   + '       g   i     R# ; i)zFEnsures that the build directory can be specified

CLI :: --build-dir
rc   Ztttmpr.   f2py -m rA   z --build-dir NrH   )r5   r%   r6   r7   r   ZodirrC   rD   rV   r
   test_build_dirrq     s    
 !EEDV"5'5'tfEKKMO 
	%	%	!!# 
&	%	%	%s   &BB	c                sh   \        V4      pVP                  \        RRV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        R4      P                  RRR7       \        4        V P                  4       w  rERRR4       R#   + '       g   i     R# ; i)	zPEnsures that the build directory can be specified

CLI :: --overwrite-signature
r.   rL   z --overwrite-signaturerM   rN   r   r   N)
r   r0   r1   r2   r   r3   r4   r   r   rB   rI   r8   r
   test_overwriterr     s    
 !EV
UG#9:@@BD 
	%	%[$$[7$C	!!# 
&	%	%	%s   9B  B1	c           	     s   \        V4      pRpVP                  \        RRV RV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rV\        V R24      P                  4       ;_uu_ 4       pRRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zBEnsures that TeX documentation is written out

CLI :: --latex-doc
rc   r.   rp   rA   z --latex-doc
module.texN
r   r0   r1   r2   r   r3   r4   r   rB   rg   r5   r%   r6   r7   r   rC   rD   ZotexrV   r
   test_latexdocrv     s    
 !EEV"5'5'>DDFH 
	%	%	!!#UG:&',,..$.	 
&	% /.	 
&	%	%s%   "AC	#B6	$C	6CC		C	c           	     :   \        V4      pRpVP                  \        RRV RV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rVRRR4       R#   + '       g   i     R# ; i)zEEnsures that TeX documentation is written out

CLI :: --no-latex-doc
rc   r.   rp   rA   z --no-latex-docNrH   r5   r%   r6   r7   r   rC   rD   rE   r
   test_nolatexdocry     sz    
 !EEV"5'5'AGGIK 
	%	%	!!# 
&	%	%	%   "B		B	c           	        \        V4      pRpVP                  \        RRV RV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rV\        RV R24      P                  4       ;_uu_ 4       pRRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)	zEnsures that truncated documentation is written out

TODO: Test to ensure this has no effect without --latex-doc
CLI :: --latex-doc --short-latex
rc   r.   rp   rA   z --latex-doc --short-latex./rs   Nrt   ru   rV   r
   test_shortlatexr}     s     !EE
5'5'!;<BBD 
	%	%	!!#BugZ()..00D0	 
&	% 10	 
&	%	%%   "AC
$B7	%C
7CC

C	c           	     r{   )	zAEnsures that RsT documentation is written out

CLI :: --rest-doc
rc   r.   rp   rA   z --rest-docr|   zmodule.restNrt   )r5   r%   r6   r7   r   rC   rD   ZorstrV   r
   test_restdocr     s    
 !EEV"5'5'=CCEG 
	%	%	!!#Bug[)*//11T1	 
&	% 21	 
&	%	%r~   c           	     rw   )zDEnsures that TeX documentation is written out

CLI :: --no-rest-doc
rc   r.   rp   rA   z --no-rest-docNrH   rx   rE   r
   test_norestexdocr   '  sz    
 !EEV"5'5'@FFHJ 
	%	%	!!# 
&	%	%	%rz   c           	     s   \        V4      pRpVP                  \        RRV RV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        \        RV R24      P                  4       ;_uu_ 4       pRRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)	zAEnsures that debugging wrappers are written

CLI :: --debug-capi
rc   r.   rp   rA   z --debug-capir|   r   N)	r   r0   r1   r2   r   r3   r4   r   rg   )r5   r%   r6   r7   r   ocmodr8   r
   test_debugcapir   7  s    
 !EEV"5'5'?EEGI 
	%	%	BugX&',,..%. 
&	%.. 
&	%	%s$   "0B8B%	B8%B50B88C		z2Consistently fails on CI; noisy so skip not xfail.c           	     s   \        V 4      pRpVP                  \        RRV RV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        \        P                  ! \        P                   R24      p\        P                  ! VRRR	7      pR
p\        P                  ! R4      pRRR4       R#   + '       g   i     R# ; i)z=Ensures that debugging wrappers work

CLI :: --debug-capi -c
rc   r.   rp   rA   z -c --debug-capi -c "import blah; blah.hi()"TUTF-8Zcapture_outputr    Hello World
a   debug-capi:Python C/API function blah.hi()
debug-capi:float hi=:output,hidden,scalar
debug-capi:hi=0
debug-capi:Fortran subroutine `f2pywraphi(&hi)'
debug-capi:hi=0
debug-capi:Building return value.
debug-capi:Python C/API function blah.hi: successful.
debug-capi:Freeing memory.
        N)r   r0   r1   r2   r   r3   r4   r   shlex
executable
subprocessruntextwrapZdedent)r%   r6   r7   r   cmd_runrouteoutZeerrs   &&      r
   test_debugcapi_bldr   G  s     !EEV"5'5'1ABHHJL 
	%	%	++ 00NOP~~gdWM 	  	 
&	%	%	%s   "A#CC 	c           	     sP   \        V4      pRpVP                  \        RRV RV 2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        RRR4       V P                  4       w  rVVP                  \        RRV RV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rVRRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zgEnsures that fortran subroutine wrappers for F77 are included by default

CLI :: --[no]-wrap-functions
rc   r.   rp   rA   Nz --wrap-functionsrH   rx   rE   r
   test_wrapfunc_defr   e  s     !EEVxwaw%?%E%E%GH		%	%	 
&FC V"5'5'1BCIIKM 
	%	%	!!# 
&	% 
&	% 
&	%	%s   !DDD	D%	c           	     rw   )z]Ensures that fortran subroutine wrappers for F77 can be disabled

CLI :: --no-wrap-functions
rc   r.   rp   rA   z --no-wrap-functionsNrH   rx   rE   r
   test_nowrapfuncr   ~  s{    
 !EEV"5'5'1EFLLNP 
	%	%	!!# 
&	%	%	%rz   c           	     s   \        V4      pRpVP                  \        RRV RV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        \        RV R24      P                  4       ;_uu_ 4       pVP                  4       pRRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)	zWAdd to the include directories

CLI :: -include
TODO: Document this in the help string
rc   r.   rp   rA   z' -include<stdbool.h> -include<stdio.h> r|   r   N)
r   r0   r1   r2   r   r3   r4   r   rg   rh   )r5   r%   r6   r7   r   r   ZocmrrE   r
   test_inclheaderr     s     !EE
5'5'!HI	 
	%	%	BugX&',,..%::<D / 
&	%.. 
&	%	%s$   "0CB5	#C5C CC	c                     R# )z7Add to the include directories

CLI :: --include-paths
Nr   r   r	   r
   test_inclpathr          	r	   c                 r   )z3Add to the include directories

CLI :: --help-link
Nr   r   r	   r
   
test_hlinkr     r   r	   c                0   \        V4      pVP                  \        RRV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        V P                  4       w  rERRR4       R#   + '       g   i     R# ; i)zGCheck that Fortran-to-Python KIND specs can be passed

CLI :: --f2cmap
r.   r/   z --f2cmap mapfileNrH   )r5   r-   r6   r7   rC   rD   r8   r
   test_f2cmapr     sj    
 EV}UG;L%M%S%S%UV		%	%	!!# 
&	%	%	%   BB	c                r   )z!Reduce verbosity

CLI :: --quiet
r.   r/   z --quietNrH   rI   r8   r
   
test_quietr     si    
 !EV}UG8%D%J%J%LM		%	%	!!# 
&	%	%	%r   c                r   )z%Increase verbosity

CLI :: --verbose
r.   r/   z
 --verboseNrH   rI   r8   r
   test_verboser     si    
 !EV}UG:%F%L%L%NO		%	%	!!# 
&	%	%	%r   c                s    VP                  \        RRR.4       \        P                  ! \        4      ;_uu_ 4        \        4        V P                  4       w  r#^ RIpRRR4       R#   + '       g   i     R# ; i)zEnsure version

CLI :: -v
r.   rT   z-vN)r0   r1   r   r:   rO   r   rB   Znumpy)r5   r6   rC   rD   Znps   &&   r
   test_versionr     sP    
 Vfd^4	z	"	"	!!# 
#	"	"	"s   !A''A8	c                s   \        V 4      pVP                  \        RRV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        \        P                  ! \        P                   R24      p\        P                  ! VRRR7      pRpR	R	R	4       R	#   + '       g   i     R	# ; i)
z
CLI :: -c
r.   r/   z -cr   Tr   r   r   N)r   r0   r1   r2   r   r3   r4   r   r   r   r   r   )r%   r6   r7   r   r   r   s   &&    r
   test_npdistopr     s    
 !EV}UG3%?%E%E%GH		%	%	++ 00NOP~~gdWM	 
&	%	%	%s   AB44C	z*Compiler and Python 3.12 or newer requiredc                s   \        V 4      pVP                  \        RRV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        \        P                   R2p\        '       d   VR,          pM	VR,          p\        P                  ! V4      p\        P                  ! VRRR	7      pR
p\        '       d   RRR4       R#   + '       g   i     R# ; i)z&
CLI :: --no-freethreading-compatible
r.   r/   z! -c --no-freethreading-compatible -c "import blah; blah.hi();z1import sys; assert sys._is_gil_enabled() is True""Tr   r   r   Nr   r0   r1   r2   r   r3   r4   r   r   r   r   r   r   r%   r6   r7   Zcmdr   r   r      &&     r
    test_no_freethreading_compatibler     s     !EV}UG;\%]%c%c%ef		%	%   =>;GGC4KC++c"~~gdWM; 
&	%	%	%s   A9C!!C2	c                s   \        V 4      pVP                  \        RRV R2P                  4       4       \        P
                  ! VP                  4      ;_uu_ 4        \        4        \        P                   R2p\        '       d   VR,          pM	VR,          p\        P                  ! V4      p\        P                  ! VRRR	7      pR
pRRR4       R#   + '       g   i     R# ; i)z#
CLI :: --freethreading_compatible
r.   r/   z -c --freethreading-compatibler   z2import sys; assert sys._is_gil_enabled() is False"r   Tr   r   r   Nr   r   r   r
   test_freethreading_compatibler     s     !EV}UG;Y%Z%`%`%bc		%	%   =>;HHC4KC++c"~~gdWM 
&	%	%	%s   A.CC&	c                 r   )z
CLI :: -c --fcompiler
Nr   r   r	   r
   test_npd_fcompilerr   7      
 	r	   c                 r   )z
CLI :: -c --compiler
Nr   r   r	   r
   test_npd_compilerr   ?  r   r	   c                 r   )z
CLI :: -c --help-fcompiler
Nr   r   r	   r
   test_npd_help_fcompilerr   G  r   r	   c                 r   )z
CLI :: -c --f77exec
Nr   r   r	   r
   test_npd_f77execr   O  r   r	   c                 r   )z
CLI :: -c --f90exec
Nr   r   r	   r
   test_npd_f90execr   W  r   r	   c                 r   )z
CLI :: -c --f77flags
Nr   r   r	   r
   test_npd_f77flagsr   _  r   r	   c                 r   )z
CLI :: -c --f90flags
Nr   r   r	   r
   test_npd_f90flagsr   g  r   r	   c                 r   )z
CLI :: -c --opt
Nr   r   r	   r
   test_npd_optr   o  r   r	   c                 r   )z
CLI :: -c --arch
Nr   r   r	   r
   test_npd_archr   w  r   r	   c                 r   )z
CLI :: -c --noopt
Nr   r   r	   r
   test_npd_nooptr     r   r	   c                 r   )z
CLI :: -c --noarch
Nr   r   r	   r
   test_npd_noarchr     r   r	   c                 r   )z
CLI :: -c --debug
Nr   r   r	   r
   test_npd_debugr     r   r	   c                 r   )z
CLI :: -c --link-<resource>
Nr   r   r	   r
   test_npd_link_autor     r   r	   c                 r   )z'
CLI :: -c -L/path/to/lib/ -l<libname>
Nr   r   r	   r
   test_npd_libr     r   r	   c                 r   )z
CLI :: -D<define>
Nr   r   r	   r
   test_npd_definer     r   r	   c                 r   )z
CLI :: -U<name>
Nr   r   r	   r
   test_npd_undefiner     r   r	   c                 r   )z
CLI :: -I/path/to/include/
Nr   r   r	   r
   test_npd_inclr     r   r	   c                 r   )z0
CLI :: <filename>.o <filename>.so <filename>.a
Nr   r   r	   r
   test_npd_linkerr     r   r	   )Zuntitled)i   i   )XZplatformrj   r   r   r1   r   Zcollectionsr    Zpathlibr   r   Znumpy.f2py.f2py2er   r   Znumpy.testing._private.utilsr   Z r   r   r   r   Zfixturer%   r'   r(   r*   r+   r-   r9   r;   r@   rF   rJ   rQ   ZmarkZskipifZversion_inforR   ZsystemrW   Zxfailr_   rb   re   rf   ri   rn   ro   rq   rr   rv   ry   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r	   r
   <module>r      sn    	   
  "   - 4  
HH	IN i  ! i  ! i  ! i  ! i  ! i  !1&	
:)
,C C$$/8NO
) P
) X__&'1SSs7G7G77R\xyG zG> D D.D.D<%"0 .4$.N8"2"4$; 8,5$@ :  MN# O#::2> 0.		I$$- MN# O# X__&'1QQc6F6F'6QG  I$I$. X__&'1QQc6F6F'6QG  I$I$2																		r	   