Skip to content
Browse files

readme typo & add buildout for test & test coverage

svn path=/collective.monkeypatcher/trunk/; revision=84485
  • Loading branch information...
1 parent dcd5357 commit 536f9d510615f29f13cf91475174eedd92260d08 Jean-Francois Roche committed Apr 17, 2009
Showing with 116 additions and 1 deletion.
  1. +1 −1 README.txt
  2. +55 −0 bootstrap.py
  3. +60 −0 buildout.cfg
View
2 README.txt
@@ -22,7 +22,7 @@ Here's an example::
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:monkey="http://namespaces.plone.org/monkey"
- i18n_domain="collective.rooter">
+ i18n_domain="collective.monkeypatcher">
<include package="collective.monkeypatcher" file="meta.zcml" />
View
55 bootstrap.py
@@ -0,0 +1,55 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (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.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id$
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+try:
+ import pkg_resources
+except ImportError:
+ ez = {}
+ exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+ ).read() in ez
+ ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+ import pkg_resources
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+if sys.platform == 'win32':
+ cmd = '"%s"' % cmd # work around spawn lamosity on windows
+
+ws = pkg_resources.working_set
+assert os.spawnle(
+ os.P_WAIT, sys.executable, sys.executable,
+ '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)
View
60 buildout.cfg
@@ -0,0 +1,60 @@
+[buildout]
+parts =
+ zope2
+ instance
+ zopepy
+ test
+ coverage-test
+ coverage-report
+
+eggs =
+extends = http://dist.plone.org/release/3.2.1/versions.cfg
+develop = .
+
+[zope2]
+recipe = plone.recipe.zope2install
+url = http://www.zope.org/Products/Zope/2.11.2/Zope-2.11.2-final.tgz
+
+[instance]
+recipe = plone.recipe.zope2instance
+zope2-location = ${zope2:location}
+debug-mode = on
+verbose-security = on
+user = admin:admin
+http-address = 0.0.0.0:8080
+eggs =
+ ${buildout:eggs}
+ collective.monkeypatcher
+ elementtree
+zcml =
+ collective.monkeypatcher
+
+[zopepy]
+recipe = zc.recipe.egg
+eggs = ${instance:eggs}
+interpreter = zopepy
+extra-paths = ${zope2:location}/lib/python
+scripts = zopepy
+
+[test]
+recipe = collective.recipe.z2testrunner
+zope2part = instance
+packages =
+ collective.monkeypatcher
+extra-paths = ${buildout:directory}
+defaults = -cvvvv
+exit-with-status = true
+
+[coverage-test]
+recipe = collective.recipe.z2testrunner
+zope2part = instance
+packages =
+ collective.monkeypatcher
+extra-paths = ${buildout:directory}
+defaults = --coverage=./coverage
+
+[coverage-report]
+recipe = zc.recipe.egg
+eggs = z3c.coverage
+scripts = coverage=coverage-report
+arguments = ('coverage', 'coverage/report')

0 comments on commit 536f9d5

Please sign in to comment.
Something went wrong with that request. Please try again.