[Jython-checkins] jython (merge default -> default): Merge recent regression test clean-up to trunk

jeff.allen jython-checkins at python.org
Fri Oct 30 17:07:27 EDT 2015


https://hg.python.org/jython/rev/e1455ac5ec63
changeset:   7784:e1455ac5ec63
parent:      7774:93c09145137e
parent:      7783:60c5479cd11f
user:        Jeff Allen <ja.py at farowl.co.uk>
date:        Fri Oct 30 21:00:04 2015 +0000
summary:
  Merge recent regression test clean-up to trunk

files:
  Lib/SimpleHTTPServer.py  |    6 +-
  Lib/test/regrtest.py     |  137 ++++++++++++----------
  Lib/test/test_chdir.py   |    2 +-
  Lib/test/test_file2k.py  |    3 +-
  Lib/test/test_glob.py    |    6 +-
  Lib/test/test_support.py |   15 +-
  Lib/test/test_sys.py     |    4 +-
  Lib/test/test_sys_jy.py  |    7 +-
  Lib/test/test_tarfile.py |   19 ++-
  build.xml                |  163 +++++++++++++++++---------
  10 files changed, 223 insertions(+), 139 deletions(-)


diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py
--- a/Lib/SimpleHTTPServer.py
+++ b/Lib/SimpleHTTPServer.py
@@ -90,7 +90,11 @@
             return None
         self.send_response(200)
         self.send_header("Content-type", ctype)
-        fs = os.fstat(f.fileno()) if hasattr(os, 'fstat') else os.stat(path)
+        try:
+            fs = os.fstat(f.fileno())
+        except OSError, AttributeError:
+            # Jython on Windows lands here when f.fileno() is invalid
+            fs = os.stat(path)
         self.send_header("Content-Length", str(fs[6]))
         self.send_header("Last-Modified", self.date_time_string(fs.st_mtime))
         self.end_headers()
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -217,11 +217,11 @@
     try:
         opts, args = getopt.getopt(sys.argv[1:], 'hvqxsSrf:lu:t:TD:NLR:wM:em:j:',
                                    ['help', 'verbose', 'quiet', 'exclude',
-                                    'single', 'slow', 'random', 'fromfile',
+                                    'single', 'slow', 'random', 'fromfile=',
                                     'findleaks', 'use=', 'threshold=', 'trace',
                                     'coverdir=', 'nocoverdir', 'runleaks',
                                     'huntrleaks=', 'verbose2', 'memlimit=',
-                                    'expected', 'memo'
+                                    'expected', 'memo=', 'junit-xml='
                                     ])
     except getopt.error, msg:
         usage(2, msg)
@@ -347,9 +347,9 @@
         tests = []
         fp = open(fromfile)
         for line in fp:
-            guts = line.split() # assuming no test has whitespace in its name
-            if guts and not guts[0].startswith('#'):
-                tests.extend(guts)
+            # Potentially multiple names and a comment on one line of the file
+            trunc_line = line.split('#', 1)[0]
+            tests.extend(trunc_line.split())
         fp.close()
 
     # Strip .py extensions.
@@ -500,7 +500,7 @@
         os.system("leaks %d" % os.getpid())
 
     if memo:
-        savememo(memo,good,failures,bad,skips,skipped,allran,resource_denieds)
+        savememo(memo, good, failures, bad, skips, skipped, allran, resource_denieds)
 
     sys.exit(surprises > 0)
 
@@ -1204,7 +1204,7 @@
         """,
     'java':
         """
-        # Not supportable on Java, or at least requires additional emulation in Jython
+        # These always skip (e.g. fail to import a certain module).
         test__locale
         test__rawffi
         test_aepack
@@ -1219,9 +1219,10 @@
         test_capi
         test_cd
         test_cl
-        test_closuregen
-        test_ctypes
+        test_closuregen        # cannot import name verify
+        test_ctypes            # cannot import name verify
         test_dl
+        test_dummy_threading   # cannot import _newFunctionThread
         test_fcntl
         test_fork1
         test_gdb
@@ -1233,7 +1234,6 @@
         test_imgfile
         test_ioctl
         test_kqueue
-        test_largefile
         test_linuxaudiodev
         test_macfs
         test_macostools
@@ -1245,7 +1245,6 @@
         test_openpty
         test_ossaudiodev
         test_parser
-        test_plistlib
         test_pty
         test_resource
         test_rgbimg
@@ -1254,62 +1253,37 @@
         test_strop
         test_structmembers
         test_sunaudiodev
-        test_sundry
         test_symtable
         test_tcl
         test_tk
         test_tools
         test_ttk_guionly
         test_ttk_textonly
-        test_unicode_file
-        test_wait3
-        test_wait4
+        test_unicode_file      # cannot import name TESTFN_UNICODE
+        test_wait3             # os.fork not defined
+        test_wait4             # os.fork not defined
         test_wave
         test_winreg
         test_winsound
-        test_zipfile64
+        test_zipfile64         # requires bogus resource "extralargefile"
+
+        # Not yet Jython 3.x
+        test_lib2to3
 
         # Could rewrite these tests
-        test_descr
-        test_epoll
-        test_poll
-        test_profile
-        test_struct
+        test_descr             # cannot import name verify
+        test_epoll             # test works only on Linux 2.6
+        test_poll              # cannot import name TestSkipped
+        test_struct            # cannot import name verify
 
-        # The following tests cause issues for tests that are subsequently run
-        test_distutils
-        test_email_codecs
-        test_io
         test_locale
 
         # Should fix these tests so they are not hardcoded for CPython pyc files
         test_compileall
-        test_pydoc
+        test_longexp           # Requires Python bytecode compilation support
 
-        # Requires Python bytecode compilation support
-        test_longexp
-
-        # Nonreliable tests
-        test_asynchat
-        test_asyncore
-        test_select_new
-
-        # Command line testing is hard for Jython to do, but revisit
-        test_cmd_line_script
-
-        # Tests that should work with socket-reboot, but currently hang
-        test_ftplib
-        test_httplib
-        test_poplib
-        test_smtplib
-        test_socket_ssl
-        test_telnetlib
-
-        test_sys_setprofile  # revisit for GC
-        test_sys_settrace    # revisit for line jumping
-
-        # Not yet Jython 3.x
-        test_lib2to3
+        test_multibytecodec    # No module named _multibytecodec
+        test_ucn               # No module named _testcapi
         """
 }
 _expectations['freebsd5'] = _expectations['freebsd4']
@@ -1325,29 +1299,65 @@
         test_codecencodings_iso2022
         test_codecencodings_jp
         test_codecencodings_kr
-        test_codecencodings_tw
         test_codecmaps_cn
-        test_codecmaps_hk
         test_codecmaps_jp
         test_codecmaps_kr
         test_codecmaps_tw
         test_compiler
         test_dis
-        test_dummy_threading
         test_eof
         test_frozen  # not meaningful for Jython, although it is similar to Clamp singlejar
-        test_gc      # test_gc_jy replaces this
         test_iterlen
-        test_multibytecodec
-        test_multibytecodec_support
         test_peepholer
         test_pyclbr
         test_pyexpat
-        test_stringprep
+        test_stringprep # UnicodeDecodeError
         test_threadsignals
         test_transformer
-        test_ucn
         test_zipimport
+
+        # fails on Windows standalone, probably shouldn't
+        test_netrc             # KeyError: 'foo.domain.com'
+        test_runpy             # OSError: unlink()
+        test_shutil            # Operation not permitted errors
+        test_urllib2           # file not on local host (likely Windows only)
+        test_zipfile
+
+        # fails on Windows standalone too, but more embarassing as java specific
+        test_os_jy             # Locale tests run and fail on Cygwin
+        test_subprocess_jy
+        test_sys_jy            # OSError handling wide-character filename
+
+        test_asyncore 
+        test_compileall
+        test_distutils
+        test_email_codecs
+        test_largefile         # [Errno 9] Bad file descriptor
+        test_locale
+        test_profile
+        test_pydoc             # Hangs with prompt (Windows)
+        test_select            # Unconnected client socket should be selectable
+        test_sundry            # ImportError: No module named audiodev
+
+        test_sys_setprofile    # revisit for GC
+        test_sys_settrace      # revisit for line jumping
+
+        # Unreliable tests 
+        test_asynchat
+        test_gc                # Rare failures depending on timing of Java gc
+        test_logging
+        test_select_new
+        test_socket            # flakey (Windows)
+        test_tarfile           # flakey (Windows)
+        test_threading
+        test_urllib2net        # unexpected output makes this a failure to regrtest.py
+
+        # Tests that should work with socket-reboot, but currently fail/hang
+        test_ftplib            # NoSuchElementException ssl
+        test_httplib
+        test_poplib            # 'NoneType' is not iterable
+        test_smtplib
+
         """,
 }
 
@@ -1378,9 +1388,8 @@
 
 for test_module in conditional_support:
     _expectations[_platform] += \
-        skip_conditional_support(test_module,conditional_support[test_module])
+        skip_conditional_support(test_module, conditional_support[test_module])
 
-   
 
 class _ExpectedSkips:
     def __init__(self):
@@ -1494,18 +1503,18 @@
             self.expected = set(self.split_commented(s))
             self.valid = True
 
-def savememo(memo,good,failures,bad,skips,skipped,allran, resource_denieds):
+def savememo(memo, good, failures, bad, skips, skipped, allran, resource_denieds):
     f = open(memo,'w')
     try:
-        for n,l in [('good',good),('bad',bad),('skipped',skipped)]:
+        for n,l in [('good',good), ('bad',bad), ('skipped',skipped)]:
             print >>f,"%s = [" % n
             for x in l:
                 print >>f,"    %r," % x
             print >>f," ]"
         print >>f, count(len(skipped), "test"), "skipped:"
-        countsurprises(skips, skipped, 'skip', 'ran', allran, resource_denieds,f)
+        countsurprises(skips, skipped, 'skip', 'ran', allran, resource_denieds, f)
         print >>f, count(len(bad), "test"), "failed:"
-        countsurprises(failures, bad, 'fail', 'passed', allran, resource_denieds,f)
+        countsurprises(failures, bad, 'fail', 'passed', allran, resource_denieds, f)
         import platform
         print >>f, "Platform: "
         print >>f, "    %r" % platform.platform()
diff --git a/Lib/test/test_chdir.py b/Lib/test/test_chdir.py
--- a/Lib/test/test_chdir.py
+++ b/Lib/test/test_chdir.py
@@ -405,7 +405,7 @@
         mod = sys.modules[mod_name]
         self.assertEqual(mod.__file__, mod_name + COMPILED_SUFFIX)
 
-
+ at unittest.skipIf(test_support.is_jython_nt, "FIXME: failing on Windows: issue 2418")
 class SubprocessTestCase(BaseChdirTestCase):
 
     TEST_DIRS = 2
diff --git a/Lib/test/test_file2k.py b/Lib/test/test_file2k.py
--- a/Lib/test/test_file2k.py
+++ b/Lib/test/test_file2k.py
@@ -11,7 +11,7 @@
     threading = None
 
 from test import test_support
-from test.test_support import TESTFN, run_unittest
+from test.test_support import TESTFN, run_unittest, is_jython, is_jython_nt
 from UserList import UserList
 
 class AutoFileTests(unittest.TestCase):
@@ -711,6 +711,7 @@
         finally:
             sys.stdout = save_stdout
 
+    @unittest.skipIf(is_jython_nt, "FIXME: utf-16 decode error, see issue 2312")
     def test_unicode(self):
         import subprocess
 
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py
--- a/Lib/test/test_glob.py
+++ b/Lib/test/test_glob.py
@@ -3,6 +3,7 @@
 import shutil
 import sys
 import unittest
+import warnings
 
 from test.test_support import run_unittest, TESTFN
 
@@ -40,7 +41,10 @@
             os.symlink(os.path.join('a', 'bcd'), self.norm('sym3'))
 
     def tearDown(self):
-        shutil.rmtree(self.tempdir)
+        try:
+            shutil.rmtree(self.tempdir)
+        except OSError:
+            warnings.warn("Failed to remove " + self.tempdir)
 
     def glob(self, *parts):
         if len(parts) == 1:
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -35,7 +35,8 @@
            "verbose", "use_resources", "max_memuse", "record_original_stdout",
            "get_original_stdout", "unload", "unlink", "rmtree", "forget",
            "is_resource_enabled", "requires", "find_unused_port", "bind_port",
-           "fcmp", "have_unicode", "is_jython", "TESTFN", "HOST", "FUZZ",
+           "fcmp", "have_unicode", "is_jython", "is_jython_nt",
+           "TESTFN", "HOST", "FUZZ",
            "SAVEDCWD", "temp_cwd", "findfile", "sortdict", "check_syntax_error",
            "open_urlresource", "check_warnings", "check_py3k_warnings",
            "CleanImport", "EnvironmentVarGuard", "captured_output",
@@ -47,6 +48,11 @@
            "import_fresh_module", "threading_cleanup", "reap_children",
            "strip_python_stderr"]
 
+
+# We use these extensively in adapting the regression tests for Jython
+is_jython = sys.platform.startswith('java')
+is_jython_nt = is_jython and (os._name == 'nt')
+
 class Error(Exception):
     """Base class for regression test exceptions."""
 
@@ -188,7 +194,7 @@
     except KeyError:
         pass
 
-if sys.platform.startswith("win") or (os.name == "java" and os._name == "nt"):
+if sys.platform.startswith("win") or is_jython_nt:
     def _waitfor(func, pathname, waitall=False):
         # Peform the operation
         func(pathname)
@@ -426,14 +432,13 @@
 except NameError:
     have_unicode = False
 
-is_jython = sys.platform.startswith('java')
 if is_jython:
     def make_jar_classloader(jar):
         import os
         from java.net import URL, URLClassLoader
 
         url = URL('jar:file:%s!/' % jar)
-        if os._name == 'nt':
+        if is_jython_nt:
             # URLJarFiles keep a cached open file handle to the jar even
             # after this ClassLoader is GC'ed, disallowing Windows tests
             # from removing the jar file from disk when finished with it
@@ -447,7 +452,7 @@
         return URLClassLoader([url])
 
 # Filename used for testing
-if os.name == 'java':
+if is_jython:
     # Jython disallows @ in module names
     TESTFN = '$test'
 elif os.name == 'riscos':
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -251,12 +251,14 @@
         self.assert_(vi[3] in ("alpha", "beta", "candidate", "final"))
         self.assert_(isinstance(vi[4], int))
 
+    @unittest.skipIf(test.test_support.is_jython_nt,
+                     "FIXME: fails probably due to issue 2312")
     def test_ioencoding(self):  # from v2.7 test
         import subprocess,os
         env = dict(os.environ)
 
         # Test character: cent sign, encoded as 0x4A (ASCII J) in CP424,
-        # not representable in ASCII.
+        # not representable in ASCII, Unicode U+00a2.
 
         env["PYTHONIOENCODING"] = "cp424"
         p = subprocess.Popen([sys.executable, "-c", 'print unichr(0xa2)'],
diff --git a/Lib/test/test_sys_jy.py b/Lib/test/test_sys_jy.py
--- a/Lib/test/test_sys_jy.py
+++ b/Lib/test/test_sys_jy.py
@@ -7,6 +7,7 @@
 import tempfile
 import unittest
 from test import test_support
+from test.test_support import is_jython, is_jython_nt
 
 class SysTest(unittest.TestCase):
 
@@ -22,7 +23,7 @@
             self.assertEquals(str(e), "leaving now")
 
     def test_tuple_args(self):
-        "Exceptions raised unpacking tuple args have right line number"
+        # Exceptions raised unpacking tuple args have right line number
         def tuple_args( (x,y) ): pass
         try:
             tuple_args( 10 )
@@ -193,6 +194,7 @@
     # Adapted from CPython 2.7 test_sys to exercise setting Jython registry
     # values related to encoding and error policy.
 
+    @unittest.skipIf(is_jython_nt, "FIXME: fails probably due to issue 2312")
     def test_ioencoding(self):  # adapted from CPython v2.7 test_sys
         import subprocess, os
         env = dict(os.environ)
@@ -243,9 +245,8 @@
 
 class SysArgvTest(unittest.TestCase):
 
-    @unittest.skipIf(os._name == "nt", "FIXME should work on Windows")
     def test_unicode_argv(self):
-        """Unicode roundtrips successfully through sys.argv arguments"""
+        # Unicode roundtrips successfully through sys.argv arguments
         zhongwen = u'\u4e2d\u6587'
         with test_support.temp_cwd(name=u"tempcwd-%s" % zhongwen):
             p = subprocess.Popen(
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -6,11 +6,13 @@
 import StringIO
 from hashlib import md5
 import errno
+import warnings
 
 import unittest
 import tarfile
 
 from test import test_support
+from test.test_support import is_jython, is_jython_nt
 
 # Check for our compression modules.
 try:
@@ -295,6 +297,7 @@
         self.assertTrue(self.tar.getmembers()[-1].name == "misc/eof",
                 "could not find all members")
 
+    @unittest.skipIf(is_jython_nt, "FIXME: fails trying to unlink() open file")
     def test_extract_hardlink(self):
         # Test hardlink extraction (e.g. bug #857297).
         with tarfile.open(tarname, errorlevel=1, encoding="iso8859-1") as tar:
@@ -321,12 +324,13 @@
         tar.extractall(TEMPDIR, directories)
         for tarinfo in directories:
             path = os.path.join(TEMPDIR, tarinfo.name)
-            if sys.platform != "win32":
+            if sys.platform != "win32" and not is_jython_nt:
                 # Win32 has no support for fine grained permissions.
                 self.assertEqual(tarinfo.mode & 0777, os.stat(path).st_mode & 0777)
             self.assertEqual(tarinfo.mtime, os.path.getmtime(path))
         tar.close()
 
+    @unittest.skipIf(is_jython_nt, "FIXME: fails trying to unlink() open file")
     def test_init_close_fobj(self):
         # Issue #7341: Close the internal file object in the TarFile
         # constructor in case of an error. For the test we rely on
@@ -834,7 +838,7 @@
         self._test_pathname("foo" + os.sep + os.sep, "foo", dir=True)
 
     def test_abs_pathnames(self):
-        if sys.platform == "win32":
+        if sys.platform == "win32" or is_jython_nt:
             self._test_pathname("C:\\foo", "foo")
         else:
             self._test_pathname("/foo", "foo")
@@ -974,10 +978,11 @@
         self.assertTrue(data.count("\0") == tarfile.RECORDSIZE,
                          "incorrect zero padding")
 
+    @unittest.skipIf(is_jython_nt, "requires posix-like os.umask()")
     def test_file_mode(self):
         # Test for issue #8464: Create files with correct
         # permissions.
-        if sys.platform == "win32" or not hasattr(os, "umask"):
+        if sys.platform == "win32" or is_jython_nt or not hasattr(os, "umask"):
             return
 
         if os.path.exists(tmpname):
@@ -1590,6 +1595,8 @@
 
 
 def test_main():
+    if os.path.exists(TEMPDIR):
+        shutil.rmtree(TEMPDIR)
     os.makedirs(TEMPDIR)
 
     tests = [
@@ -1654,7 +1661,11 @@
         test_support.run_unittest(*tests)
     finally:
         if os.path.exists(TEMPDIR):
-            shutil.rmtree(TEMPDIR)
+            try:
+                shutil.rmtree(TEMPDIR)
+            except OSError:
+                warnings.warn("Failed to remove "+TEMPDIR)
+
 
 if __name__ == "__main__":
     test_main()
diff --git a/build.xml b/build.xml
--- a/build.xml
+++ b/build.xml
@@ -44,7 +44,7 @@
 ---------------------
 See http://wiki.python.org/jython/JythonDeveloperGuide/HowToReleaseJython
 
-        	
+
 An example ant.properties file:
 -------------------------------
 
@@ -137,7 +137,6 @@
         <property name="junit.reports" value="${dist.dir}/testreports" />
         <property name="junit.htmlreports" value="${dist.dir}/test-html-reports" />
 
-
         <!-- classpaths -->
         <path id="main.classpath">
             <pathelement path="${extlibs.dir}/servlet-api-2.5.jar" />
@@ -222,18 +221,20 @@
         <property name="work.dir" value="${basedir}/../full_build/work" />
         <property name="checkout.dir" value="${work.dir}/checkout" />
         <property name="jython.base.dir" value="${checkout.dir}/${hg.code.dir}" />
-    	<!-- set has.repositories.connection to false in ant.properties if you want to skip checkout -->
+        <!-- set has.repositories.connection to false in ant.properties if you want to skip checkout -->
         <property name="has.repositories.connection" value="true" />
         <condition property="do.checkout" value="true">
             <istrue value="${has.repositories.connection}" />
         </condition>
 
     </target>
+
     <target name="full-check" depends="full-preinit, init, dump-env">
         <!-- Require all of the optional jars for a full build -->
         <fail unless="informix.present" message="informix jar not present" />
         <fail unless="oracle.present" message="oracle jar not present" />
     </target>
+
     <target name="dump-env" depends="init">
         <echo>.</echo>
         <echo>Build environment for ${ant.project.name}</echo>
@@ -306,7 +307,6 @@
         </delete>
     </target>
 
-
     <!-- clean checkout.dir if we really checkout -->
     <target name="clean-checkout-dir" if="do.checkout">
         <delete includeemptydirs="true" failonerror="false">
@@ -321,7 +321,7 @@
              the tokens defined in Python.g (and cleans make the build slow) -->
         <antcall target="clean"/>
     </target>
-    
+
     <!-- create output directories -->
     <target name ="prepare-output" depends="init,needed-check,clean-if-antlr-needed">
         <mkdir dir="${compile.dir}" />
@@ -420,7 +420,7 @@
 
 This is a snapshot build.
 It reflects the current development status.
-				
+
 The readme text for the next release will be like:
 
             </replacevalue>
@@ -443,8 +443,7 @@
     <target name="template" depends="checkout, template-init">
         <taskdef name="gentempl" classname="org.python.util.TemplateAntTask"
             classpath="${compile.dir}" />
-        <gentempl srcdir="${templates.dir}" verbose="true"
-		  lazy="${templates.lazy}"/>
+        <gentempl srcdir="${templates.dir}" verbose="true" lazy="${templates.lazy}"/>
     </target>
 
     <target name="antlr_gen" depends="prepare-output" unless="antlr.notneeded">
@@ -460,7 +459,7 @@
             <arg file="${jython.base.dir}/grammar/PythonPartial.g"/>
             <classpath refid="main.classpath"/>
         </java>
-        
+
         <!-- copy the .tokens to /grammar, for usage in ANTLRWorks -->
         <!--
         <copy todir="grammar" preservelastmodified="true">
@@ -469,9 +468,8 @@
             </fileset>
         </copy>
         -->
+    </target>
 
-    </target>
- 
     <target name="compile" depends="init,antlr_gen,brand-version">
         <javac destdir="${compile.dir}"
                target="${jdk.target.version}"
@@ -535,9 +533,9 @@
         <!-- grammar must now be up to date -->
         <property name="antlr.notneeded" value="true" />
 
-	<copy todir="${compile.dir}/META-INF/services">
-	    <fileset dir="${source.dir}/META-INF/services" />
-	</copy>
+        <copy todir="${compile.dir}/META-INF/services">
+            <fileset dir="${source.dir}/META-INF/services" />
+        </copy>
     </target>
 
     <!--
@@ -579,12 +577,12 @@
             <zipfileset src="extlibs/asm-commons-5.0.3.jar"/>
             <zipfileset src="extlibs/asm-util-5.0.3.jar"/>
             <rule pattern="org.objectweb.asm.**" result="org.python.objectweb.asm. at 1"/>
-	    <zipfileset src="extlibs/bcpkix-jdk15on-150.jar" excludes="META-INF/**"/>
-	    <rule pattern="org.bouncycastle.**" result="org.python.bouncycastle. at 1"/>
-	    <zipfileset src="extlibs/bcprov-jdk15on-150.jar" excludes="META-INF/**"/>
-	    <rule pattern="org.bouncycastle.**" result="org.python.bouncycastle. at 1"/>
-	    <zipfileset src="extlibs/commons-compress-1.9.jar"/>
-	    <rule pattern="org.apache.**" result="org.python.apache. at 1"/>
+            <zipfileset src="extlibs/bcpkix-jdk15on-150.jar" excludes="META-INF/**"/>
+            <rule pattern="org.bouncycastle.**" result="org.python.bouncycastle. at 1"/>
+            <zipfileset src="extlibs/bcprov-jdk15on-150.jar" excludes="META-INF/**"/>
+            <rule pattern="org.bouncycastle.**" result="org.python.bouncycastle. at 1"/>
+            <zipfileset src="extlibs/commons-compress-1.9.jar"/>
+            <rule pattern="org.apache.**" result="org.python.apache. at 1"/>
             <zipfileset src="extlibs/guava-18.0.jar"/>
             <rule pattern="com.google.**" result="org.python.google. at 1"/>
             <zipfileset src="extlibs/icu4j-54_1_1.jar"/>
@@ -619,8 +617,8 @@
             <zipfileset src="extlibs/jffi-x86_64-Windows.jar"/>
             <zipfileset src="extlibs/jffi-1.2.7.jar"/>
             <zipfileset src="${extlibs.dir}/jnr-ffi-2.0.4.jar"/>
-	    <zipfileset src="${extlibs.dir}/jnr-netdb-1.1.4.jar"/>
-	    <zipfileset src="${extlibs.dir}/jnr-posix-3.0.17.jar"/>
+            <zipfileset src="${extlibs.dir}/jnr-netdb-1.1.4.jar"/>
+            <zipfileset src="${extlibs.dir}/jnr-posix-3.0.17.jar"/>
             <zipfileset src="${extlibs.dir}/jnr-constants-0.8.8.jar"/>
             <zipfileset src="extlibs/xml-apis-2.11.0.jar" excludes="META-INF/services/*"/>
             <zipfileset src="extlibs/xercesImpl-2.11.0.jar" excludes="META-INF/services/*"/>
@@ -649,9 +647,9 @@
     <target name="jar-standalone" depends="jar-complete">
         <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="extlibs/jarjar-1.4.jar"/>
         <jar destfile="${dist.dir}/${jython.standalone.jar}">
-	  <zipfileset src="${dist.dir}/${jython.deploy.jar}"/>
-	  <fileset dir="${dist.dir}" includes="Lib/**" excludes="Lib/test/**" />
-          <manifest>
+            <zipfileset src="${dist.dir}/${jython.deploy.jar}"/>
+            <fileset dir="${dist.dir}" includes="Lib/**" excludes="Lib/test/**" />
+            <manifest>
                 <attribute name="Main-Class" value="org.python.util.jython" />
                 <attribute name="Built-By" value="${user.name}" />
                 <!-- info section. ATTN: no blanks, no '.' in the names -->
@@ -665,7 +663,7 @@
                     <attribute name="debug" value="${debug}" />
                 </section>
             </manifest>
-	</jar>
+        </jar>
     </target>
 
     <target name="jar" depends="compile,expose">
@@ -713,7 +711,7 @@
         <javadoc sourcepath="${source.dir}" 
                  destdir="${apidoc.dir}"
                  source="${jdk.source.version}"
-		 maxmemory="1024m"
+                 maxmemory="1024m"
                  public="true"
                  breakiterator="yes"
                  packagenames="org.python.core.*, org.python.util.*, org.python.modules.*, com.ziclix.python.sql, com.xhaus.modjy"
@@ -862,8 +860,8 @@
         <echo>copy installer classes to ${dist.dir}</echo>
         <copy todir="${dist.dir}" preservelastmodified="true">
             <fileset dir="${compile.dir}">
-            	<include name="org/python/util/install/**/*.class" />
-            	<include name="org/apache/commons/cli/*.class" />
+                <include name="org/python/util/install/**/*.class" />
+                <include name="org/apache/commons/cli/*.class" />
             </fileset>
         </copy>
         <copy file="${installer.src.dir}/org/apache/LICENSE.txt" tofile="${dist.dir}/LICENSE_Apache.txt" preservelastmodified="true" />
@@ -913,8 +911,11 @@
         </jar>
     </target>
 
-    <target name="test" depends="prepare-test,javatest,launchertest,regrtest,modjytest" description="run all the tests"/>
-    <target name="singlejavatest" depends="compile,expose" description="run a single JUnit test (specify with -Dtest=classname)">
+    <target name="test" depends="prepare-test,javatest,launchertest,regrtest,modjytest"
+        description="run all the tests"/>
+
+    <target name="singlejavatest" depends="compile,expose"
+        description="run a single JUnit test (specify with -Dtest=classname)">
         <junit haltonfailure="true" fork="true">
             <formatter type="brief" usefile="false"/>
             <sysproperty key="python.cachedir.skip" value="true"/>
@@ -925,13 +926,16 @@
             </batchtest>
         </junit>
     </target>
+
     <target name="prepare-test" depends="init">
         <!-- Clean any old test output -->
         <delete dir="${junit.reports}"/>
     </target>
+
     <target name="javatest" depends="javatest-basepath,importest"
             description="run all the JUnit tests">
     </target>
+
     <target name="javatest-basepath" depends="developer-build">
         <mkdir dir="${junit.reports}"/>
         <junit fork="true" printsummary="true">
@@ -952,6 +956,7 @@
             </batchtest>
         </junit>
     </target>
+
     <target name="importest" depends="developer-build" description="run all the JUnit tests that need tests/python in the path.">
         <mkdir dir="${junit.reports}"/>
         <junit fork="true" printsummary="true">
@@ -969,6 +974,7 @@
             </batchtest>
         </junit>
     </target>
+
     <target name="idxtest" depends="developer-build">
         <mkdir dir="${junit.reports}"/>
         <junit fork="true" printsummary="true" showoutput="true">
@@ -990,6 +996,7 @@
             </batchtest>
         </junit>
     </target>
+
     <!-- XXX: how do I share common stuff with "idxtest" target? -->
     <target name="idxtest-debug" depends="developer-build">
         <mkdir dir="${junit.reports}"/>
@@ -1013,40 +1020,79 @@
             </batchtest>
         </junit>
     </target>
+
     <target name="modjytest" depends="developer-build">
         <ant dir="tests/modjy">
             <property name="jython_home" value="${dist.dir}"/>
             <property name="mockrunner_home" value="${extlibs.dir}/mockrunner-0.4.1"/>
         </ant>
     </target>
+
     <target name="launchertest" depends="developer-build" if="os.family.unix">
       <exec executable="${test.shell.dir}/test-jython.sh">
         <arg value="${dist.dir}"/>
       </exec>
     </target>
-    <target name="regrtest" depends="developer-build,regrtest-unix,regrtest-windows" description="run Python tests expected to work on Jython"/>
+
+    <target name="regrtest" depends="developer-build,regrtest-unix,regrtest-windows"
+        description="run Python tests expected to work on Jython"/>
+
     <target name="regrtest-unix" if="os.family.unix">
-      <exec executable="${dist.dir}/bin/jython">
-	<env key="JAVA_OPTS" value="-Duser.language=en -Duser.region=US"/>
-        <arg value="${dist.dir}/Lib/test/regrtest.py"/>
-        <!-- Only run the tests that are expected to work on Jython -->
-        <arg value="--expected"/>
-        <arg value="-j"/>
-        <arg value="${junit.reports}"/>
-        <arg value="--use"/>
-	<arg value="network,subprocess"/>
-      </exec>
+        <exec executable="${dist.dir}/bin/jython">
+            <env key="JAVA_OPTS" value="-Duser.language=en -Duser.region=US"/>
+            <arg value="${dist.dir}/Lib/test/regrtest.py"/>
+            <!-- Only run the tests that are expected to work on Jython -->
+            <arg value="--expected"/>
+            <arg value="-j"/>
+            <arg value="${junit.reports}"/>
+            <arg value="--use"/>
+            <arg value="network,subprocess"/>
+        </exec>
     </target>
+
     <target name="regrtest-windows" if="os.family.windows">
-      <exec executable="${dist.dir}/bin/jython.exe">
-        <arg value="${dist.dir}/Lib/test/regrtest.py"/>
-        <!-- Only run the tests that are expected to work on Jython -->
-        <arg value="--expected"/>
-        <arg value="-j"/>
-        <arg value="${junit.reports}"/>
-        <arg value="--use"/>
-	<arg value="network,subprocess"/>
-      </exec>
+        <exec executable="${dist.dir}/bin/jython.exe">
+            <arg value="${dist.dir}/Lib/test/regrtest.py"/>
+            <!-- Only run the tests that are expected to work on Jython -->
+            <arg value="--expected"/>
+            <arg value="-j"/>
+            <arg value="${junit.reports}"/>
+            <arg value="--use"/>
+            <arg value="network,subprocess"/>
+        </exec>
+    </target>
+
+    <target name="regrtest-file"
+        depends="developer-build,regrtest-unix-file,regrtest-windows-file"
+        description="run Python tests specified in file regr.tests"/>
+
+    <target name="regrtest-unix-file" if="os.family.unix">
+        <exec executable="${dist.dir}/bin/jython">
+            <env key="JAVA_OPTS" value="-Duser.language=en -Duser.region=US"/>
+            <arg value="${dist.dir}/Lib/test/regrtest.py"/>
+            <arg value="--junit-xml"/>
+            <arg value="${junit.reports}"/>
+            <!-- <arg value="-v"/> -->
+            <arg value="--use"/>
+            <arg value="network,subprocess"/>
+            <!-- Only run the tests specified in the named file -->
+            <arg value="--fromfile"/>
+            <arg value="${jython.base.dir}/regr.tests"/>
+        </exec>
+    </target>
+
+    <target name="regrtest-windows-file" if="os.family.windows">
+        <exec executable="${dist.dir}/bin/jython.exe">
+            <arg value="${dist.dir}/Lib/test/regrtest.py"/>
+            <arg value="--junit-xml"/>
+            <arg value="${junit.reports}"/>
+            <!-- <arg value="-v"/> -->
+            <arg value="--use"/>
+            <arg value="network,subprocess"/>
+            <!-- Only run the tests specified in the named file -->
+            <arg value="--fromfile"/>
+            <arg value="${jython.base.dir}/regr.tests"/>
+        </exec>
     </target>
 
     <target name="regrtest-html-report" depends="init" description="generates HTML output out of regrtest JUnit XML">
@@ -1061,29 +1107,30 @@
 
     <!-- run bugtests, create a config if necessary -->
     <target name="bugtest" depends="create-bugtest-config">
-         <java classname="org.python.util.jython" fork="true" dir="${bugtests.dir}">
+        <java classname="org.python.util.jython" fork="true" dir="${bugtests.dir}">
             <classpath>
                 <pathelement location="${dist.dir}/${jython.dev.jar}"/>
                 <fileset dir="${dist.dir}/javalib"/>
             </classpath>
             <jvmarg value="-Dpython.home=${dist.dir}"/>
             <arg value="driver.py"/>
-         	<!-- uncomment if you want to run only one test: -->
-         	<!--
-         	<arg value="386"/>
-         	-->
+            <!-- uncomment if you want to run only one test: -->
+            <!--
+            <arg value="386"/>
+            -->
         </java>
     </target>
 
     <!-- create support_config.py in the bugtset directory only if it doesn't already exist -->
-    <target name="create-bugtest-config" depends="init, check-bugtest-config" unless="have_bugtest_config">
+    <target name="create-bugtest-config" depends="init, check-bugtest-config"
+        unless="have_bugtest_config">
         <!-- doesn't seem to be a direct way to get at the path to javac,
         java.home points to the jre folder. The following assumes a standard
         jdk layout. Alternative is to try something like:
 
             <property environment="env"/>
             <property name="jdk.home" value="${env.JAVA_HOME}" />
-  
+
         or set jdk.home explicitly
         -->
         <echo>creating ${bugtests.dir}/support_config.py</echo>

-- 
Repository URL: https://hg.python.org/jython


More information about the Jython-checkins mailing list