1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
U
P±dÏã@s¨dZddlZddlZddlZddlmZddlZddlZddl    m
Z
dd„Z ej   dd    d
gd d g¡ej jd ddd„ƒƒZdd„Zdd„Zej   dddg¡dd„ƒZdS)z0See https://github.com/numpy/numpy/pull/11937.
 
éN)Ú import_moduleé)ÚutilcCs(t ¡st d¡t ¡s$t d¡dS)NzNeeds C compilerzNeeds FORTRAN 77 compiler)rZhas_c_compilerÚpytestÚskipZhas_f77_compiler©rrú]d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/f2py/tests/test_compile_function.pyÚ setup_modules
r    Ú
extra_argsz--nooptz--debugz--noopt --debugÚz$Imported module seems never deleted.)Úreasonc
 
Cs¬d}t ¡}t ¡}t ¡}tj |tt     ¡ƒd¡}|dfD]:}t 
|¡&t j j ||||d}|dksnt‚W5QRXq>tjdkr¨t|ƒ}| ¡}    |    dks t‚tj|=dS)NzT
        integer function foo()
        foo = 10 + 5
        return
        end
    z.f)Ú
modulenamer
Ú    source_fnrÚwin32é)rZget_module_dirZget_temp_module_nameÚosÚgetcwdÚpathÚjoinÚstrÚuuidÚuuid4Ú    switchdirÚnumpyÚf2pyÚcompileÚAssertionErrorÚsysÚplatformrZfooÚmodules)
r
ÚfsourceZmoddirÚmodnameÚcwdÚtargetrÚret_valZ return_checkZ calc_resultrrrÚtest_f2py_init_compiles$
  ý
 r%cCstj d¡}|dkst‚dS)Nóinvalidr)rrrr)r$rrrÚtest_f2py_init_compile_failureOs r'cCs6z(tj}dt_tj d¡}|dks&t‚W5|t_XdS)Nzdoes not existr&é)rÚ
executablerrrr)Útempr$rrrÚtest_f2py_init_compile_bad_cmdVs  r+r z'program test_f2py
end program test_f2pys'program test_f2py
end program test_f2pyc    Cs8t |¡$tjj|ddd}|dks*t‚W5QRXdS)NÚtest_compile_from_stringsz.f90)r Ú    extensionr)rrrrrr)Ztmpdirr r$rrrr,hs      þr,)Ú__doc__rrrÚ    importlibrrZ
numpy.f2pyrr rr    ÚmarkZ parametrizeZleaks_referencesr%r'r+r,rrrrÚ<module>s,       ÿ  4þþ