‡Æ
ENö9c       s4    d  Z    " d k Z # d k Z $ d k Z % d k Z & d k Z ' d k Z ) d k Z + e e d d d d d d d d d „
 Z	 ¸ d d d d d d	 g Z
 Á d
 d d g Z Ç e e
 e d „ Z Ô e d „ Z 	d „  Z d „  Z d f  d „  ƒ  YZ 1e d j o 2e i e	 ƒ  ƒ n d S(   sè  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
-q: quiet     -- don't print anything except if a test fails
-g: generate  -- write the output file for a test instead of comparing it
-x: exclude   -- arguments are tests to *exclude*
-s: single    -- run only a single test (see below)
-r: random    -- randomize test execution order
-l: findleaks -- if GC is available detect tests that leak memory
--have-resources   -- run tests that require large resources (time/space)

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.

-s means to run only a single test and exit.  This is useful when Purifying
the Python interpreter.  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).

Nc
 !   s2  + C E y, F t  i  t i d d d g ƒ \ }
 } Wn2 G t  i j
 o  } H | GHI t GHJ d Sn XK x|
 d K rþ \ } } L | d j o L | d } n M | d j o M d } d } n N | d j o N d } n O | d	 j o O d } n P | d
 j o P d } n Q | d j o Q d } n R | d j o R d } n S | d j o S d }	 n qv WT | o | o U d GHV d Sn W g  } X g  } Y g  } [ | oJ \ y ] d k } Wn' ^ t j
 o _ d GH` d } n Xf g  } n h | o• i d k l } j t i i | ƒ  d ƒ } k yG l t | d ƒ } m t  i! | i" ƒ  ƒ } n | g }  o | i% ƒ  Wn p t& j
 o
 q n Xn r xR t' t( | ƒ ƒ d r r9 } t | | d d j o u | | d  | | <n qÅWv t* } w t, } x | oW y x7 | d y r* } z | | j o { | i/ | ƒ n q/W| | | d *} g  } n ~ |  p | p t0 | | | ƒ }   | o € |  d  }  n  | o ‚ t2 i3 |  ƒ n ƒ | t4 _
 „ |	 t4 _ … t i5 i6 ƒ  } † xX|  d † rK} ‡ | o ˆ | GHn ‰ t9 | | | | | ƒ } Š | d j o ‹ | i; | ƒ n5 Œ | d j o  | i; | ƒ n  | i; | ƒ  | o[ ‘ | i< ƒ  ’ | i= o= “ d Gt( | i= ƒ G” d GH— | i> | i= ƒ ˜ | i= 2n n š xP t i5 i6 ƒ  d š r: } › | | j o | i@ d ƒ o œ t4 iA | ƒ n qWqW | o | oP ž | o | o t( | ƒ d j o Ÿ d Gn   tB t( | ƒ d ƒ Gd GHn ¡ | o/ ¢ tB t( | ƒ d ƒ Gd G£ t  i | ƒ GHn ¤ | o | o/ ¥ tB t( | ƒ d ƒ Gd G¦ t  i | ƒ GHn ¨ | o× © t0 | | | ƒ }  ª x¸ t' t( |  ƒ ƒ d ª r } « |  d |  | j oq ¬ | t( |  ƒ d j o ­ t iD | ƒ n< ¯ t | d ƒ } ° | iE |  | d d ƒ ± | i% ƒ  ² Pn qqW´ t iD | ƒ n ¶ t( | ƒ d j Sd S(    sC  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 seven default arguments (verbose, quiet, generate, exclude,
    single, randomize, and findleaks) allow programmers calling main()
    directly to set the values that would normally be set by flags on the
    command line.

    i   s   vgqxsrls   have-resourcesi   i    s   -vs   -qs   -gs   -xs   -ss   -rs   -ls   --have-resourcess   -g and -v don't go together!Ns%   No GC available, disabling findleaks.(   s
   gettempdirs
   pynexttests   ri   s   .pys   Warning: test createds   uncollectable object(s).s   test.s   Alls   tests   OK.s   failed:s   skipped:s   ws   
(F   s   getopts   syss   argvs   optss   argss   errors   msgs   __doc__s   os   as   verboses   quiets   generates   excludes   singles	   randomizes	   findleakss   use_large_resourcess   goods   bads   skippeds   gcs   ImportErrors   found_garbages   tempfiles
   gettempdirs   oss   paths   joins   filenames   opens   fps   strings   strips   reads   nexts   testss   closes   IOErrors   ranges   lens   is   STDTESTSs   stdtestss   NOTTESTSs   nottestss   args   removes	   findtestss   testdirs   randoms   shuffles   test_supports   moduless   keyss   save_moduless   tests   runtests   oks   appends   collects   garbages   extends   modules
   startswiths   unloads   counts   alltestss   unlinks   write(!   s   testss   testdirs   verboses   quiets   generates   excludes   singles	   randomizes	   findleakss   use_large_resourcess   optss   argss   msgs   os   as   goods   bads   skippeds   gcs   found_garbages
   gettempdirs   filenames   fps   nexts   is   stdtestss   nottestss   args   save_moduless   tests   oks   modules   alltestss*   /mit/python/lib/python2.0/test/regrtest.pys   main+ sâ   ,         			

 	


 	#

 	
 	 &

 	i    s   test_grammars   test_opcodess   test_operationss   test_builtins   test_exceptionss
   test_typess   test_supports   test_b1s   test_b2c    sÚ   Ç È É |  o É t ƒ  }  n Ê t i |  ƒ } Ë g  } Ì x| | d Ì ro } Í | d  d j o | d d j oC Î | d  } Ï | | j o
 | | j o Ð | i
 | ƒ n n qH WÑ | i ƒ  Ò | | Sd S(   s-   Return a list of all applicable test modules.i    i   s   test_i   s   .pyN(   s   testdirs   findtestdirs   oss   listdirs   namess   testss   names   modnames   stdtestss   nottestss   appends   sort(   s   testdirs   stdtestss   nottestss   namess   testss   names   modnames*   /mit/python/lib/python2.0/test/regrtest.pys	   findtestsÇ s    	 	&c    s  Ô Ü Ý t  i |  ƒ Þ | o Þ t ƒ  } n ß t i i | d ƒ } à t i i | |  ƒ } á yM â | o ã t | d ƒ } n* ä | o å t i } n ç t | ƒ } Wn+ è t j
 o é t } ê d G| GHn Xë y’ ì t i } í zl î | o ï | t _ ð |  GHn ñ t |  t ƒ  t ƒ  g  ƒ ò | o | p | o ó | i ƒ  n Wd ô õ | t _ XWnö t t  i f j
 o7 }	 ÷ | o ø d G|  Gù d G|	 GHn ú d SnÈ û t j
 o ü ‚  n­ ý t  i j
 o$ }	 þ d G|  Gd G|	 GHÿ d	 Snx  t i ƒ  d
  \ }
 } d G|  Gd Gt! |
 ƒ d G| GH| o t" i# d t i ƒ n d	 Sn Xd Sd S(   sK  Run 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
    s   outputs   ws   Warning: can't openNs   tests   skipped -- i   s	   failed --i    i   s
   crashed --s   :s   file($   s   test_supports   unloads   tests   testdirs   findtestdirs   oss   paths   joins	   outputdirs
   outputfiles   generates   opens   cfps   verboses   syss   stdouts   Compares   IOErrors   Nones   save_stdouts
   __import__s   globalss   localss   closes   ImportErrors   TestSkippeds   msgs   quiets   KeyboardInterrupts
   TestFaileds   exc_infos   types   values   strs	   tracebacks	   print_exc(   s   tests   generates   verboses   quiets   testdirs	   outputdirs
   outputfiles   cfps   save_stdouts   msgs   types   values*   /mit/python/lib/python2.0/test/regrtest.pys   runtestÔ sV    

	

"
c     sZ   	
t  d j o t i d }  n
 t }  t i i |  ƒ p t i } | Sd  S(   Ns   __main__i    (
   s   __name__s   syss   argvs   files   __file__s   oss   paths   dirnames   curdirs   testdir(   s   files   testdirs*   /mit/python/lib/python2.0/test/regrtest.pys   findtestdir	s
   	c    s=   |  d j o d |  | f Sn d |  | f Sd  S(   Ni   s   %d %ss   %d %ss(   s   ns   word(   s   ns   words*   /mit/python/lib/python2.0/test/regrtest.pys   counts   s   Comparec      sM   d „  Z  d „  Z "d „  Z %d „  Z (d „  Z .d „  Z RS(   Nc    s   t  | d ƒ |  _ d  S(   Ns   r(   s   opens   filenames   selfs   fp(   s   selfs   filenames*   /mit/python/lib/python2.0/test/regrtest.pys   __init__s   c    sS   |  i i t | ƒ ƒ } | | j o! t i d | d | ‚ n d  S(   Ns	   Writing: s   , expected: (   s   selfs   fps   reads   lens   datas   expecteds   test_supports
   TestFailed(   s   selfs   datas   expecteds*   /mit/python/lib/python2.0/test/regrtest.pys   writes   c    s   "#t  |  i | ƒ d  S(   N(   s   maps   selfs   writes   listoflines(   s   selfs   listofliness*   /mit/python/lib/python2.0/test/regrtest.pys
   writelines"s   c    s
   %&d  S(   N(    (   s   selfs*   /mit/python/lib/python2.0/test/regrtest.pys   flush%s   c    sK   ()|  i i ƒ  } *| o +t i d | ‚ n ,|  i i ƒ  d  S(   Ns   Unread: (   s   selfs   fps   reads   leftovers   test_supports
   TestFaileds   close(   s   selfs   leftovers*   /mit/python/lib/python2.0/test/regrtest.pys   close(s   
c    s   ./d Sd  S(   Ni    (    (   s   selfs*   /mit/python/lib/python2.0/test/regrtest.pys   isatty.s   (   s   __init__s   writes
   writeliness   flushs   closes   isatty(    s*   /mit/python/lib/python2.0/test/regrtest.pys   Compares   s   __main__(   s   __doc__s   syss   strings   oss   getopts	   tracebacks   randoms   test_supports   Nones   mains   STDTESTSs   NOTTESTSs	   findtestss   runtests   findtestdirs   counts   Compares   __name__s   exit(    s*   /mit/python/lib/python2.0/test/regrtest.pys   ?  s"   *	5