[Python-checkins] python/dist/src/Lib/test regrtest.py,1.152,1.153

montanaro at users.sourceforge.net montanaro at users.sourceforge.net
Sun Jun 6 11:53:21 EDT 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26973

Modified Files:
	regrtest.py 
Log Message:
add -L flag to cause leaks(1) command to run just before exit


Index: regrtest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v
retrieving revision 1.152
retrieving revision 1.153
diff -C2 -d -r1.152 -r1.153
*** regrtest.py	7 Feb 2004 22:43:03 -0000	1.152
--- regrtest.py	6 Jun 2004 15:53:18 -0000	1.153
***************
*** 21,24 ****
--- 21,25 ----
  -t: threshold -- call gc.set_threshold(N)
  -T: coverage  -- turn on code coverage using the trace module
+ -L: runleaks  -- run the leaks(1) command just before exit
  
  If non-option arguments are present, they are names for tests to run,
***************
*** 43,46 ****
--- 44,51 ----
  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.
+ 
  -u is used to specify which special resource intensive tests to run,
  such as those requiring large file support or network connectivity.
***************
*** 119,123 ****
  def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
           exclude=False, single=False, randomize=False, fromfile=None,
!          findleaks=False, use_resources=None, trace=False):
      """Execute a test suite.
  
--- 124,128 ----
  def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
           exclude=False, single=False, randomize=False, fromfile=None,
!          findleaks=False, use_resources=None, trace=False, runleaks=False):
      """Execute a test suite.
  
***************
*** 144,151 ****
      test_support.record_original_stdout(sys.stdout)
      try:
!         opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:T',
                                     ['help', 'verbose', 'quiet', 'generate',
                                      'exclude', 'single', 'random', 'fromfile',
                                      'findleaks', 'use=', 'threshold=', 'trace',
                                      ])
      except getopt.error, msg:
--- 149,157 ----
      test_support.record_original_stdout(sys.stdout)
      try:
!         opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:TL',
                                     ['help', 'verbose', 'quiet', 'generate',
                                      'exclude', 'single', 'random', 'fromfile',
                                      'findleaks', 'use=', 'threshold=', 'trace',
+                                     'runleaks'
                                      ])
      except getopt.error, msg:
***************
*** 175,178 ****
--- 181,186 ----
          elif o in ('-l', '--findleaks'):
              findleaks = True
+         elif o in ('-L', '--runleaks'):
+             runleaks = True
          elif o in ('-t', '--threshold'):
              import gc
***************
*** 351,354 ****
--- 359,365 ----
          r.write_results(show_missing=True, summary=True, coverdir=coverdir)
  
+     if runleaks:
+         os.system("leaks %d" % os.getpid())
+ 
      sys.exit(len(bad) > 0)
  




More information about the Python-checkins mailing list