+
    -i3                        ^ RI t ^ RIt^ RIt^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RI
HtHtHt  ! R R]
P                  4      t]]
n        R t ! R R]4      t ! R	 R
] P(                  4      t ! R R]P,                  4      t ! R R]P0                  4      tR t ! R R]P,                  4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]P0                  4      t  ^ RI!t! ]!PD                  ! 4        R#   ]# d0   t$Rt%]PL                  ! ]%PO                  ]$R7      4        Rt$A$R# Rt$A$ii ; i  ]( d     R# i ; i)    N)StringIO)resultrunnersignalsc                   r   a a ] tR t^t oRtRtRtRtV 3R ltV 3R lt	V 3R lt
V 3R ltV 3R ltRtVtV ;t# )	NumbaTestProgramz
A TestProgram subclass adding the following options:
* a -R option to enable reference leak detection
* a --profile option to enable profiling of the test run

Currently the options are only added in 3.4+.
Fc                   < VP                  R R4      V n        \        P                  P	                  R4       \
        \        V `  ! V/ VB  R# )suiteNz:x)popdiscovered_suitesyswarnoptionsappendsuperr   __init__)selfargskwargs	__class__s   &*,V/var/www/html/photoedit/myenv/lib/python3.14/site-packages/llvmlite/tests/customize.pyr   NumbaTestProgram.__init__!   s?     &

7D 9 	t$.??    c                n   < V P                   e   V P                   V n        R # \        \        V `  4        R # N)r   testr   r   createTests)r   r   s   &r   r   NumbaTestProgram.createTests(   s*      ,--DI"D57r   c                   < \         \        V `  4       pV P                  f   VP	                  RRRRRR7       VP	                  RRR	RR
R7       VP	                  RRRRR7       V# )N-Rz	--refleakrefleak
store_truezDetect reference / memory leaks)destactionhelp-mz--multiprocessmultiprocesszParallelize testsz	--profileprofilezProfile the test run)r   r   _getParentArgParser
testRunneradd_argument)r   parserr   s   & r   r(   $NumbaTestProgram._getParentArgParser.   s     'BD??"k	'3%F   H 	D"2#/!4 	 	6 	Ki#/!7 	 	9 r   c                  < \         P                  R8  d?   RV9   d   VP                  R4       RV n        RV9   d   VP                  R4       RV n        \
        \        V `  V4       V P                  ^ 8:  d
   RV n	        R# R# )   r   Tr%   N)r.      )
r   version_inforemover    r&   r   r   	parseArgs	verbositybuffer)r   argvr   s   &&r   r2   NumbaTestProgram.parseArgs?   sp    f$t|D!#t|D!$(!/5>>Q DK r   c                  <a  S P                   '       d9   \        S n        \        \        R 4      '       g   \
        P                  ! R4       M#S P                  f   \        P                  S n        S P                  '       d=   \        S P                  S P                  S P                  S P                  R7      S n        VV 3R lpS P                  '       d   \        P                   P#                  \        P                   P%                  \        P&                  R,          P(                  4      4      ^ ,          R,           p\*        P,                  ! \.        P0                  R7      pVP3                  4         VP5                  V4       VP7                  4        \9        RV: 24       VP;                  V4       R# V! 4        R#   TP7                  4        \9        RT: 24       TP;                  T4       i ; i)	gettotalrefcountz^detecting reference leaks requires a debug build of Python, only memory leaks will be detectedN)r3   failfastr4   c                  ,   < \         \        S`  4        R # r   )r   r   runTests)r   r   s   r   run_tests_real1NumbaTestProgram.runTests.<locals>.run_tests_real`   s    "D24r   __main__z.prof)timerzWriting test profile data into )r    RefleakTestRunnerr)   hasattrr   warningswarnunittestTextTestRunnerr&   ParallelTestRunnerr3   r9   r4   r'   ospathsplitextbasenamemodules__file__cProfileProfiletimeperf_counterenableruncalldisableprint
dump_stats)r   r<   filenamepr   s   f   r   r;   NumbaTestProgram.runTestsN   sQ   <<</DO3 233 ) * __$&55DO0;?>>:>--8<EDO
	5 <<<ww''  Z!8!A!ABH   t'8'89AHHJ'		.)		XGHX&	 		XGHX&s   6G 2G4)r4   r   r&   r    r   r)   )__name__
__module____qualname____firstlineno____doc__r    r'   r&   r   r   r(   r2   r;   __static_attributes____classdictcell____classcell__r   __classdict__s   @@r   r   r      s:      GGL@8"" "r   r   c                      \         P                  p  \         P                  p\         P                  \         P
                  \         P                  \         P                  3 F  pVf   K	  VP                  4        K  	  \         P                  ! 4        \        P                  ! 4        V ! 4       V! 4       3#   \         d    R  p  Li ; i  \         d    R p Li ; i)c                      ^*# *    rg   r   r   func1_refleak_cleanup.<locals>.func1       r   c                      ^*# re   rg   rg   r   r   func2_refleak_cleanup.<locals>.func2   rj   r   )r   getallocatedblocksAttributeErrorr8   stdoutstderr
__stdout__
__stderr__flush_clear_type_cachegccollect)rh   rl   streams      r   _refleak_cleanupry   {   s    &&$$ ::szz3>>3>>JLLN K JJL7EG%  	
  	s"   B6 C
 6CC
CCc                       ] tR t^tRtR# )ReferenceLeakErrorrg   N)rY   rZ   r[   r\   r^   rg   r   r   r{   r{      s    r   r{   c                   &   a  ] tR t^t o R tRtV tR# )IntPoolc                    V# r   rg   )r   keys   &&r   __missing__IntPool.__missing__   s    
r   rg   N)rY   rZ   r[   r\   r   r^   r_   rb   s   @r   r}   r}      s      r   r}   c                   @   a a ] tR t^t o^t^tR tV 3R ltRtVt	V ;t
# )RefleakTestResultc                   V P                   P                  4        V P                  pV P                  p^ .W#,
          ,          p^ .W#,
          ,          p\	        4       p\        R^4       F  pWg,           K  	  ^ ;r\        V4       F  p\        P                  ! 4       p
VP                  V
4       V
P                  4       '       gQ   V P                  P                  V
P                  4       V P                  P                  V
P                  4       \        h?
\        4       w  rWs8  d1   WlV	,
          ,          WGV,
          &   WkV,
          ,          WWV,
          &   YrK  	  WE3# )r   i8)rx   rt   repetitionswarmupr}   ranger   
TestResultrunwasSuccessfulfailuresextenderrorsAssertionErrorry   )r   r   repcountnwarmup	rc_deltasalloc_deltas	_int_poolialloc_before	rc_beforeresalloc_afterrc_afters   &&           r   
_huntLeaksRefleakTestResult._huntLeaks   s5   ##++C8-.	sh01 I	tS!ALL " $%$xA##%CHHSM $$&&$$S\\2""3::.$$$4$6!K|)2i3G)H	g+&(12>3? )@ $% & '2)# !$ &&r   c           
     >  <  V P                  V4      w  r#R pR pRpTRT3TRT33 F<  w  rxp	T	! T4      '       g   K  T: RT: RT: R\        T4      : 2p
R	p \	        T
4      h	  T'       g   \        \        T `;  T4       R # R #   \         d    T P                  4       '       d   Q h R # i ; i  \
         d    \        P                  ! 4       p Mi ; iT P                  '       d$   T P                  P                  T: R
T: R24       T P                  Y4       K  )Nc                     \        V 4      # r   )anydeltass   &r   check_rc_deltas5RefleakTestResult.addSuccess.<locals>.check_rc_deltas   s    v;r   c                     ^V P                  ^ 4      ,          \        V 4      8  d   R# \        V 4      \        R4      8:  g   R# R# )r.   TF)   r   )countlensetr   s   &r   check_alloc_deltas8RefleakTestResult.addSuccess.<locals>.check_alloc_deltas   s4    6<<?"S[0v;#j/1r   F
referenceszmemory blocksz leaked  z, sum=Tz = )r   r   r   sumr{   	Exceptionr   exc_infoshowAllrx   write
addFailurer   r   
addSuccess)r   r   r   r   r   r   failedr   	item_namecheckermsgr   r   s   &&          r   r   RefleakTestResult.addSuccess   s   	&*ood&;#I		  o60BC+E&Fw v&)S[:.,S11+E #T5d; G  	))++++	: ! ."||~H.<<<KK%%Iv&FG/s)   B B1 B.(B.-B.1 CCrg   )rY   rZ   r[   r\   r   r   r   r   r^   r_   r`   ra   s   @@r   r   r      s     FK 'D'< '<r   r   c                       ] tR t^t]tRtR# )r@   rg   N)rY   rZ   r[   r\   r   resultclassr^   rg   r   r   r@   r@      s    #Kr   r@   c                    \        V \        P                  4      '       d(   . pV  F  pVP                  \	        V4      4       K  	  V# V .# )z$Expand suite into list of tests
    )
isinstancerD   	TestSuiter   _flatten_suite)r   testsxs   &  r   r   r      sC     $**++ALL*+ vr   c                   *   a  ] tR t^t o RtR tRtV tR# )ParallelTestResultz9
A TestResult able to inject results from other results.
c                X   V P                   P                  VP                   P                  4       4       V P                   P                  4        V ;P                  VP                  ,          un        V P
                  P                  VP
                  4       V P                  P                  VP                  4       V P                  P                  VP                  4       V P                  P                  VP                  4       V P                  P                  VP                  4       R# )z9
Add the results from the other *result* to this result.
N)rx   r   getvaluert   testsRunr   r   r   skippedexpectedFailuresunexpectedSuccesses)r   r   s   &&r   add_resultsParallelTestResult.add_results  s     	&--0023(V__-6==)FNN+$$V%<%<=  ''(B(BCr   rg   N)rY   rZ   r[   r\   r]   r   r^   r_   r   s   @r   r   r      s     D Dr   r   c                   4   a  ] tR tRt o RtRtR tR tRtV t	R# )_MinimalResulti  z/
A minimal, picklable TestResult-alike object.
c                    RVn         R# )zB
Remove any unpicklable attributes from TestCase instance *case*.
N)_outcomeForDoCleanups)r   cases   &&r   
fixup_case_MinimalResult.fixup_case  s    
 &*"r   c           	     :   V P                    F  p\        W\        W4      4       K  	  V P                   F  w  r4V P	                  V4       K  	  V P
                   F  w  r4V P	                  V4       K  	  V P                   F  w  r4V P	                  V4       K  	  R # r   )	__slots__setattrgetattrr   r   r   r   )r   original_resultattrr   _s   &&   r   r   _MinimalResult.__init__"  su    NNDD >? #,,GDOOD! -{{GDOOD! #}}GDOOD! %r   rg   N)r   r   r   r   r   rx   
shouldStopr   )
rY   rZ   r[   r\   r]   r   r   r   r^   r_   r   s   @r   r   r     s!     CI*" "r   r   c                   0   a  ] tR tRt o RtR tR tRtV tR# )_FakeStringIOi-  z2
A trivial picklable StringIO-alike for Python 2.
c                    Wn         R # r   _value)r   values   &&r   r   _FakeStringIO.__init__2  s    r   c                    V P                   # r   r   )r   s   &r   r   _FakeStringIO.getvalue5  s    {{r   r   N)	rY   rZ   r[   r\   r]   r   r   r^   r_   r   s   @r   r   r   -  s      r   r   c                   T   a  ] tR tRt o RtR tR t]P                  R 4       t	Rt
V tR# )_MinimalRunneri9  zi
A minimal picklable object able to instantiate a runner in a
child process and run a test case with it.
c                    Wn         W n        R # r   )
runner_clsrunner_args)r   r   r   s   &&&r   r   _MinimalRunner.__init__?  s    $&r   c                   V P                   p\        4       VR &   V P                  ! R/ VB pVP                  ! 4       p\        P
                  ! 4        \        P                  ! V4       VP                  Vn        VP                  Vn        V P                  V4      ;_uu_ 4        V! V4       RRR4       \        VP                  P                  4       4      Vn        \        V4      #   + '       g   i     LC; i)rx   Nrg   )r   r   r   _makeResultr   installHandlerregisterResultr9   r4   cleanup_objectr   rx   r   r   )r   r   r   r   r   s   &&   r   __call___MinimalRunner.__call__F  s    !! $:x*6*##% v& //  &&L ' &fmm&<&<&>?f%%	 '&s   #	C''C7	c              #    "   \        VP                  4      p Vx  \        VP                  4      V,
          pV F  pVP                  V K  	  R#   \        TP                  4      T,
          pT F  pTP                  T K  	  i ; i5i)z]
A context manager which cleans up unwanted attributes on a test case
(or any other object).
N)r   __dict__)r   r   vanilla_attrsspurious_attrsnames   &&   r   r   _MinimalRunner.cleanup_objectY  st      DMM*	(J /-?N&MM$' ' !/-?N&MM$' 's   BA 4B4BB)r   r   N)rY   rZ   r[   r\   r]   r   r   
contextlibcontextmanagerr   r^   r_   r   s   @r   r   r   9  s.     
'&& ( (r   r   c                   F   a a ] tR tRt oRt]tR tR tV 3R lt	Rt
VtV ;t# )rF   ih  zP
A test runner which delegates the actual running to a pool of child
processes.
c                `    \         P                  P                  ! V 3/ VB  Wn        W n        R # r   )r   rE   r   r   r   )r   r   r   s   &&,r   r   ParallelTestRunner.__init__p  s&    &&t6v6$!r   c                   \        V P                  V P                  4      p\        P                  ! 4       pVP
                  p V! W P                  4       F)  pVP                  ! V4       VP                  '       g   K)   M	  VVP                  4        VP                  4        #   TP                  4        TP                  4        i ; ir   )r   r   r   multiprocessingPoolimap_unordered
_test_listr   r   	terminatejoin)r   r   child_runnerpoolimapchild_results   &&    r   
_run_innerParallelTestRunner._run_inneru  s     &doot7G7GH##%""		 $\?? C""<0*** !D  NNIIK NNIIKs   6B$ >B$ $"Cc                ^   < \        V4      V n        \        \        V `  V P
                  4      # r   )r   r  r   rF   r   r  )r   r   r   s   &&r   r   ParallelTestRunner.run  s(    (. '24??CCr   )r  r   r   )rY   rZ   r[   r\   r]   r   r   r   r  r   r^   r_   r`   ra   s   @@r   rF   rF   h  s'     
 %K"
"D Dr   rF   z+Failed to enable faulthandler due to:
{err})err))collectionsr   rM   ior   rv   rG   r   r   rO   rD   rB   r   r   r   mainr   ry   RuntimeErrorr{   defaultdictr}   TextTestResultr   rE   r@   r   r   objectr   r   r   rF   faulthandlerrQ   BaseExceptioner   rC   formatImportErrorrg   r   r   <module>r     sB       	 	  
    , ,\x}} \B !2	 	k%% N<-- N<b$-- $	D.. D&"V "6	F 	,(V ,(^"D.. "DJ
)) )<cjjQj'(()  		s*   1E 6D	 	D?$D::D?EE