;
Ëâ"Ic            &   @   sk  d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l	 Z	 d d l
 m Z e	 j d d e d ƒ e j d k o e	 j d d e d ƒ n xO d	 d
 d d d d d d d d f
 D]) Z e	 j d d e f d d d e ƒ qç We j d k ox y d d l Z Wn e k
 o YnO Xe j e j ƒ \ Z Z e e e e d d ƒ ƒ Z e j e j e e f ƒ n d d l m Z d d d d d d  d! d" d# f	 Z d$ „  Z e  e  d e! e! e! e! e! e  e! e  e! d% e! e! e! e! d& „ Z" d' d( d) d* d+ d, d- d. d/ g	 Z# d0 d1 h Z$ e  e# e$ d2 „ Z% e  e! e! d3 „ Z& e  e! e! d4 „ Z' d5 „  Z( d6 „  Z) d7 „  Z* d8 „  Z+ d9 „  Z, d: „  Z- d; „  Z. d< „  Z/ d= d> d? „ Z0 i d@ dA 6dB dC 6dD dE 6dF dG 6dF dH 6dI dJ 6dK d 6dL dM 6dN dO 6dP dQ 6dR dS 6dT dU 6dV dW 6dX dY 6dZ d[ 6d\ d] 6Z1 e1 dW e1 d^ <e1 dW e1 d_ <e1 dW e1 d` <e1 dW e1 da <Gdb „  dc ƒ Z2 e3 dd k oÐ e j4 j5 e j4 j6 e j4 j7 e j8 d ƒ ƒ ƒ Z9 e: e j4 ƒ Z; Z< xV e; d k oH e; de 8Z; e j4 j5 e j4 j6 e j4 e; ƒ ƒ e9 k o e j4 e; =n qÞWe: e j4 ƒ e< k o e= df e9 ƒ n e" ƒ  n d S(g   uw  Regression test.

This will find all modules whose name is "test_*" in the test
directory, and run them.  Various command line options provide
additional facilities.

Command line options:

-v: verbose    -- run tests in verbose mode with output to stdout
-w: verbose2   -- re-run failed tests in verbose mode
-d: debug      -- print traceback for failed tests
-q: quiet      -- don't print anything except if a test fails
-x: exclude    -- arguments are tests to *exclude*
-s: single     -- run only a single test (see below)
-S: slow       -- print the slowest 10 tests
-r: random     -- randomize test execution order
-f: fromfile   -- read names of tests to run from a file (see below)
-l: findleaks  -- if GC is available detect tests that leak memory
-u: use        -- specify which special resource intensive tests to run
-h: help       -- print this text and exit
-t: threshold  -- call gc.set_threshold(N)
-T: coverage   -- turn on code coverage using the trace module
-D: coverdir   -- Directory where coverage files are put
-N: nocoverdir -- Put coverage files alongside modules
-L: runleaks   -- run the leaks(1) command just before exit
-R: huntrleaks -- search for reference leaks (needs debug build, v. slow)
-M: memlimit   -- run very large memory-consuming tests
-n: nowindows  -- suppress error message boxes on Windows

If non-option arguments are present, they are names for tests to run,
unless -x is given, in which case they are names for tests not to run.
If no test names are given, all tests are run.

-v is incompatible with -g and does not compare test output files.

-T turns on code coverage tracing with the trace module.

-D specifies the directory where coverage files are put.

-N Put coverage files alongside modules.

-s means to run only a single test and exit.  This is useful when
doing memory analysis on the Python interpreter (which tend to consume
too many resources to run the full regression test non-stop).  The
file /tmp/pynexttest is read to find the next test to run.  If this
file is missing, the first test_*.py file in testdir or on the command
line is used.  (actually tempfile.gettempdir() is used instead of
/tmp).

-S is used to continue running tests after an aborted run.  It will
maintain the order a standard run (ie, this assumes -r is not used).
This is useful after the tests have prematurely stopped for some external
reason and you want to start running from where you left off rather
than starting from the beginning.

-f reads the names of tests from the file given as f's argument, one
or more test names per line.  Whitespace is ignored.  Blank lines and
lines beginning with '#' are ignored.  This is especially useful for
whittling down failures involving interactions among tests.

-L causes the leaks(1) command to be run just before exit if it exists.
leaks(1) is available on Mac OS X and presumably on some other
FreeBSD-derived systems.

-R runs each test several times and examines sys.gettotalrefcount() to
see if the test appears to be leaking references.  The argument should
be of the form stab:run:fname where 'stab' is the number of times the
test is run to let gettotalrefcount settle down, 'run' is the number
of times further it is run and 'fname' is the name of the file the
reports are written to.  These parameters all have defaults (5, 4 and
"reflog.txt" respectively), and the minimal invocation is '-R :'.

-M runs tests that require an exorbitant amount of memory. These tests
typically try to ascertain containers keep working when containing more than
2 billion objects, which only works on 64-bit systems. There are also some
tests that try to exhaust the address space of the process, which only makes
sense on 32-bit systems with at least 2Gb of memory. The passed-in memlimit,
which is a string in the form of '2.5Gb', determines howmuch memory the
tests will limit themselves to (but they may go slightly over.) The number
shouldn't be more memory than the machine has (including swap memory). You
should also keep in mind that swap memory is generally much, much slower
than RAM, and setting memlimit to all available RAM or higher will heavily
tax the machine. On the other hand, it is no use running these tests with a
limit of less than 2.5Gb, and many require more than 20Gb. Tests that expect
to use more than memlimit memory will be skipped. The big-memory tests
generally run very, very long.

-u is used to specify which special resource intensive tests to run,
such as those requiring large file support or network connectivity.
The argument is a comma-separated list of words indicating the
resources to test.  Currently only the following are defined:

    all -       Enable all special resources.

    audio -     Tests that use the audio device.  (There are known
                cases of broken audio drivers that can crash Python or
                even the Linux kernel.)

    curses -    Tests that use curses and will modify the terminal's
                state and output modes.

    lib2to3 -   Run the tests for 2to3 (They take a while.)

    largefile - It is okay to run some test that may create huge
                files.  These tests can take a long time and may
                consume >2GB 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 -  Allow test_tokenize to verify round-trip lexing on
                every file in the test library.

    subprocess  Run all tests for the subprocess module.

    urlfetch -  It is okay to download files required on testing.

To enable all resources except one, use '-uall,-<resource>'.  For
example, to run all the tests except for the bsddb tests, give the
option '-uall,-bsddb'.
i    N(   u
   isabstractu   ignoreu   hex/oct constantsu   .*test.test_grammar$iÿÿÿu   <string>u   ctypesu   gzipu   zipfileu   tarfileu   encodings.zlib_codecu   test.test_zipimportu   test.test_zlibu   test.test_zipfileu   test.test_codecsu   test.string_testsu   moduleu   .*%s$u   actionu   categoryu   darwini   i   (   u   supportu   audiou   cursesu	   largefileu   networku   bsddbu   decimalu   compileru
   subprocessu   urlfetchc             C   s7   t  |  d t j ƒt  d d t j ƒt j d ƒ d  S(   Nu   fileu   Use --help for usagei   (   u   printu   sysu   stderru   exit(   u   msg(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   usage¶   s    u   coveragec       8   8   C   s)  t  j t j ƒ yk t j t j d d … d d d d d d d	 d
 d d d d d d d d d d d d d d g ƒ \ } } Wn4 t j k
 o% } z t | ƒ WYd d } ~ Xn X|
 d k o
 g  }
 n d{ } d } x~| D]v\ } } | d| k o t
 t ƒ d S| d} k o | d 7} qÜ | d~ k o
 d } qÜ | d€ k o
 d } qÜ | d k o d } d# } qÜ | d‚ k o
 d } qÜ | dƒ k o
 | } qÜ | d„ k o
 d } qÜ | d… k o
 d } qÜ | d† k o
 d } qÜ | d‡ k o
 | } qÜ | dˆ k o
 d }	 qÜ | d‰ k o
 d } qÜ | dŠ k o# d# d l } | j t | ƒ ƒ qÜ | d‹ k o
 d } qÜ | dŒ k o t j j t j ƒ  | ƒ } qÜ | d k o
 d } qÜ | dŽ k oØ | j d= ƒ } t | ƒ d k o t
 | | ƒ t d@ ƒ n | d# p dA | d# <n t | d# ƒ | d# <| d p dB | d <n t | d ƒ | d <t | ƒ d> k p | d> o dC g | d> d … <n t ƒ  qÜ | d k o t  j | ƒ qÜ | d‘ k oé dH „  | j dI ƒ Dƒ } xz| D]Á } | dJ k o t |
 d d … <qÜn d{ } | d# dK k o d } | d d … } n | t k o t dL | ƒ n | o" | |
 k o |
 j | ƒ qqÜ| |
 k o |
 j | ƒ qÜqÜWqÜ | d’ k o  d# d l } | j | j | j B| j B| j  Bƒ y | j! Wn t" k
 o YqRXxJ | j# | j$ | j% g D], } | j! | | j& ƒ | j' | | j( ƒ qWqÜ qÜ W| o | o t dO ƒ n | o | o t dP ƒ n g  } g  } g  }  g  }! |	 oA y d# d l } Wn$ t) k
 o t
 dQ ƒ d{ }	 YqîXg  }" n | o{ d# dR l* m+ }# t j j |# ƒ  dS ƒ }$ y8 t, |$ dT ƒ }% |% j- ƒ  j. ƒ  }& |& g }  |% j/ ƒ  Wqpt0 k
 o YqpXn | oj g  }  t, | ƒ }% xG |% D]? }' |' j ƒ  }( |( o& |( d# j1 dU ƒ o |  j2 |( ƒ qqW|% j/ ƒ  n | o t3 t4 t5 | ƒ ƒ } n |  o t3 t4 t5 |  ƒ ƒ }  n t6 d d … }) t7 j8 ƒ  }* | oF x9 | D]1 }+ |+ |) k o |) j |+ ƒ n |* j9 |+ ƒ qKWg  } n |  p | p t: | |) |* ƒ }  | o |  d d … }  n | oC y |  d |  j; | ƒ … =Wqt< k
 o t
 dV | ƒ YqXn | o t= j> |  ƒ n | o: d# d l? } | j@ dW t jA t jB g d d{ dX d ƒ }, n g  }- | t  _C |
 t  _D t jE jF ƒ  }. x½|  D]µ}/ | p t
 |/ ƒ t j jG ƒ  n | o# |, jH dY dZ tI ƒ  d[ tJ ƒ  ƒn³ y" tK |/ | | | |- | | ƒ }0 Wn& tL k
 o t
 ƒ  PYn ‚  Yn X|0 d# k o | j |/ ƒ nJ |0 d# k o | j |/ ƒ n, |  j |/ ƒ |0 d\ k o |! j |/ ƒ n |	 ob | jM ƒ  | jN oJ t
 d] t | jN ƒ d^ d_ ƒt
 d` ƒ |" j2 | jN ƒ | jN d d … =q
n xE t jE jF ƒ  D]4 }1 |1 |. k o! |1 j1 da ƒ o t  jO |1 ƒ q
q
Wq–W| jP ƒ  | jP ƒ  |  jP ƒ  | o~ | ov | o/ |  o' t | ƒ d k o t
 db d^ d_ ƒn t
 tQ t | ƒ dc ƒ dd ƒ | o t
 de ƒ t
 df ƒ qò
n | oS |- jP dg d ƒ t
 dh ƒ x6 |- d di … D]  \ }2 }/ t
 dj |/ |2 f ƒ q$Wn | o* t
 tQ t | ƒ dc ƒ dk ƒ tR | ƒ n |  oÙ | oÑ t
 tQ t |  ƒ dc ƒ dl ƒ tR |  ƒ tS ƒ  }3 t jT }4 |3 jU ƒ  om tV |  ƒ |3 jW ƒ  tV |! ƒ }5 |5 o1 t
 tQ t |5 ƒ dm ƒ dn |4 d= ƒ tR |5 ƒ qYt
 do |4 dp ƒ q]t
 dq ƒ t
 dr |4 dp ƒ n | o˜ | o‘ t
 ds ƒ x„ | D]x }/ t
 dt |/ ƒ t j jG ƒ  y. d t  _C tK |/ | d | |- | | | ƒ }0 Wq|tL k
 o t
 ƒ  PYq|‚  Yq|Xq|Wn | o´ t: | |) |* ƒ }6 xŸ tX t |6 ƒ ƒ D]z }7 |  d# |6 |7 k o_ |7 t |6 ƒ d k o t jY |$ ƒ n3 t, |$ du ƒ }% |% jZ |6 |7 d dv ƒ |% j/ ƒ  Pq(q(Wt jY |$ ƒ n | o, |, j[ ƒ  } | j\ dw d dx d dy | ƒ n | o t j] dz t j^ ƒ  ƒ n t j_ t | ƒ d# k ƒ d S(“   ue  Execute 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, coverdir, and
    print_slow) allow programmers calling main() directly to set the
    values that would normally be set by flags on the command line.
    i   Nu   hvgqxsSrf:lu:t:TD:NLR:wM:nu   helpu   verboseu   quietu   excludeu   singleu   slowu   randomu   fromfileu	   findleaksu   use=u
   threshold=u   traceu	   coverdir=u
   nocoverdiru   runleaksu   huntrleaks=u   verbose2u	   memlimit=u   debugu   start=u	   nowindowsu   -hu   --helpu   -vu	   --verboseu   -wu
   --verbose2u   -du   --debugu   -qu   --quieti    u   -xu	   --excludeu   -Su   --startu   -su   --singleu   --slowu   -ru   --randomizeu   -fu
   --fromfileu   -lu   --findleaksu   -Lu
   --runleaksu   -tu   --thresholdu   -Tu
   --coverageu   -Du
   --coverdiru   -Nu   --nocoverdiru   -Ru   --huntrleaksu   :i   i   u)   -R takes 2 or 3 colon-separated argumentsi   i   u
   reflog.txtu   -Mu
   --memlimitu   -uu   --usec             S   s!   g  } |  ] } | | j  ƒ  q
 S(    (   u   lower(   u   .0u   _[1]u   x(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu
   <listcomp>#  s    u   ,u   allu   -u   Invalid -u/--use option: u   -nu   --nowindowsu   -g and -v don't go together!u   -s and -f don't go together!u%   No GC available, disabling findleaks.(   u
   gettempdiru
   pynexttestu   ru   #u1   Couldn't find starting test (%s), using all testsu
   ignoredirsu   countuC   runtest(test, generate, verbose, quiet,        test_times, testdir)u   globalsu   localsiþÿÿÿu   Warning: test createdu   endu    u   uncollectable object(s).u   test.u   Allu   testu   OK.u0   CAUTION:  stdout isn't compared in verbose mode:u7   a test that passes in verbose mode may fail without it.u   reverseu   10 slowest tests:i
   u	   %s: %.1fsu   failed:u   skipped:u   skipu   unexpected onu   Those skips are all expected onu   .u6   Ask someone to teach regrtest.py about which tests areu   expected to get skipped onu'   Re-running failed tests in verbose modeu"   Re-running test %r in verbose modeu   wu   
u   show_missingu   summaryu   coverdiru   leaks %dF(   u   -hu   --help(   u   -vu	   --verbose(   u   -wu
   --verbose2T(   u   -du   --debug(   u   -qu   --quiet(   u   -xu	   --exclude(   u   -Su   --start(   u   -su   --single(   u   -Su   --slow(   u   -ru   --randomize(   u   -fu
   --fromfile(   u   -lu   --findleaks(   u   -Lu
   --runleaks(   u   -tu   --threshold(   u   -Tu
   --coverage(   u   -Du
   --coverdir(   u   -Nu   --nocoverdir(   u   -Ru   --huntrleaks(   i   i   (   u   -Mu
   --memlimit(   u   -uu   --use(   u   -nu   --nowindows(`   u   supportu   record_original_stdoutu   sysu   stdoutu   getoptu   argvu   erroru   usageu   Noneu   Falseu   printu   __doc__u   Trueu   gcu   set_thresholdu   intu   osu   pathu   joinu   getcwdu   splitu   lenu   warm_char_cacheu   set_memlimitu   RESOURCE_NAMESu   removeu   appendu   msvcrtu   SetErrorModeu   SEM_FAILCRITICALERRORSu   SEM_NOALIGNMENTFAULTEXCEPTu   SEM_NOGPFAULTERRORBOXu   SEM_NOOPENFILEERRORBOXu   CrtSetReportModeu   AttributeErroru   CRT_WARNu	   CRT_ERRORu
   CRT_ASSERTu   CRTDBG_MODE_FILEu   CrtSetReportFileu   CRTDBG_FILE_STDERRu   ImportErroru   tempfileu
   gettempdiru   openu   readu   stripu   closeu   IOErroru
   startswithu   extendu   listu   mapu   removepyu   STDTESTSu   NOTTESTSu   copyu   addu	   findtestsu   indexu
   ValueErroru   randomu   shuffleu   traceu   Traceu   prefixu   exec_prefixu   verboseu   use_resourcesu   modulesu   keysu   flushu   runctxu   globalsu   varsu   runtestu   KeyboardInterruptu   collectu   garbageu   unloadu   sortu   countu	   printlistu   _ExpectedSkipsu   platformu   isvalidu   setu   getexpectedu   rangeu   unlinku   writeu   resultsu   write_resultsu   systemu   getpidu   exit(8   u   testsu   testdiru   verboseu   quietu   generateu   excludeu   singleu	   randomizeu   fromfileu	   findleaksu   use_resourcesu   traceu   coverdiru   runleaksu
   huntrleaksu   verbose2u
   print_slowu   optsu   argsu   msgu   debugu   startu   ou   au   gcu   uu   ru   removeu   msvcrtu   mu   goodu   badu   skippedu   resource_deniedsu   found_garbageu
   gettempdiru   filenameu   fpu   nextu   lineu   gutsu   stdtestsu   nottestsu   argu   traceru
   test_timesu   save_modulesu   testu   oku   moduleu   timeu   eu   platu   surpriseu   alltestsu   i(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   main¼   s   		
 













  

	
  
 		 



 


#

 
		 

 	 
	 u   test_grammaru   test_opcodesu	   test_dictu   test_builtinu   test_exceptionsu
   test_typesu   test_unittestu   test_doctestu   test_doctest2u   test_future1u   test_future2c             C   s¹   |  p t  ƒ  }  n t j |  ƒ } g  } x{ | D]s } | d d … d k oV | d d … d k o? | d d … } | | k o | | k o | j | ƒ q£ q0 q0 W| j ƒ  | | S(   u-   Return a list of all applicable test modules.Ni   u   test_iýÿÿÿu   .py(   u   findtestdiru   osu   listdiru   appendu   sort(   u   testdiru   stdtestsu   nottestsu   namesu   testsu   nameu   modname(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu	   findtests  s      .
c             C   s5   z  t  |  | | | | | | ƒ SWd t |  | ƒ Xd S(   u‘  Run a single test.

    test -- the name of the test
    verbose -- if true, print more messages
    quiet -- if true, don't print 'skipped' messages (probably redundant)
    test_times -- a list of (time, test_name) pairs
    testdir -- test directory
    huntrleaks -- run multiple times to test for leaks; requires a debug
                  build; a triple corresponding to -R's three arguments
    debug -- if true, print tracebacks for failed tests regardless of
             verbose setting
    Return:
        -2  test skipped because resource denied
        -1  test skipped for some other reason
         0  test failed
         1  test passed
    N(   u   runtest_inneru   cleanup_test_droppings(   u   testu   generateu   verboseu   quietu
   test_timesu   testdiru
   huntrleaksu   debug(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   runtest$  s    c             C   sV  t  j |  ƒ | p t ƒ  } n | o
 d  } n t j ƒ  } yt j }	 zç | o | t _ t |  ƒ n |  j	 d ƒ o
 |  }
 n d |  }
 t
 j
 ƒ  } t |
 t ƒ  t ƒ  g  ƒ } t | |  ƒ } t | d d  ƒ } | d  k	 o | ƒ  n | o t | |  | | ƒ n t
 j
 ƒ  | } | j | |  f ƒ Wd  |	 t _ XWnšt  j k
 oG } z1 | p! t |  d | ƒ t j j ƒ  n d SWYd  d  } ~ Xn¼t t  j f k
 oG } z1 | p! t |  d | ƒ t j j ƒ  n d SWYd  d  } ~ Xnat k
 o ‚  YnKt  j k
 o? } z) t d |  d | ƒ t j j ƒ  d SWYd  d  } ~ Xnþ t j ƒ  d  d	 … \ } } t d |  d
 t | ƒ d | ƒ t j j ƒ  | p | o$ t j d t j ƒ t j j ƒ  n d SYnw X| p d S| j ƒ  } |  d } | | k p | o d St d |  d ƒ t j j ƒ  t | | ƒ t j j ƒ  d Sd  S(   Nu   test.u	   test_mainu
   skipped --iþÿÿÿiÿÿÿÿu   testu	   failed --i    i   u
   crashed --u   :u   filei   u   
u   produced unexpected output:(   u   supportu   unloadu   findtestdiru   Noneu   iou   StringIOu   sysu   stdoutu   printu
   startswithu   timeu
   __import__u   globalsu   localsu   getattru   dash_Ru   appendu   ResourceDeniedu   flushu   ImportErroru   TestSkippedu   KeyboardInterruptu
   TestFailedu   exc_infou   stru	   tracebacku	   print_excu   getvalueu
   reportdiff(   u   testu   generateu   verboseu   quietu
   test_timesu   testdiru
   huntrleaksu   debugu   cfpu   save_stdoutu   abstestu
   start_timeu   the_packageu
   the_moduleu   indirect_testu	   test_timeu   msgu   typeu   valueu   outputu   expected(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   runtest_inner>  sz    
		

 	
c             C   s  d d  l  } xt j d f D]û } t j j | ƒ p q n t j j | ƒ o d | j } } n8 t j j | ƒ o d t j	 } } n t
 d | ƒ ‚ | o t d |  | | f ƒ n y | | ƒ Wq t k
 o> } z( t d |  | | | f d t j ƒWYd  d  } ~ Xq Xq Wd  S(   Ni    u   db_homeu	   directoryu   fileu8   os.path says %r exists but is neither directory nor fileu   %r left behind %s %ru3   %r left behind %s %r and it couldn't be removed: %s(   u   shutilu   supportu   TESTFNu   osu   pathu   existsu   isdiru   rmtreeu   isfileu   unlinku   SystemErroru   printu	   Exceptionu   sysu   stderr(   u   testnameu   verboseu   shutilu   nameu   kindu   nukeru   msg(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   cleanup_test_droppings‡  s&    	 
c                su  d d  l  } d d  l ‰  t t d ƒ p t d ƒ ‚ n t j d  d  … } | j j ƒ  } t j	 j ƒ  } i  } xf ‡  f d †  ˆ  j
 Dƒ D]K }	 t |	 ƒ p q‰ n x. |	 j ƒ  |	 g D] }
 |
 j j ƒ  | |
 <q· Wq‰ Wˆ o ‡ f d †  } n ‡ f d †  } g  } | \ } } } | | } t d | d d	 t j ƒt d
 | d d d  | … d	 t j ƒt | | | | ƒ xƒ t | ƒ D]u } t j ƒ  } | ƒ  t j j d ƒ t j j ƒ  t | | | | ƒ | | k o | j t j ƒ  | d ƒ q‚q‚Wt d	 t j ƒ t | ƒ oY d | | t | ƒ f } t | d	 t j ƒt | d ƒ } t | d	 | ƒ| j ƒ  n d  S(   Ni    u   gettotalrefcountu9   Tracking reference leaks requires a debug build of Pythonc                s$   g  } |  ] } | t  ˆ  | ƒ q
 S(    (   u   getattr(   u   .0u   _[1]u   a(   u   _abcoll(    u*   /mit/python/lib/python3.0/test/regrtest.pyu
   <listcomp>³  s    c                  s   ˆ  ƒ  d  S(   N(    (    (   u   indirect_test(    u*   /mit/python/lib/python3.0/test/regrtest.pyu   run_the_testº  s    c                  s"   t  j ˆ  j =t d ˆ  j ƒ d  S(   Nu   import (   u   sysu   modulesu   __name__u   exec(    (   u
   the_module(    u*   /mit/python/lib/python3.0/test/regrtest.pyu   run_the_test½  s    u	   beginningu   repetitionsu   fileu
   1234567890i
   i   u   .i   u   %s leaked %s references, sum=%su   a(   u   copyregu   _abcollu   hasattru   sysu	   Exceptionu   warningsu   filtersu   dispatch_tableu   copyu   path_importer_cacheu   __all__u
   isabstractu   __subclasses__u   _abc_registryu   printu   stderru   dash_R_cleanupu   rangeu   gettotalrefcountu   writeu   flushu   appendu   anyu   sumu   openu   close(   u
   the_moduleu   testu   indirect_testu
   huntrleaksu   copyregu   fsu   psu   picu   abcsu   abcu   obju   run_the_testu   deltasu   nwarmupu   ntrackedu   fnameu   repcountu   iu   rcu   msgu   refrep(    (   u   _abcollu
   the_moduleu   indirect_testu*   /mit/python/lib/python3.0/test/regrtest.pyu   dash_R¦  sN      
) #c                s:  d d  l  } d d  l } d d  l } d d  l } d d  l } d d  l } d d  l }	 d d  l }
 d d  l } d d  l	 } d d  l
 ‰  d d l m } d d l m } x1 t j j ƒ  D]  } t | d ƒ o
 | ` q´ q´ W|  t j d  d  … <| j j ƒ  | j j | ƒ t j j ƒ  t j j | ƒ t j ƒ  x‹ ‡  f d †  ˆ  j Dƒ D]p } t | ƒ p qIn xS | j ƒ  | g D]> } | j | | ƒ  ƒ j ƒ  | _  | j! j ƒ  | j" j ƒ  qwWqIW| j ƒ  t# j$ ƒ  | j% j ƒ  | j& j' ƒ  | j( j) ƒ  | j* ƒ  |	 j+ ƒ  | j, j ƒ  | j- ƒ  d  |
 _/ | j0 ƒ  d  S(   Ni    (   u   _path_created(   u   WeakSetu   __warningregistry__c                s$   g  } |  ] } | t  ˆ  | ƒ q
 S(    (   u   getattr(   u   .0u   _[1]u   a(   u   _abcoll(    u*   /mit/python/lib/python3.0/test/regrtest.pyu
   <listcomp>ï  s    (1   u   gcu   copyregu	   _strptimeu	   linecacheu   urllib.parseu   urllib.requestu	   mimetypesu   doctestu   structu   filecmpu   _abcollu   distutils.dir_utilu   _path_createdu   weakrefu   WeakSetu   sysu   modulesu   valuesu   hasattru   __warningregistry__u   warningsu   filtersu   dispatch_tableu   clearu   updateu   path_importer_cacheu   _clear_type_cacheu   __all__u
   isabstractu   __subclasses__u   getu   copyu   _abc_registryu
   _abc_cacheu   _abc_negative_cacheu   reu   purgeu   _regex_cacheu   parseu   clear_cacheu   requestu
   urlcleanupu
   clearcacheu   _default_mime_typesu   _cacheu   _clearcacheu   Noneu   masteru   collect(   u   fsu   psu   picu   abcsu   gcu   copyregu	   _strptimeu	   linecacheu   urllibu	   mimetypesu   doctestu   structu   filecmpu   _path_createdu   WeakSetu   modu   abcu   obj(    (   u   _abcollu*   /mit/python/lib/python3.0/test/regrtest.pyu   dash_R_cleanup×  sH    0$ 
  




	c              C   s?   t  t d ƒ ƒ }  x& t d ƒ D] } |  | | d … q Wd  S(   Ni   i   (   u   bytesu   range(   u   su   i(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   warm_char_cache  s     c          
   C   s  d d  l  } t d d ƒ |  j d ƒ } | j d ƒ } | j d | d | ƒ } | j ƒ  } d „  } x‡| D]\ } }	 }
 } } | d k o ql | d	 k oK t d
 | |	 |
 ƒ d ƒ x0| |	 |
 … D] } t d | d d ƒqÉ Wql | d k op t d | |	 |
 ƒ d d | | | ƒ d ƒ xÆ | j | |	 |
 … | | | … ƒ D] } t | d d ƒqIWql | d k o[ t d
 | | | ƒ d d t |
 ƒ d ƒ xK | | | … D] } t d | d d ƒq®Wql t d | |	 |
 | | f ƒ ql Wt d d ƒ d  S(   Ni    u   *iF   i   u   au   bc             S   s8   |  d 7}  |  | k o d t  |  ƒ Sd |  | f Sd  S(   Ni   u   line u   lines %d-%d(   u   str(   u   x0u   x1(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   pair  s    
u   equalu   deleteu   ***u   of expected output missing:u   -u   endu    u   replaceu   *** mismatch betweenu   of expectedu
   output andu   of actual output:u   insertu   of actual output doesn't appearu   in expected output after lineu   :u   +u$   get_opcodes() returned bad tuple?!?!(   u   difflibu   printu
   splitlinesu   SequenceMatcheru   get_opcodesu   ndiffu   str(   u   expectedu   outputu   difflibu   au   bu   smu   tuplesu   pairu   opu   a0u   a1u   b0u   b1u   line(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu
   reportdiff  s<    	  '   c              C   sD   t  d k o t j d }  n t }  t j j |  ƒ p t j } | S(   Nu   __main__i    (   u   __name__u   sysu   argvu   __file__u   osu   pathu   dirnameu   curdir(   u   fileu   testdir(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   findtestdir5  s
    c             C   s(   |  j  d ƒ o |  d  d … }  n |  S(   Nu   .pyiýÿÿÿ(   u   endswith(   u   name(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   removepy=  s    c             C   s.   |  d k o d |  | f Sd |  | f Sd  S(   Ni   u   %d %su   %d %ss(    (   u   nu   word(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   countB  s    iF   i   c          	   C   sO   d d l  m } d | } t | d j t t |  ƒ ƒ | d | d | ƒƒ d S(   uÐ   Print 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.
    i    (   u   fillu    u   initial_indentu   subsequent_indentN(   u   textwrapu   fillu   printu   joinu   mapu   str(   u   xu   widthu   indentu   fillu   blanks(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu	   printlistH  s    
!u  
        test__locale
        test_bsddb3
        test_crypt
        test_curses
        test_dbm
        test_fcntl
        test_fork1
        test_epoll
        test_dbm_gnu
        test_grp
        test_ioctl
        test_largefile
        test_kqueue
        test_openpty
        test_ossaudiodev
        test_pipes
        test_poll
        test_posix
        test_pty
        test_pwd
        test_resource
        test_signal
        test_syslog
        test_threadsignals
        test_wait3
        test_wait4
        u   win32ua   
        test_curses
        test_largefile
        test_kqueue
        test_ossaudiodev
        u   linux2u  
        test_atexit
        test_bsddb
        test_bsddb3
        test_bz2
        test_crypt
        test_curses
        test_dbm
        test_fcntl
        test_fork1
        test_epoll
        test_grp
        test_ioctl
        test_largefile
        test_locale
        test_kqueue
        test_mmap
        test_openpty
        test_ossaudiodev
        test_poll
        test_popen
        test_posix
        test_pty
        test_pwd
        test_resource
        test_signal
        test_sundry
        test_tarfile
        u   macu¾   
        test_bsddb
        test_epoll
        test_largefile
        test_kqueue
        test_minidom
        test_openpty
        test_pyexpat
        test_sax
        test_sundry
        u	   unixware7u	   openunix8u‰  
        test_asynchat
        test_bsddb
        test_fork1
        test_epoll
        test_gettext
        test_largefile
        test_locale
        test_kqueue
        test_minidom
        test_openpty
        test_pyexpat
        test_queue
        test_sax
        test_sundry
        test_thread
        test_threaded_import
        test_threadedtempfile
        test_threading
        u   sco_sv3uì   
        test__locale
        test_bsddb
        test_bsddb3
        test_curses
        test_epoll
        test_dbm_gnu
        test_largefile
        test_locale
        test_minidom
        test_ossaudiodev
        test_poll
        uË   
        test_bsddb
        test_curses
        test_dbm
        test_epoll
        test_kqueue
        test_dbm_gnu
        test_gzip
        test_openpty
        test_zipfile
        test_zlib
        u   sunos5u   
        test_bsddb
        test_curses
        test_epoll
        test_dbm_gnu
        test_gzip
        test_largefile
        test_locale
        test_kqueue
        test_minidom
        test_openpty
        test_pyexpat
        test_sax
        test_zipfile
        test_zlib
        u   hp-ux11uÑ   
        test_curses
        test_dbm_gnu
        test_epoll
        test_largefile
        test_locale
        test_kqueue
        test_mhlib
        test_mmap
        test_poll
        test_resource
        u   atheosuÚ   
        test_bsddb3
        test_curses
        test_dbm
        test_epoll
        test_ioctl
        test_kqueue
        test_largefile
        test_locale
        test_ossaudiodev
        test_socketserver
        u   cygwinuÿ   
        test_audioop
        test_bsddb3
        test_curses
        test_epoll
        test_kqueue
        test_largefile
        test_mmap
        test_openpty
        test_ossaudiodev
        test_pty
        test_resource
        test_signal
        u   os2emxu  
        test_bsddb
        test_bsddb3
        test_epoll
        test_dbm_gnu
        test_locale
        test_ossaudiodev
        test_pep277
        test_pty
        test_socketserver
        test_tcl
        test_timeout
        test_urllibnet
        test_multiprocessing
        u   freebsd4uâ   
        test_bsddb
        test_bsddb3
        test_bz2
        test_epoll
        test_dbm_gnu
        test_gzip
        test_kqueue
        test_ossaudiodev
        test_tcl
        test_zipimport
        test_zlib
        u   aix5uö   
        test_bsddb
        test_bsddb3
        test_ctypes
        test_epoll
        test_dbm_gnu
        test_locale
        test_normalization
        test_ossaudiodev
        test_pep277
        test_tcl
        test_multiprocessing
        u   openbsd3uï   
        test_bsddb
        test_bsddb3
        test_ctypes
        test_curses
        test_epoll
        test_dbm_gnu
        test_locale
        test_ossaudiodev
        test_pep277
        test_tcl
        test_multiprocessing
        u   netbsd3u   freebsd5u   freebsd6u   freebsd7u   freebsd8c             B   s)   |  Ee  Z d  „  Z d „  Z d „  Z d S(   c             C   sx  d d  l  } d d l m } d |  _ t j t k o?t t j } t | j	 ƒ  ƒ |  _
 |  j
 j d ƒ | j j p |  j
 j d ƒ n d } t j ƒ  j ƒ  | k o4 |  j
 j d ƒ |  j
 j d ƒ |  j
 j d ƒ n | j o |  j
 j d ƒ n t j d k o: d d d d d g } x" | D] } |  j
 j | ƒ q%Wn t j d k o |  j
 j d ƒ n d |  _ n d  S(   Ni    (   u   test_timeoutu   test_nisu   test_pep277u   utf-8u   latin-1u   asciiu   mbcsu   utf-16u   utf-32u   test_profileu   test_cProfileu   test_doctestu   test_timeoutu   win32u   test_unicode_fileu   test_winregu   test_winsoundu   test_startfileu   test_sqliteu   sunos5F(   u   utf-8u   latin-1u   asciiu   mbcsu   utf-16u   utf-32T(   u   os.pathu   testu   test_timeoutu   Falseu   validu   sysu   platformu   _expectationsu   setu   splitu   expectedu   addu   pathu   supports_unicode_filenamesu   getfilesystemencodingu   loweru   skip_expectedu   True(   u   selfu   osu   test_timeoutu   su   encsu   WIN_ONLYu   skip(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   __init__i  s4    	
	 c             C   s   |  j  S(   u@   Return true iff _ExpectedSkips knows about the current platform.(   u   valid(   u   self(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   isvalid”  s    c             C   s   |  j  ƒ  p t ‚ |  j S(   un   Return set of test names we expect to skip on current platform.

        self.isvalid() must be true.
        (   u   isvalidu   AssertionErroru   expected(   u   self(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   getexpected˜  s    N(   u   __name__u
   __module__u   __init__u   isvalidu   getexpected(   u
   __locals__(    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   _ExpectedSkipsh  s   
	+	u   _ExpectedSkipsu   __main__i   u*   Could not find %r in sys.path to remove it(>   u   __doc__u   getoptu   osu   randomu   reu   iou   sysu   timeu	   tracebacku   warningsu   inspectu
   isabstractu   filterwarningsu   FutureWarningu   maxsizeu   modu   ImportWarningu   platformu   resourceu   ImportErroru	   getrlimitu   RLIMIT_STACKu   softu   hardu   minu   maxu   newsoftu	   setrlimitu   testu   supportu   RESOURCE_NAMESu   usageu   Noneu   Falseu   mainu   STDTESTSu   NOTTESTSu	   findtestsu   runtestu   runtest_inneru   cleanup_test_droppingsu   dash_Ru   dash_R_cleanupu   warm_char_cacheu
   reportdiffu   findtestdiru   removepyu   countu	   printlistu   _expectationsu   _ExpectedSkipsu   __name__u   pathu   abspathu   normpathu   dirnameu   argvu   mydiru   lenu   iu   pathlenu   print(    (    (    u*   /mit/python/lib/python3.0/test/regrtest.pyu   <module>   s¼   	
 	ÿ I		H		1	/		*			
91 
,