[Zope3-checkins] SVN: Zope3/trunk/ Add support for running the tests from a built distribution, an installed

Fred L. Drake, Jr. fred at zope.com
Tue May 18 12:35:37 EDT 2004


Log message for revision 24807:
Add support for running the tests from a built distribution, an installed
software home, and an instance.



-=-
Modified: Zope3/trunk/releases/ZopeX3/PACKAGE.cfg
===================================================================
--- Zope3/trunk/releases/ZopeX3/PACKAGE.cfg	2004-05-18 15:44:36 UTC (rev 24806)
+++ Zope3/trunk/releases/ZopeX3/PACKAGE.cfg	2004-05-18 16:35:36 UTC (rev 24807)
@@ -1,7 +1,5 @@
 <load>
   LICENSES.txt          svn://svn.zope.org/repos/main/Zope3/tags/*/LICENSES.txt
-  test.py               svn://svn.zope.org/repos/main/Zope3/tags/*/test.py
-  log.ini               svn://svn.zope.org/repos/main/Zope3/tags/*/log.ini
   ZopePublicLicense.txt svn://svn.zope.org/repos/main/Zope3/tags/*/ZopePublicLicense.txt
   bin/mkzopeinstance    svn://svn.zope.org/repos/main/Zope3/tags/*/bin/mkzopeinstance
   doc                   svn://svn.zope.org/repos/main/Zope3/tags/*/doc/
@@ -12,5 +10,4 @@
   LICENSES.txt
   ZopePublicLicense.txt
   test.py
-  log.ini
 </distribution>

Modified: Zope3/trunk/releases/ZopeX3/SETUP.cfg
===================================================================
--- Zope3/trunk/releases/ZopeX3/SETUP.cfg	2004-05-18 15:44:36 UTC (rev 24806)
+++ Zope3/trunk/releases/ZopeX3/SETUP.cfg	2004-05-18 16:35:36 UTC (rev 24807)
@@ -3,9 +3,8 @@
 documentation doc/*.txt
 
 script        bin/*
+script        zopetest
 
 <data-files .>
-  test.py
-  log.ini
   skel
 </data-files>

Added: Zope3/trunk/releases/ZopeX3/test.py
===================================================================
--- Zope3/trunk/releases/ZopeX3/test.py	2004-05-18 15:44:36 UTC (rev 24806)
+++ Zope3/trunk/releases/ZopeX3/test.py	2004-05-18 16:35:36 UTC (rev 24807)
@@ -0,0 +1,36 @@
+#!/bin/env python2.3
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Test script for running unit tests in a distribution root.
+
+The functional tests can't be run since we don't have enough of the
+package configuration in a usable state.  The functional tests can be
+run from an installation.
+
+$Id$
+"""
+import sys, os
+from distutils.util import get_platform
+
+PLAT_SPEC = "%s-%s" % (get_platform(), sys.version[0:3])
+
+here = os.path.dirname(os.path.realpath(__file__))
+lib = os.path.join(here, "build", "lib." + PLAT_SPEC)
+sys.path.append(lib)
+
+import zope.testing.test
+
+if __name__ == '__main__':
+    args = sys.argv[:1] + ["-ul", lib] + sys.argv[1:]
+    zope.testing.test.process_args(args)


Property changes on: Zope3/trunk/releases/ZopeX3/test.py
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/x-python
Name: svn:eol-style
   + native

Added: Zope3/trunk/releases/ZopeX3/zopetest
===================================================================
--- Zope3/trunk/releases/ZopeX3/zopetest	2004-05-18 15:44:36 UTC (rev 24806)
+++ Zope3/trunk/releases/ZopeX3/zopetest	2004-05-18 16:35:36 UTC (rev 24807)
@@ -0,0 +1,35 @@
+#!/bin/env python2.3
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Test script to run the unit and functional tests in a Zope installation.
+
+$Id$
+"""
+import sys, os
+
+here = os.path.dirname(os.path.realpath(__file__))
+here = os.path.dirname(here)
+lib = os.path.join(here, "lib", "python")
+print lib
+sys.path.append(lib)
+
+ftesting = os.path.join(here, "skel", "etc", "ftesting.zcml")
+
+import zope.testing.test
+
+zope.testing.test.FTESTING = ftesting
+
+if __name__ == '__main__':
+    args = sys.argv[:1] + ["-l", lib] + sys.argv[1:]
+    zope.testing.test.process_args(args)


Property changes on: Zope3/trunk/releases/ZopeX3/zopetest
___________________________________________________________________
Name: svn:executable
   + *

Added: Zope3/trunk/skel/bin/test.in
===================================================================
--- Zope3/trunk/skel/bin/test.in	2004-05-18 15:44:36 UTC (rev 24806)
+++ Zope3/trunk/skel/bin/test.in	2004-05-18 16:35:36 UTC (rev 24807)
@@ -0,0 +1,58 @@
+#!/bin/env python2.3
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Run tests in a Zope instance home.
+
+$Id$
+"""
+import sys, os
+
+here = os.path.dirname(os.path.realpath(__file__))
+here = os.path.dirname(here)
+
+SOFTWARE_HOME = "<<SOFTWARE_HOME>>"
+
+instance_lib = os.path.join(here, "lib", "python")
+
+sys.path[:0] = [instance_lib, SOFTWARE_HOME]
+
+
+from zope.testing import test
+
+
+testzope = "--testzope" in sys.argv[1:]
+if testzope:
+    sys.argv.remove("--testzope")
+    test_lib = SOFTWARE_HOME
+else:
+    test_lib = 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)


Property changes on: Zope3/trunk/skel/bin/test.in
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:eol-style
   + native

Copied: Zope3/trunk/skel/etc/ftesting.zcml (from rev 24803, Zope3/trunk/ftesting.zcml)

Added: Zope3/trunk/skel/etc/overrides_ftesting.zcml
===================================================================
--- Zope3/trunk/skel/etc/overrides_ftesting.zcml	2004-05-18 15:44:36 UTC (rev 24806)
+++ Zope3/trunk/skel/etc/overrides_ftesting.zcml	2004-05-18 16:35:36 UTC (rev 24807)
@@ -0,0 +1,13 @@
+<configure xmlns="http://namespaces.zope.org/zope">
+
+  <!-- Here you can include overrides directives for-->
+  <!-- functional testing, may your products need so. -->
+
+  <!-- For example, you may want to include overrides.zcml on -->
+  <!-- functional tests to make sure that the system will-->
+  <!-- behave as expected in the presence of overrides.-->
+  <!-- Example:
+       <includeOverrides file="overrides.zcml" />
+  -->
+
+</configure>
\ No newline at end of file


Property changes on: Zope3/trunk/skel/etc/overrides_ftesting.zcml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Modified: Zope3/trunk/src/zope/testing/test.py
===================================================================
--- Zope3/trunk/src/zope/testing/test.py	2004-05-18 15:44:36 UTC (rev 24806)
+++ Zope3/trunk/src/zope/testing/test.py	2004-05-18 16:35:36 UTC (rev 24807)
@@ -248,6 +248,8 @@
 import unittest
 import warnings
 
+FTESTING = "ftesting.zcml"
+
 def set_trace_doctest(stdin=sys.stdin, stdout=sys.stdout, trace=pdb.set_trace):
     sys.stdin = stdin
     sys.stdout = stdout
@@ -488,11 +490,11 @@
             print "Running %s tests from %s" % (kind, self.cwd)
         # Make sure functional tests find ftesting.zcml
         if functional:
-            config_file = 'ftesting.zcml'
+            config_file = FTESTING
             if not self.inplace:
                 # We chdired into build, so ftesting.zcml is in the
                 # parent directory
-                config_file = os.path.join('..', 'ftesting.zcml')
+                config_file = os.path.join('..', FTESTING)
             print "Parsing %s" % config_file
             from zope.app.tests.functional import FunctionalTestSetup
             FunctionalTestSetup(config_file)




More information about the Zope3-Checkins mailing list