m %UIc@sdZdkZdkZdkZdkZdkZdkZdkZdkZei dde dei djoei dde dnei djoty dk Z Wnej onOXe ie i\ZZeeeedd Ze ie ieefnd klZd d d dddddfZddZeedeeeeeeeeedeeedZddddddgZddd d!gZeeed"Z eed#Z!d$Z"d%Z#d&Z$d'Z%d(d)d*Z&hd+d,<d-d.<d/d0<d1d2<d3d2<d4d5<d6d7<dd8<d9d:<d;d<<d=d><d?d@<dAdB<dCdD<dEdF2GB of disk space temporarily. network - It is okay to run tests that use external network resource, e.g. testing SSL support for sockets. bsddb - It is okay to run the bsddb testsuite, which takes a long time to complete. decimal - Test the decimal module against a large suite that verifies compliance with standards. compiler - Test the compiler package by compiling all the source in the standard library and test suite. This takes a long time. subprocess Run all tests for the subprocess module. To enable all resources except one, use '-uall,-'. For example, to run all the tests except for the bsddb tests, give the option '-uall,-bsddb'. Ntignoreshex/oct constantss.*test.test_grammar$istdarwinii(s test_supporttaudiotcursest largefiletnetworktbsddbtdecimaltcompilert subprocesstcCs&tGH|o |GHnti|dS(N(t__doc__tmsgtsystexittcode(RR ((t*/data/zmath/lib/python2.4/test/regrtest.pytusages itcoveragec3Cs titiyYtitiddddddddd d d d d ddddddg\}2}#Wn%tij o}t d|nX| d.jo g} nx|2D]\}+})|+dhjot dq|+dijo|d7}q|+djjo t}q|+dkjot}d}q|+dljo t}q|+dmjo t}q|+dnjo t}q|+dojo t}q|+dpjo |)}q|+dqjo t} q|+drjo t} q|+dsjo d.k}|it|)q|+dtjo t} q|+dujotii ti!|)} q|+dvjo d.} q|+dwjo|)i#d7}t%|d8jo|)G|GHt dd9nt%|ddjod:|dWqIt?j oqIXn|ojg}t8|} xG| D]?}(|(i#}|o&|diBdI o|iC|qiqiW| i>n|#otDtE|#}#n|otDtE|}ntF}tH}|oCx,|#D]$}||jo|i-|q q W|#|d*g}#n|p|#ptK|||}|o|d }n|otMiN|n| o7d.k} | iOdJtiPtiQgdt,dKt},n|t_| t_ tiSiT}xo|D]g}%|p|%GHtiiWn| o#|,iXdLdMtYdNtZnt[|%|||||}|djo|!i.|%nJ|djo|i.|%n,|i.|%|dOjo|'i.|%n| oI|i]|i^o1dPGt%|i^GdQGH|iC|i^|i^2qnxEtiSiTD]4}||jo!|iBdRoti`|q(q(WqW|!ia|ia|ia|!od| o\| o#| ot%|!djodSGntbt%|!dTGdUGH|odVGHdWGHqn|o&tbt%|dTGdXGHtc|n|o| otbt%|dTGdYGHtc|td}tif}$|ihofti||ijti|'}"|"o.tbt%|"dZGd[G|$d7GHtc|"q d\G|$d]GHq d^GHd_G|$d]GHn|o|oyd`GHxq|D]e}%da|%GHtiiWy(dt_t[|%|d|||}Wq tlj o HPq q Xq Wn|otK|||}&xtnt%|&D]z}.|d|&|.jo_|.t%|&djotip|n3t8|db} | iq|&|.ddc| i>Pq q Wtip|n| o,|,ir}/|/isddtdetdf| n| otitdgtiuntivt%|djd.S(ysXExecute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other default arguments (verbose, quiet, generate, exclude, single, randomize, findleaks, use_resources, trace and coverdir) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. ishvgqxsrf:lu:t:TD:NLR:wthelptverbosetquiettgeneratetexcludetsingletrandomtfromfilet findleakssuse=s threshold=ttraces coverdir=t nocoverdirtrunleakss huntrleaks=tverbose2is-hs--helpis-vs --verboses-ws --verbose2s-qs--quiets-gs --generates-xs --excludes-ss--singles-rs --randomizes-fs --fromfiles-ls --findleakss-Ls --runleakss-ts --thresholdNs-Ts --coverages-Ds --coverdirs-Ns --nocoverdirs-Rs --huntrleakst:is(-R takes three colon-separated argumentsiis reflog.txts-us--uset,tallt-sInvalid -u/--use option: s-g and -v don't go together!s-s and -f don't go together!s%No GC available, disabling findleaks.(s gettempdirt pynexttesttrt#t ignoredirstcounts0runtest(test, generate, verbose, quiet, testdir)tglobalstlocalsisWarning: test createdsuncollectable object(s).stest.tAllttestsOK.s0CAUTION: stdout isn't compared in verbose mode:s7a test that passes in verbose mode may fail without it.sfailed:sskipped:tskips unexpected onsThose skips are all expected ont.s6Ask someone to teach regrtest.py about which tests aresexpected to get skipped ons'Re-running failed tests in verbose modes"Re-running test %r in verbose modetws t show_missingtsummarytcoverdirsleaks %d(s-hs--help(s-vs --verbose(s-ws --verbose2(s-qs--quiet(s-gs --generate(s-xs --exclude(s-ss--single(s-rs --randomize(s-fs --fromfile(s-ls --findleaks(s-Ls --runleaks(s-ts --threshold(s-Ts --coverage(s-Ds --coverdir(s-Ns --nocoverdir(s-Rs --huntrleaks(s-us--use(wt test_supporttrecord_original_stdoutR tstdouttgetopttargvtoptstargsterrorR Rt use_resourcestNonetotaRtTrueRRRRRt randomizeRRRtgct set_thresholdtintRtostpathtjointgetcwdR2tsplitt huntrleakstlent_[1]txtlowertuR%tRESOURCE_NAMEStFalsetremovetappendtgoodtbadtskippedtresource_deniedst ImportErrort found_garbagettempfilet gettempdirtfilenametopentfptreadtstriptnexttteststclosetIOErrortlinetgutst startswithtextendtmaptremovepytSTDTESTStstdteststNOTTESTStnotteststargt findteststtestdirRtshuffletTracetprefixt exec_prefixttracertmodulestkeyst save_modulesR,tflushtrunctxR)tvarstruntesttoktcollecttgarbagetmoduletunloadtsortR(t printlistt_ExpectedSkipstetplatformtplattisvalidtsett getexpectedtsurprisetKeyboardInterrupttallteststrangetitunlinktwritetresultst write_resultstsystemtgetpidR(3RaRpRRRRRR@RRR;RR2RRIRRRURARQRnR`RxRRmRkReRTR[R}R RXR]RSRR9RR,RRVRdR>RZR=RuRKRR%RNRLR8((RtmainsF                                 0                             #               t test_grammart test_opcodesttest_operationst test_builtinttest_exceptionst test_typesR3t test_future1t test_future2t test_future3cCs|p t}nti|}g}xp|D]h}|d djoQ|dtidjo9|d }||jo||jo|i |qq0q0W|i ||S(s-Return a list of all applicable test modules.ittest_itpyN( Rpt findtestdirRDtlistdirtnamesRatnametextseptmodnameRkRmRRR(RpRkRmRRaRR((RRos )  c sVti||p t}ntii|d} tii| |}|o d} n t i} |ot|dd}nyVti}z<| o| t_|GHn|ido |}n d|}t|ttg}t||tdddj o n|odkti i"i#ti%i#dk'd}od}n d }g}|d |d }ti,d I|Id IJti,d|dd | IJxYt-|D]K}ti/}|ti,i1d||i2ti/|dqWti,Jt3t4t5||d  d joQti,|IdI||d  IdIJ||IdI||d  IdIJqnWd|t_XWnLti6j o2}|p|GdG|GHtii9ndSn4t:ti;fj o2}|p|GdG|GHtii9ndSnt<j o nti=j o+}dG|GdG|GHtii9d Snti>d \}} dG|GdGtA|dG| GHtii9|o$tBiCdtitii9nd Sn(X| pd Sn| iD}|ok||djo,tiiG|odG|GdGHqd Snt|d}|i1||iId SntiiG|o)t|d}|iJ}|iIn |d}||jp|od SndG|Gd GHtii9tL||tii9d SdS(!sKRun a single test. test -- the name of the test generate -- if true, generate output, instead of running the test and comparing it to a previously created output file verbose -- if true, print more messages quiet -- if true, don't print 'skipped' messages (probably redundant) testdir -- test directory toutputiR>stest.t test_mainNcsdk}dk}dk}dk}dkl}|i|i(i t i |i i|iiiiitiitii|idS(N(s _path_created(t _strptimeturlparsetwarningstdircachetdistutils.dir_utilt _path_createdtcleartfstfiltersRAR~tsretpurget _regex_cachet clear_cachetcopy_regtdispatch_tabletupdatetpsR tpath_importer_cachetpictreset(RRRRR(RRRRRA(Rtcleanups$         cs dS(N(t indirect_test((R(Rt run_the_test scstdS(N(treloadt the_module((R(RRsiit beginningt repetitionst 1234567890i R.tleakedt referencess skipped --iiR,s failed --s crashed --R tfiles s output files)is no longer needed; consider removing itR/R%sproduced unexpected output:(MR3RR,RpRRDRERFt outputdirt outputfileRR<tcfpt cStringIOtStringIORIR\trefrepR R5t save_stdoutRftabstestt __import__R)R*t the_packagetgetattrRRRRRRRtcopyRRRRARRtdeltastrepcounttstderrRRtgettotalrefcounttrcRRRtmaxRhtabstResourceDeniedR RRyRWt TestSkippedRt TestFailedtexc_infottypetvaluetstrt tracebackt print_exctgetvalueRRtexistsR]RbR^texpectedt reportdiff( R,RRRRpRIRRRRRARRRRRRRRRRRR]RRRR RRRRR((RRRARRRRRR|s                 %(1             cCsdk}ddGH|id}|id}|id|d|} | i}d}xQ|D]I\} }}} } | djoqd| djo:d G|||Gd GHx|||!D]} d G| GqWqd| d jo^d G|||GdGdG|| | GdGHx|i|||!|| | !D] } | Gq*Wqd| djoLd G|| | GdGdGt|dGHx9|| | !D]} dG| GqWqddG| ||| | fGHqdWddGHdS(Nt*iFiR>tbcCs;|d7}||jodt|Snd||fSdS(Nisline s lines %d-%d(tx0tx1R(RR((Rtpairfs  tequaltdeletes***sof expected output missing:R#treplaces*** mismatch betweens of expecteds output andsof actual output:tinsertsof actual output doesn't appearsin expected output after lineR t+s$get_opcodes() returned bad tuple?!?!(tdifflibRt splitlinesR>RRtSequenceMatchertsmt get_opcodesttuplesRtopta0ta1tb0tb1RdtndiffR(RRR>RRRRRRRRRRdR((RR^s8       +!  (cCsDtdjotid}nt}tii|pti}|S(Nt__main__i( t__name__R R7Rt__file__RDREtdirnametcurdirRp(RRp((RRs  cCs)|itido|d }n|S(NRi(RtendswithRDR(R((RRiscCs1|djod||fSnd||fSdS(Nis%d %ss%d %ss(tntword(RR((RR(s iFicCsGdkl}d|}|ditt||d|d|GHdS(sPrint the elements of iterable x to stdout. Optional arg width (default 70) is the maximum line length. Optional arg indent (default 4) is the number of blanks with which to begin each line. (sfillt tinitial_indenttsubsequent_indentN( ttextwraptfilltindenttblanksRFRhRRLtwidth(RLRR R R ((RRs   twin32s test__locale test_applesingle test_al test_bsddb185 test_bsddb3 test_cd test_cl test_commands test_crypt test_curses test_dbm test_dl test_fcntl test_fork1 test_gdbm test_gl test_grp test_imgfile test_ioctl test_largefile test_linuxaudiodev test_mhlib test_nis test_openpty test_ossaudiodev test_poll test_posix test_pty test_pwd test_resource test_signal test_sunaudiodev test_threadsignals test_timing tlinux2s: test_al test_applesingle test_bsddb185 test_cd test_cl test_curses test_dl test_gl test_imgfile test_largefile test_linuxaudiodev test_nis test_ntpath test_ossaudiodev test_sunaudiodev tmacs test_al test_atexit test_bsddb test_bsddb185 test_bsddb3 test_bz2 test_cd test_cl test_commands test_crypt test_curses test_dbm test_dl test_fcntl test_fork1 test_gl test_grp test_ioctl test_imgfile test_largefile test_linuxaudiodev test_locale test_mmap test_nis test_ntpath test_openpty test_ossaudiodev test_poll test_popen test_popen2 test_posix test_pty test_pwd test_resource test_signal test_sunaudiodev test_sundry test_tarfile test_timing t unixware7s test_al test_applesingle test_bsddb test_bsddb185 test_cd test_cl test_dl test_gl test_imgfile test_largefile test_linuxaudiodev test_minidom test_nis test_ntpath test_openpty test_pyexpat test_sax test_sunaudiodev test_sundry t openunix8tsco_sv3sO test_al test_applesingle test_asynchat test_bsddb test_bsddb185 test_cd test_cl test_dl test_fork1 test_gettext test_gl test_imgfile test_largefile test_linuxaudiodev test_locale test_minidom test_nis test_ntpath test_openpty test_pyexpat test_queue test_sax test_sunaudiodev test_sundry test_thread test_threaded_import test_threadedtempfile test_threading triscoss test_al test_applesingle test_asynchat test_atexit test_bsddb test_bsddb185 test_bsddb3 test_cd test_cl test_commands test_crypt test_dbm test_dl test_fcntl test_fork1 test_gdbm test_gl test_grp test_imgfile test_largefile test_linuxaudiodev test_locale test_mmap test_nis test_ntpath test_openpty test_poll test_popen2 test_pty test_pwd test_strop test_sunaudiodev test_sundry test_thread test_threaded_import test_threadedtempfile test_threading test_timing s test__locale test_al test_bsddb test_bsddb3 test_cd test_cl test_curses test_dl test_gdbm test_gl test_imgfile test_largefile test_linuxaudiodev test_locale test_minidom test_nis test_ntpath test_ossaudiodev test_poll test_sunaudiodev tsunos5s@ test_al test_applesingle test_bsddb test_bsddb185 test_cd test_cl test_curses test_dbm test_gdbm test_gl test_gzip test_imgfile test_linuxaudiodev test_openpty test_zipfile test_zlib shp-ux11s test_al test_applesingle test_bsddb test_bsddb185 test_cd test_cl test_curses test_dl test_gdbm test_gl test_gzip test_imgfile test_largefile test_linuxaudiodev test_locale test_minidom test_nis test_ntpath test_openpty test_pyexpat test_sax test_sunaudiodev test_zipfile test_zlib tatheoss test_al test_applesingle test_bsddb185 test_cd test_cl test_curses test_dl test_gdbm test_gl test_imgfile test_largefile test_linuxaudiodev test_locale test_mhlib test_mmap test_nis test_poll test_popen2 test_resource test_sunaudiodev tcygwins| test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_dbm test_gl test_imgfile test_ioctl test_largefile test_linuxaudiodev test_locale test_nis test_ossaudiodev test_socketserver test_sunaudiodev tos2emxs test_al test_applesingle test_audioop test_bsddb185 test_bsddb3 test_cd test_cl test_commands test_curses test_dl test_gl test_imgfile test_largefile test_linuxaudiodev test_mhlib test_mmap test_nis test_openpty test_ossaudiodev test_pty test_resource test_signal test_sunaudiodev tfreebsd4s test_aepack test_al test_applesingle test_bsddb test_bsddb3 test_cd test_cl test_gdbm test_gl test_imgfile test_linuxaudiodev test_locale test_macfs test_macostools test_nis test_normalization test_ossaudiodev test_pep277 test_plistlib test_pty test_scriptpackages test_socket_ssl test_socketserver test_sunaudiodev test_tcl test_timeout test_unicode_file test_urllibnet test_winreg test_winsound taix5s test_aepack test_al test_applesingle test_bsddb test_bsddb185 test_bsddb3 test_bz2 test_cd test_cl test_dl test_gdbm test_gl test_gzip test_imgfile test_linuxaudiodev test_macfs test_macostools test_nis test_ossaudiodev test_sunaudiodev test_tcl test_winreg test_winsound test_zipimport test_zlib tfreebsd5tfreebsd6RcBs#tZdZdZdZRS(NcCs)dk} dkl}dkl}dkl}dkl}l} dkl}l }dkl } t |_ titjotti} t| i|_| iip|iidn|io|iidn|io|iid n|io|iid nx:dD]2} td| io|iid| q q Wtidjo$|iid|iidntid jo:dddddg}x"|D]}|ii|qWntidjo4dddg}x"|D]}|ii|qWnt|_ ndS(!N(stest_normalization(stest_socket_ssl(s test_timeout(stest_codecmaps_cnstest_codecmaps_jp(stest_codecmaps_krstest_codecmaps_tw(stest_codecmaps_hkt test_pep277ttest_normalizationttest_socket_sslt test_timeouttcntjptkrttwthkttest_codecmaps_lt test_rgbimgt test_imageopRRttest_macostoolst test_macfst test_aepackt test_plistlibttest_scriptpackagesRttest_unicode_filet test_winregt test_winsound(R"R#R$R%R&(smacsdarwin( tos.pathRDR,RR R!ttest_codecmaps_cnttest_codecmaps_jpttest_codecmaps_krttest_codecmaps_twttest_codecmaps_hkRPtselftvalidR Rt _expectationstsRRHRREtsupports_unicode_filenamestaddt skip_expectedtcctevaltmaxinttMAC_ONLYR-tWIN_ONLYR?(R8R6R R-R3RBRCRR!R;R?R7RDR4R5((Rt__init__asJ           cCs|iS(s@Return true iff _ExpectedSkips knows about the current platform.N(R8R9(R8((RRscCs|ipt|iS(snReturn set of test names we expect to skip on current platform. self.isvalid() must be true. N(R8RtAssertionErrorR(R8((RRs(Rt __module__RDRR(((RR`s 0 Ris*Could not find %r in sys.path to remove it(3R RDR R6RRRRRtfilterwarningst FutureWarningRARtresourceRWt getrlimitt RLIMIT_STACKtsoftthardtminRtnewsoftt setrlimitR,R3RORR<RPRRjRlRoR|RRRiR(RR:RRREtabspathtnormpathRR7tmydirRJRtpathlen(R3RR:RR|RORlRiRjRSRRR6RRRMRR RTR(RIRRRDRRRRoRORL((Rt?fsf            9   *   #> 1  ,