mς %U²Ic@sΆdkZdkZdkZdkZdkZdklZdklZlZl Z d„Z dei i fd„ƒYZ deifd„ƒYZd„Zed jo eƒndS( N(s test_support(sENTERsEXITsLINEcCs3|o$tiitii|ƒƒdSn|SdS(Ni(tfntostpathtsplitexttbasename(R((t./data/zmath/lib/python2.4/test/test_hotshot.pyt shortfilename s$tUnlinkingLogReadercBs#tZdZd„Zed„ZRS(sMExtend the LogReader so the log file is unlinked when we're done with it.cCs#||_tiii||ƒdS(N(tlogfntselft_UnlinkingLogReader__logfnthotshottlogt LogReadert__init__(R R((RRs cCsNytiii|ƒSWn0tj o$|iƒti|i ƒ‚nXdS(N( R R R tnextR t StopIterationtcloseRtunlinkR (R tindex((RRs  (t__name__t __module__t__doc__RtNoneR(((RRs  tHotShotTestCasecBsbtZddd„Zd„Zd„Zd„Zdd„Zd„Zd „Z d „Z d „Z RS( NiicCs"ti|_ti|i||ƒS(N(t test_supporttTESTFNR RR tProfilet lineeventst linetimings(R RR((Rt new_profiler(s cCs t|iƒS(N(RR R(R ((Rt get_logreader,scCs[g}xN|iƒD]@}|\}\}}}}|i |t |ƒ||ffƒqW|S(N( tLR RteventtwhattfilenametlinenotfuncnamettdeltatappendR(R R"R R#R$R&R%R!((Rtget_events_wotime/s  &cCsJ|iƒ}||jo-|idti|ƒti|ƒfƒndS(Ns6events did not match expectation; got: %s expected: %s(R R(teventstexpectedtfailtpprinttpformat(R R*R)((Rt check_events6s  cCs€|djo|iƒ}n|i|ii ƒ|i|ƒ|i|ii ƒ|i ƒ|i|iiƒ|i |ƒdS(N( tprofilerRR Rt failUnlesst_proftclosedtruncalltcallableRR.R)(R R4R)R/((Rtrun_test=s   cCsld„}|iƒ}|i||ƒ|iƒ|iƒ}|i}t |ƒ|i |ddgjƒdS(NcCs|iddƒdS(Nstest-keys test-value(tptaddinfo(R6((RtfHsstest-keys test-value( R8R RR/R3RRR t_infotinfotlistR0(R R:R R8R/((Rt test_addinfoGs      c sΰd„‰‡d†}ˆii}|ii}td|dfftd|ddfftd|dfftd|ddfftd|ddfftd|dfftd|dffg}|i |||i ddƒƒdS( NcCsd}d}dS(Nii(tytx(R=R>((RR8Sscs ˆƒdS(N(R8((R8(RtgVst test_hotshotR?iR8iR( R8R?t func_codetco_firstlinenotf_linenotg_linenotENTERtLINEtEXITR)R R5R(R R?R8RDRCR)((R8Rttest_line_numbersRs     cCs>|iƒ}|iƒ|iƒ|iƒti|iƒdS(N( R RR/tstarttstopRRRR(R R/((Rttest_start_stopds     cCs‘dk}dk}|i}tii}z?d|_|it |t i ƒ|`|it |t i ƒWd||_|ii t i ƒo|i t i ƒnXdS(Ntabc(tsysRRt orig_pathR t_hotshottcoverageR t assertRaisest RuntimeErrorRRtexiststremove(R RPRMRRN((Rttest_bad_sys_pathns      ( RRRRR(R.RR5R<RHRKRU(((RR's     cCstitƒdS(N(Rt run_unittestR(((Rt test_mainst__main__(R t hotshot.logRR,tunittestttestRRERGRFRR R RtTestCaseRRWR( RRRRZR,RRGRWR RERFR((Rt?s       X