[Zope3-checkins] SVN: Zope3/trunk/ Integrated new test runner.
Jim Fulton
jim at zope.com
Mon Oct 31 14:08:32 EST 2005
Log message for revision 39778:
Integrated new test runner.
Changed:
U Zope3/trunk/test.py
U Zope3/trunk/zopeskel/bin/test.in
-=-
Modified: Zope3/trunk/test.py
===================================================================
--- Zope3/trunk/test.py 2005-10-31 19:08:20 UTC (rev 39777)
+++ Zope3/trunk/test.py 2005-10-31 19:08:32 UTC (rev 39778)
@@ -18,14 +18,17 @@
"""
import sys, os
-here = os.path.dirname(os.path.realpath(__file__))
-sys.path.insert(0, os.path.join(here, 'src'))
+here = os.path.abspath(os.path.dirname(sys.argv[0]))
-# remove the current directory from the path, otherwise if we try to
-# import the standard library package "test", we get this file instead
-sys.path[:] = [p for p in sys.path if p != here]
+# Remove this directory from path:
+sys.path[:] = [p for p in sys.path if os.path.abspath(p) != here]
-import zope.app.testing.test
+# add src to path
+src = os.path.join(here, 'src')
+sys.path.insert(0, src) # put at beginning to avoid one in site_packages
-if __name__ == '__main__':
- zope.app.testing.test.process_args()
+from zope.testing import testrunner
+
+defaults = ['--tests-pattern', '^f?tests$', '--test-path', src]
+
+sys.exit(testrunner.run(defaults))
Modified: Zope3/trunk/zopeskel/bin/test.in
===================================================================
--- Zope3/trunk/zopeskel/bin/test.in 2005-10-31 19:08:20 UTC (rev 39777)
+++ Zope3/trunk/zopeskel/bin/test.in 2005-10-31 19:08:32 UTC (rev 39778)
@@ -27,32 +27,14 @@
sys.path[:0] = [instance_lib, SOFTWARE_HOME]
+from zope.testing import testrunner
-from zope.app.tests import test
+defaults = ['--tests-pattern', '^f?tests$']
-
-testzope = "--testzope" in sys.argv[1:]
-if testzope:
+if "--testzope" in sys.argv[1:]:
sys.argv.remove("--testzope")
- test_lib = SOFTWARE_HOME
+ defaults += ['--test-path', SOFTWARE_HOME]
else:
- test_lib = instance_lib
+ defaults += ['--test-path', instance_lib]
-ftesting = os.path.join(here, "etc", "ftesting.zcml")
-
-test.FTESTING = ftesting
-
-args = sys.argv[:1] + ["-l", test_lib] + sys.argv[1:]
-test.__doc__ += """
-
-One additional option is supported:
-
---testzope
- When specified, the tests for the installed Zope software are run
- instead of the tests for the software installed in the instance.
- This is useful to determine the effects of additional software
- installation and configuration changes on the base Zope software.
- Unlike other options, this cannot be abbreviated.
-
-"""
-test.process_args(args)
+sys.exit(testrunner.run(defaults))
More information about the Zope3-Checkins
mailing list