Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
17065825
Commit
17065825
authored
Oct 02, 2005
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collector #1895: omit 'var' folder from recursive traversal causing trouble
with DirectoryStorage
parent
a5fa5771
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
3 deletions
+56
-3
test.py
test.py
+56
-3
No files found.
test.py
View file @
17065825
#!/
usr/bin/env python2.3
#!/
home/fermigier/bin/python
##############################################################################
##############################################################################
#
#
...
@@ -121,6 +121,26 @@ named .testinfo, it will not be searched for tests. Really.)
...
@@ -121,6 +121,26 @@ named .testinfo, it will not be searched for tests. Really.)
utility writes coverage files to a directory named `coverage' that
utility writes coverage files to a directory named `coverage' that
is parallel to `build'. It also prints a summary to stdout.
is parallel to `build'. It also prints a summary to stdout.
--coverage
Use the coverage.py module from Gareth Rees
(http://www.nedbatchelder.com/code/modules/coverage.html) to collect data
for code coverage. This will output trace data in a file called
'.coverage'. You will need to call coverage.py after the test run to
analyse the data (-r for a line count report, -a for annotated file).
--profile
Use the profile module from the standard library to collect profiling data.
This will output data in a file called '.profile'. You will need to use the
pstats module from the standard library after the test run to analyse the
data.
--hotshot
Use the hotshot module from the standard library to collect profiling data.
This will output data in a file called '.hotshot'. You will need to use the
hotshot.pstats module from the standard library after the test run to
analyse the data. You may also use the hotshot2cg script from the
KCacheGrind sources to create data suitable for analysis by KCacheGrind.
-v
-v
Verbose output. With one -v, unittest prints a dot (".") for each
Verbose output. With one -v, unittest prints a dot (".") for each
test run. With -vv, unittest prints the name of each test (for
test run. With -vv, unittest prints the name of each test (for
...
@@ -619,7 +639,7 @@ def walk_with_symlinks(path, visit, arg):
...
@@ -619,7 +639,7 @@ def walk_with_symlinks(path, visit, arg):
except
os
.
error
:
except
os
.
error
:
return
return
visit
(
arg
,
path
,
names
)
visit
(
arg
,
path
,
names
)
exceptions
=
(
os
.
curdir
,
os
.
pardir
)
exceptions
=
(
os
.
curdir
,
os
.
pardir
,
'var'
)
for
name
in
names
:
for
name
in
names
:
if
name
not
in
exceptions
:
if
name
not
in
exceptions
:
name
=
os
.
path
.
join
(
path
,
name
)
name
=
os
.
path
.
join
(
path
,
name
)
...
@@ -749,6 +769,9 @@ def process_args(argv=None):
...
@@ -749,6 +769,9 @@ def process_args(argv=None):
LOOP
=
False
LOOP
=
False
GUI
=
False
GUI
=
False
TRACE
=
False
TRACE
=
False
COVERAGE
=
False
PROFILE
=
False
HOTSHOT
=
False
REFCOUNT
=
False
REFCOUNT
=
False
debug
=
False
# Don't collect test results; simply let tests crash
debug
=
False
# Don't collect test results; simply let tests crash
debugger
=
False
debugger
=
False
...
@@ -771,7 +794,8 @@ def process_args(argv=None):
...
@@ -771,7 +794,8 @@ def process_args(argv=None):
opts
,
args
=
getopt
.
getopt
(
argv
[
1
:],
"a:bcC:dDfg:G:hLmprtTuv"
,
opts
,
args
=
getopt
.
getopt
(
argv
[
1
:],
"a:bcC:dDfg:G:hLmprtTuv"
,
[
"all"
,
"help"
,
"libdir="
,
"times="
,
[
"all"
,
"help"
,
"libdir="
,
"times="
,
"keepbytecode"
,
"dir="
,
"keepbytecode"
,
"dir="
,
"config-file="
,
"import-testing"
])
"config-file="
,
"import-testing"
,
"coverage"
,
"profile"
,
"hotshot"
])
except
getopt
.
error
,
msg
:
except
getopt
.
error
,
msg
:
print
msg
print
msg
print
"Try `python %s -h' for more information."
%
argv
[
0
]
print
"Try `python %s -h' for more information."
%
argv
[
0
]
...
@@ -823,6 +847,12 @@ def process_args(argv=None):
...
@@ -823,6 +847,12 @@ def process_args(argv=None):
print
"-r ignored, because it needs a debug build of Python"
print
"-r ignored, because it needs a debug build of Python"
elif
k
==
"-T"
:
elif
k
==
"-T"
:
TRACE
=
True
TRACE
=
True
elif
k
==
"--coverage"
:
COVERAGE
=
True
elif
k
==
"--profile"
:
PROFILE
=
True
elif
k
==
"--hotshot"
:
HOTSHOT
=
True
elif
k
==
"-t"
:
elif
k
==
"-t"
:
if
not
timetests
:
if
not
timetests
:
timetests
=
50
timetests
=
50
...
@@ -903,6 +933,29 @@ def process_args(argv=None):
...
@@ -903,6 +933,29 @@ def process_args(argv=None):
globals
=
globals
(),
locals
=
vars
())
globals
=
globals
(),
locals
=
vars
())
r
=
tracer
.
results
()
r
=
tracer
.
results
()
r
.
write_results
(
show_missing
=
True
,
summary
=
True
,
coverdir
=
coverdir
)
r
.
write_results
(
show_missing
=
True
,
summary
=
True
,
coverdir
=
coverdir
)
elif
COVERAGE
:
try
:
from
coverage
import
the_coverage
except
:
print
"You need to install coverage.py from "
print
"http://www.nedbatchelder.com/code/modules/coverage.html"
sys
.
exit
()
the_coverage
.
start
()
main
(
module_filter
,
test_filter
,
libdir
)
elif
PROFILE
:
import
profile
profile
.
runctx
(
"main(module_filter, test_filter, libdir)"
,
globals
=
globals
(),
locals
=
vars
(),
filename
=
".profile"
)
elif
HOTSHOT
:
import
hotshot
profile
=
hotshot
.
Profile
(
".hotshot"
)
profile
.
runctx
(
"main(module_filter, test_filter, libdir)"
,
globals
=
globals
(),
locals
=
vars
())
else
:
else
:
bad
=
main
(
module_filter
,
test_filter
,
libdir
)
bad
=
main
(
module_filter
,
test_filter
,
libdir
)
if
bad
:
if
bad
:
...
...
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