Commit f4f91db4 authored by Jim Fulton's avatar Jim Fulton

Renamed distribution option to eggs.

parent 3331bde6
Recipe for generating a custom test runner. Test-Runner Recipe
==================
This recipe generates zope.testing test-runenr scripts for testing a
collection of eggs. The eggs must already be installed (using the
zc.recipe.egg recipe)
The test-runner recipe has 2 options:
- The eggs option takes the names of the eggs to be
tested. These are not installed by the recipe. They must be
installed by some other recipe (or using the buildout develop
option). The distributions are in the form os setuptools
requirements. Multiple distributions must be listed on separate
lines. This option is required.
- The script option gives the name of the script to generate, in the
buildout bin directory. Of the option isn't used, the part name
will be used.
To do
-----
- Don't require eggs to be installed by the egg recipe. Go ahead
and try to install them.
- Let the egg recipe do more of the heavy lifting internally.
- Support specifying testrunner defaults (e.g. verbosity, test file
patterns, etc.)
...@@ -4,16 +4,16 @@ Test-Runner Recipe ...@@ -4,16 +4,16 @@ Test-Runner Recipe
The test-runner recipe, zc.recipe.testrunner, creates a test runner The test-runner recipe, zc.recipe.testrunner, creates a test runner
for a project. for a project.
The rest-runner recipe has 2 options: The test-runner recipe has 2 options:
- The distributions option takes the names of the distributions to be
tested. These are not installed by the recipe. They must be
installed by some other recipe (or using the buildout develop
option). The distributions are in the form os setuptools
requirements. Multiple distributions must be listed on separate
lines. This option is required.
- The script option gives the name of the script to generate, in the eggs
The eggs option specified a list of eggs to test given as one ore
more setuptools requirement strings. Each string must be given on
a separate line.
script
The script option gives the name of the script to generate, in the
buildout bin directory. Of the option isn't used, the part name buildout bin directory. Of the option isn't used, the part name
will be used. will be used.
...@@ -109,14 +109,14 @@ develop egg and to create the test script: ...@@ -109,14 +109,14 @@ develop egg and to create the test script:
... ...
... [testdemo] ... [testdemo]
... recipe = zc.recipe.testrunner ... recipe = zc.recipe.testrunner
... distributions = ... eggs =
... demo ... demo
... demo2 ... demo2
... script = test ... script = test
... """) ... """)
Note that we specified both demo and demo2 in the distributions Note that we specified both demo and demo2 in the eggs
section and that we put them on separate lines. option and that we put them on separate lines.
We also specified the offline option to run the buildout in offline mode. We also specified the offline option to run the buildout in offline mode.
...@@ -143,7 +143,7 @@ We can run the test script to run our demo test: ...@@ -143,7 +143,7 @@ We can run the test script to run our demo test:
Ran 2 tests with 0 failures and 0 errors in 0.000 seconds. Ran 2 tests with 0 failures and 0 errors in 0.000 seconds.
Note that we didn't run the demoneeded tests. Tests are only run for Note that we didn't run the demoneeded tests. Tests are only run for
the distributions listed, not for their dependencies. the eggs listed, not for their dependencies.
If we leave the script option out of the configuration, then the test If we leave the script option out of the configuration, then the test
script will get it's name from the part: script will get it's name from the part:
...@@ -157,7 +157,7 @@ script will get it's name from the part: ...@@ -157,7 +157,7 @@ script will get it's name from the part:
... ...
... [testdemo] ... [testdemo]
... recipe = zc.recipe.testrunner ... recipe = zc.recipe.testrunner
... distributions = demo ... eggs = demo
... """) ... """)
>>> print system(os.path.join(sample_buildout, 'bin', 'buildout')), >>> print system(os.path.join(sample_buildout, 'bin', 'buildout')),
......
...@@ -38,7 +38,7 @@ class TestRunner: ...@@ -38,7 +38,7 @@ class TestRunner:
def install(self): def install(self):
options = self.options options = self.options
requirements = [r.strip() requirements = [r.strip()
for r in options['distributions'].split('\n') for r in options['eggs'].split('\n')
if r.strip()] if r.strip()]
ws = zc.buildout.easy_install.working_set( ws = zc.buildout.easy_install.working_set(
requirements+['zope.testing'], requirements+['zope.testing'],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment