zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
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
28
29
30
31
32
33
34
U
O±d{ã    @s¾ddlZddlmZmZedko&edkZerZej e e     e 
e ¡d¡¡¡ddl m Z n ddlm Z edddddddd    ZGd
d „d e ƒZGd d „d eƒZGdd„dejƒZerºe ¡dS)éN)ÚsysÚpathÚ__main__z..)Ú CCompilerOpt)ÚgccÚclangZiccZiccwZmsvc)rr)r)Úx86Úx64Úppc64Úppc64leZarmhfÚaarch64Znarchc@s:eZdZdZdd„Zdd„Zdd„Zedd    œd
d „ƒZd S) ÚFakeCCompilerOpt)ÚarchÚcompilerÚ
extra_argscOstj|df|ŽdS©N)rÚ__init__)ÚselfÚargsÚkwargs©rúdd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/distutils/tests/test_ccompiler_opt_conf.pyrszFakeCCompilerOpt.__init__cKs|Srr)rÚsourcesÚflagsrrrrÚ dist_compileszFakeCCompilerOpt.dist_compilecCstjSr)r Ú    fake_info©rrrrÚ    dist_infoszFakeCCompilerOpt.dist_infoF)ÚstderrcGsdSrr)rrrrrÚdist_logszFakeCCompilerOpt.dist_logN)    Ú__name__Ú
__module__Ú __qualname__rrrrÚ staticmethodrrrrrr s r c@sHeZdZdZdd„Zdd„Zdd„Zdd    „Zd
d „Zd d „Z    dd„Z
dS)Ú_TestConfFeatureszlA hook to check the sanity of configured features
-   before it called by the abstract class '_Feature'
    cCsX|j}| ¡D]\}}| d|||¡qt |¡}| ¡D]\}}| d|||¡q:|S)Nzattribute conf_featureszconf_features_partial())Z conf_featuresÚitemsÚ test_featurer Úconf_features_partial)rZconf_allÚ feature_nameÚfeatureZ conf_partialrrrr'&s"þ
þz'_TestConfFeatures.conf_features_partialcCsŠd |||j|j¡}| ¡s(t|dƒ‚| ¡D]$\}}| |||¡| |||¡q0| ||||¡|     ||||¡| 
||||¡dS)NzJduring validate '{}' within feature '{}', march '{}' and compiler '{}'
>> z!feature name must be in uppercase) ÚformatZcc_marchZcc_nameÚisupperÚAssertionErrorr%Útest_option_typesÚtest_duplicatesÚ test_impliesÚ
test_groupÚtest_extra_checks)rÚlogÚ    search_inr(Ú feature_dictÚ    error_msgÚoptionÚvalrrrr&6sÿý z_TestConfFeatures.test_featurecCs¨ttfdftfdftfdftfdfttdƒfdffD]Z\}}||k}|sJq4t||ƒsŠdd„|˜Dƒ}d |¡}t|d    ||t|ƒjfƒ‚qq4|s¤t|d
|ƒ‚dS) N©ÚimpliesÚheadersrÚgroupÚdetectÚ extra_checks)Údisable)Zinterest)Zimplies_detect)ZautoveccSsg|]
}|j‘qSr)r )Ú.0ÚtrrrÚ
<listcomp>Usz7_TestConfFeatures.test_option_types.<locals>.<listcomp>z or z+expected '%s' type for option '%s' not '%s'zinvalid option name '%s')    ÚstrÚlistÚintÚboolÚtypeÚ
isinstanceÚjoinr,r )rr5r6r7ÚtpÚ    availableZfound_itZerror_tprrrr-Gs,
ù     
 
ÿÿz#_TestConfFeatures.test_option_typescCsF|dkr dSt|tƒr| ¡}t|ƒtt|ƒƒkrBt|d|ƒ‚dS)Nr8z duplicated values in option '%s')rGrBÚsplitÚlenÚsetr,)rr5r6r7rrrr.`s 
z!_TestConfFeatures.test_duplicatescCs–| d¡dk    rdS| dd¡}|s&dSt|tƒr8| ¡}||krLt|dƒ‚|D]@}| |¡}|dk    r€d|krPt|d|ƒ‚qPt|d|ƒ‚qPdS)NÚdisabledr9Úzfeature implies itselfr>zimplies disabled feature '%s'zimplies non-exist feature '%s'©ÚgetrGrBrKr,)rr5r3r(r4r9ÚimplÚ    impl_dictrrrr/ks  
 
z_TestConfFeatures.test_impliescCsn| d¡dk    rdS| dd¡}|s&dSt|tƒr8| ¡}|D],}| |¡}|r<d|krXq<t|d|ƒ‚q<dS)NrNr;rOr>z8in option 'group', '%s' already exists as a feature namerP)rr5r3r(r4r;ÚfrSrrrr0s 
 
 ÿz_TestConfFeatures.test_groupcCsn| d¡dk    rdS| dd¡}|s&dSt|tƒr8| ¡}|D],}| |¡}|r<d|krXq<t|d|ƒ‚q<dS)NrNr=rOr>zOin option 'extra_checks', extra test case '%s' already exists as a feature namerP)rr5r3r(r4r=rTrSrrrr1s 
 
 ÿz#_TestConfFeatures.test_extra_checksN) r r!r"Ú__doc__r'r&r-r.r/r0r1rrrrr$!s r$c@s&eZdZd    dd„Zdd„Zdd„ZdS)
ÚTestConfFeaturesÚrunTestcCstj ||¡| ¡dSr)ÚunittestÚTestCaserÚ_setup)rÚ
methodNamerrrr¢szTestConfFeatures.__init__cCs
dt_dS)NT)r Z conf_nocacherrrrrZ¦szTestConfFeatures._setupcCs2t ¡D]$\}}|D]}||dft_tƒqqdS)NrO)Úarch_compilersr%r rr$)rrZ    compilersÚccrrrÚ test_features©s zTestConfFeatures.test_featuresN)rW)r r!r"rrZr^rrrrrV¡s
rV)rXÚosrrr Ú __package__Z is_standaloneÚappendÚabspathrHÚdirnameÚ__file__Z ccompiler_optrZnumpy.distutils.ccompiler_optÚdictr\r r$rYrVÚmainrrrrÚ<module>s*  ù