[Python-checkins] python/dist/src/Lib/test regrtest.py,1.84,1.85

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Fri, 07 Jun 2002 08:17:06 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv6207

Modified Files:
	regrtest.py 
Log Message:
Added -t (--threshold) option to call gc.set_threshold(N).


Index: regrtest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -d -r1.84 -r1.85
*** regrtest.py	2 Jun 2002 21:42:01 -0000	1.84
--- regrtest.py	7 Jun 2002 15:17:03 -0000	1.85
***************
*** 19,22 ****
--- 19,23 ----
  -u: use       -- specify which special resource intensive tests to run
  -h: help      -- print this text and exit
+ -t: threshold -- call gc.set_threshold(N)
  
  If non-option arguments are present, they are names for tests to run,
***************
*** 26,45 ****
  -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 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).
  
! -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.
  
! -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.
--- 27,47 ----
  -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
! 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).
  
! -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.
  
! -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.
***************
*** 48,57 ****
                  state and output modes.
  
!     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.
  """
  
--- 50,59 ----
                  state and output modes.
  
!     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.
  """
  
***************
*** 94,101 ****
      files beginning with test_ will be used.
  
!     The other default arguments (verbose, quiet, generate, exclude, single,
!     randomize, findleaks, and use_resources) allow programmers calling main()
!     directly to set the values that would normally be set by flags on the
!     command line.
  
      """
--- 96,103 ----
      files beginning with test_ will be used.
  
!     The other default arguments (verbose, quiet, generate, exclude,
!     single, randomize, findleaks, and use_resources) allow programmers
!     calling main() directly to set the values that would normally be
!     set by flags on the command line.
  
      """
***************
*** 103,110 ****
      test_support.record_original_stdout(sys.stdout)
      try:
!         opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:',
                                     ['help', 'verbose', 'quiet', 'generate',
                                      'exclude', 'single', 'random', 'fromfile',
!                                     'findleaks', 'use='])
      except getopt.error, msg:
          usage(2, msg)
--- 105,112 ----
      test_support.record_original_stdout(sys.stdout)
      try:
!         opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:',
                                     ['help', 'verbose', 'quiet', 'generate',
                                      'exclude', 'single', 'random', 'fromfile',
!                                     'findleaks', 'use=', 'threshold='])
      except getopt.error, msg:
          usage(2, msg)
***************
*** 133,136 ****
--- 135,141 ----
          elif o in ('-l', '--findleaks'):
              findleaks = 1
+         elif o in ('-t', '--threshold'):
+             import gc
+             gc.set_threshold(int(a))
          elif o in ('-u', '--use'):
              u = [x.lower() for x in a.split(',')]