]> granicus.if.org Git - python/commitdiff
Merged revisions 87704-87705 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 3 Jan 2011 20:49:01 +0000 (20:49 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 3 Jan 2011 20:49:01 +0000 (20:49 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87704 | antoine.pitrou | 2011-01-03 21:38:52 +0100 (lun., 03 janv. 2011) | 5 lines

  Issue #6293: Have regrtest.py echo back sys.flags.  This is done by default
  in whole runs and enabled selectively using `--header` when running an
  explicit list of tests.  Original patch by Collin Winter.
........
  r87705 | antoine.pitrou | 2011-01-03 21:40:07 +0100 (lun., 03 janv. 2011) | 3 lines

  Mention --randseed in option list
........

Lib/test/regrtest.py
Misc/NEWS

index 9f038c4d6a134c0dec22879b302adf517cc90e50..90597f37657ff13b9fd9de235988a3cf5787bfd7 100755 (executable)
@@ -28,10 +28,12 @@ Verbosity
 -W/--verbose3   -- re-run failed tests in verbose mode immediately
 -q/--quiet      -- no output unless one or more tests fail
 -S/--slow       -- print the slowest 10 tests
+   --header     -- print header with interpreter info
 
 Selecting tests
 
 -r/--random     -- randomize test execution order (see below)
+   --randseed   -- pass a random seed to reproduce a previous random run
 -f/--fromfile   -- read names of tests to run from a file (see below)
 -x/--exclude    -- arguments are tests to *exclude*
 -s/--single     -- single step through a set of tests (see below)
@@ -227,7 +229,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
          exclude=False, single=False, randomize=False, fromfile=None,
          findleaks=False, use_resources=None, trace=False, coverdir='coverage',
          runleaks=False, huntrleaks=False, verbose2=False, print_slow=False,
-         random_seed=None, use_mp=None, verbose3=False, forever=False):
+         random_seed=None, use_mp=None, verbose3=False, forever=False,
+         header=False):
     """Execute a test suite.
 
     This also parses command-line options and modifies its behavior
@@ -258,7 +261,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
              'exclude', 'single', 'slow', 'random', 'fromfile', 'findleaks',
              'use=', 'threshold=', 'trace', 'coverdir=', 'nocoverdir',
              'runleaks', 'huntrleaks=', 'memlimit=', 'randseed=',
-             'multiprocess=', 'slaveargs=', 'forever'])
+             'multiprocess=', 'slaveargs=', 'forever', 'header'])
     except getopt.error, msg:
         usage(2, msg)
 
@@ -342,6 +345,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
             forever = True
         elif o in ('-j', '--multiprocess'):
             use_mp = int(a)
+        elif o == '--header':
+            header = True
         elif o == '--slaveargs':
             args, kwargs = json.loads(a)
             try:
@@ -415,13 +420,14 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
         args = []
 
     # For a partial run, we do not need to clutter the output.
-    if verbose or not (quiet or single or tests or args):
+    if verbose or header or not (quiet or single or tests or args):
         # Print basic platform information
         print "==", platform.python_implementation(), \
                     " ".join(sys.version.split())
         print "==  ", platform.platform(aliased=True), \
                       "%s-endian" % sys.byteorder
         print "==  ", os.getcwd()
+        print "Testing with flags:", sys.flags
 
     alltests = findtests(testdir, stdtests, nottests)
     selected = tests or args or alltests
index a410b940b662e44d63d89c81114bedf1ab946d69..74cccf5447ac43ba495ebf2182dd4374a908a8a7 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -116,6 +116,10 @@ Build
 Tests
 -----
 
+- Issue #6293: Have regrtest.py echo back sys.flags.  This is done by default
+  in whole runs and enabled selectively using ``--header`` when running an
+  explicit list of tests.  Original patch by Collin Winter.
+
 - Issue #775964: test_grp now skips YP/NIS entries instead of failing when
   encountering them.