Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.buildout
Commits
01747fd6
Commit
01747fd6
authored
Oct 24, 2006
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a working-directory option.
parent
d9799304
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
4 deletions
+67
-4
zc.recipe.testrunner/CHANGES.txt
zc.recipe.testrunner/CHANGES.txt
+10
-0
zc.recipe.testrunner/setup.py
zc.recipe.testrunner/setup.py
+3
-2
zc.recipe.testrunner/src/zc/recipe/testrunner/README.txt
zc.recipe.testrunner/src/zc/recipe/testrunner/README.txt
+47
-2
zc.recipe.testrunner/src/zc/recipe/testrunner/__init__.py
zc.recipe.testrunner/src/zc/recipe/testrunner/__init__.py
+7
-0
No files found.
zc.recipe.testrunner/CHANGES.txt
View file @
01747fd6
...
@@ -2,6 +2,16 @@
...
@@ -2,6 +2,16 @@
Change History
Change History
**************
**************
1.0.0b4 (2006-10-24)
====================
Feature Changes
---------------
- Added a working-directoy option to specify a working directory for
the generated script.
1.0.0b3 (2006-10-16)
1.0.0b3 (2006-10-16)
====================
====================
...
...
zc.recipe.testrunner/setup.py
View file @
01747fd6
...
@@ -7,7 +7,7 @@ def read(*rnames):
...
@@ -7,7 +7,7 @@ def read(*rnames):
name
=
"zc.recipe.testrunner"
name
=
"zc.recipe.testrunner"
setup
(
setup
(
name
=
name
,
name
=
name
,
version
=
"1.0.0b
3
"
,
version
=
"1.0.0b
4
"
,
author
=
"Jim Fulton"
,
author
=
"Jim Fulton"
,
author_email
=
"jim@zope.com"
,
author_email
=
"jim@zope.com"
,
description
=
"ZC Buildout recipe for creating test runners"
,
description
=
"ZC Buildout recipe for creating test runners"
,
...
@@ -32,7 +32,8 @@ setup(
...
@@ -32,7 +32,8 @@ setup(
include_package_data
=
True
,
include_package_data
=
True
,
package_dir
=
{
''
:
'src'
},
package_dir
=
{
''
:
'src'
},
namespace_packages
=
[
'zc'
,
'zc.recipe'
],
namespace_packages
=
[
'zc'
,
'zc.recipe'
],
install_requires
=
[
'zc.buildout >=1.0.0b7'
,
'zope.testing'
,
'setuptools'
,
install_requires
=
[
'zc.buildout >=1.0.0b12'
,
'zope.testing'
,
'setuptools'
,
'zc.recipe.egg >=1.0.0a3'
,
'zc.recipe.egg >=1.0.0a3'
,
],
],
test_suite
=
name
+
'.tests.test_suite'
,
test_suite
=
name
+
'.tests.test_suite'
,
...
...
zc.recipe.testrunner/src/zc/recipe/testrunner/README.txt
View file @
01747fd6
...
@@ -4,7 +4,7 @@ Test-Runner Recipe
...
@@ -4,7 +4,7 @@ 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 test-runner recipe has
3
options:
The test-runner recipe has
several
options:
eggs
eggs
The eggs option specified a list of eggs to test given as one ore
The eggs option specified a list of eggs to test given as one ore
...
@@ -20,11 +20,15 @@ extra-paths
...
@@ -20,11 +20,15 @@ extra-paths
One or more extra paths to include in the generated test script.
One or more extra paths to include in the generated test script.
defaults
defaults
The defaults option lets you specify testrunner default
The defaults option lets you specify testrunner default
options. These are specified as Python source for an expression
options. These are specified as Python source for an expression
yielding a list, typically a list literal.
yielding a list, typically a list literal.
working-directory
The working-directory option lets to specify a directory where the
tests will run. The testrunner will change to this directory whe
run.
(Note that, at this time, due to limitations in the Zope test runner,
(Note that, at this time, due to limitations in the Zope test runner,
the distributions cannot be zip files. TODO: Fix the test runner!)
the distributions cannot be zip files. TODO: Fix the test runner!)
...
@@ -216,6 +220,47 @@ extra-paths option to specify them:
...
@@ -216,6 +220,47 @@ extra-paths option to specify them:
'--test-path', '/sample-buildout/demo',
'--test-path', '/sample-buildout/demo',
])
])
We can use the working-directory option to specify an working
directory:
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... develop = demo
... parts = testdemo
... offline = true
...
... [testdemo]
... recipe = zc.recipe.testrunner
... eggs = demo
... extra-paths = /usr/local/zope/lib/python
... working-directory = /foo/bar
... """)
>>> print system(os.path.join(sample_buildout, 'bin', 'buildout') + ' -q'),
>>> cat(sample_buildout, 'bin', 'testdemo')
#!/usr/local/bin/python2.4
<BLANKLINE>
import sys
sys.path[0:0] = [
'/sample-buildout/demo',
'/sample-buildout/eggs/zope.testing-3.0-py2.3.egg',
'/sample-buildout/eggs/setuptools-0.6-py1.3.egg',
'/usr/local/zope/lib/python',
]
<BLANKLINE>
import os
os.chdir('/foo/bar')
<BLANKLINE>
import zope.testing.testrunner
<BLANKLINE>
if __name__ == '__main__':
zope.testing.testrunner.run([
'--test-path', '/sample-buildout/demo',
])
If we need to specify default options, we can use the defaults
If we need to specify default options, we can use the defaults
option. For example, Zope 3 applications typically define test suites
option. For example, Zope 3 applications typically define test suites
in modules named ftests or tests. The default test runner behaviour
in modules named ftests or tests. The default test runner behaviour
...
...
zc.recipe.testrunner/src/zc/recipe/testrunner/__init__.py
View file @
01747fd6
...
@@ -43,6 +43,12 @@ class TestRunner:
...
@@ -43,6 +43,12 @@ class TestRunner:
if
defaults
:
if
defaults
:
defaults
=
'(%s) + '
%
defaults
defaults
=
'(%s) + '
%
defaults
wd
=
options
.
get
(
'working-directory'
,
''
)
if
wd
:
initialization
=
"import os
\
n
os.chdir(%r)"
%
wd
else
:
initialization
=
''
return
zc
.
buildout
.
easy_install
.
scripts
(
return
zc
.
buildout
.
easy_install
.
scripts
(
[(
options
[
'script'
],
'zope.testing.testrunner'
,
'run'
)],
[(
options
[
'script'
],
'zope.testing.testrunner'
,
'run'
)],
ws
,
options
[
'executable'
],
ws
,
options
[
'executable'
],
...
@@ -52,6 +58,7 @@ class TestRunner:
...
@@ -52,6 +58,7 @@ class TestRunner:
TESTPATH
=
repr
(
test_paths
)[
1
:
-
1
].
replace
(
TESTPATH
=
repr
(
test_paths
)[
1
:
-
1
].
replace
(
', '
,
",
\
n
'--test-path', "
),
', '
,
",
\
n
'--test-path', "
),
)),
)),
initialization
=
initialization
,
)
)
update
=
install
update
=
install
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment