Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d569f23d
Commit
d569f23d
authored
Sep 22, 2000
by
Neil Schemenauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Replace debugleak flag with findleaks flag. The new SAVEALL GC option is
used to find cyclic garbage produced by tests.
parent
faae266e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
Lib/test/regrtest.py
Lib/test/regrtest.py
+14
-6
No files found.
Lib/test/regrtest.py
View file @
d569f23d
...
...
@@ -14,7 +14,7 @@ Command line options:
-x: exclude -- arguments are tests to *exclude*
-s: single -- run only a single test (see below)
-r: random -- randomize test execution order
-l:
leakdebug -- if cycle garbage collection is enabled, run with DEBUG_LEAK
-l:
findleaks -- if GC is available detect and print cyclic garbage
--have-resources -- run tests that require large resources (time/space)
If non-option arguments are present, they are names for tests to run,
...
...
@@ -41,7 +41,7 @@ import random
import
test_support
def
main
(
tests
=
None
,
testdir
=
None
,
verbose
=
0
,
quiet
=
0
,
generate
=
0
,
exclude
=
0
,
single
=
0
,
randomize
=
0
,
leakdebug
=
0
,
exclude
=
0
,
single
=
0
,
randomize
=
0
,
findleaks
=
0
,
use_large_resources
=
0
):
"""Execute a test suite.
...
...
@@ -60,7 +60,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0,
files beginning with test_ will be used.
The other seven default arguments (verbose, quiet, generate, exclude,
single, randomize, and
leakdebug
) allow programmers calling main()
single, randomize, and
findleaks
) allow programmers calling main()
directly to set the values that would normally be set by flags on the
command line.
...
...
@@ -79,7 +79,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0,
if
o
==
'-x'
:
exclude
=
1
if
o
==
'-s'
:
single
=
1
if
o
==
'-r'
:
randomize
=
1
if
o
==
'-l'
:
leakdebug
=
1
if
o
==
'-l'
:
findleaks
=
1
if
o
==
'--have-resources'
:
use_large_resources
=
1
if
generate
and
verbose
:
print
"-g and -v don't go together!"
...
...
@@ -88,13 +88,15 @@ def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0,
bad
=
[]
skipped
=
[]
if
leakdebug
:
if
findleaks
:
try
:
import
gc
except
ImportError
:
print
'cycle garbage collection not available'
findleaks
=
0
else
:
gc
.
set_debug
(
gc
.
DEBUG_LEAK
)
gc
.
set_debug
(
gc
.
DEBUG_SAVEALL
)
found_garbage
=
[]
if
single
:
from
tempfile
import
gettempdir
...
...
@@ -136,6 +138,12 @@ def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0,
bad
.
append
(
test
)
else
:
skipped
.
append
(
test
)
if
findleaks
:
gc
.
collect
()
if
gc
.
garbage
:
print
"garbage:"
,
repr
(
gc
.
garbage
)
found_garbage
.
extend
(
gc
.
garbage
)
del
gc
.
garbage
[:]
# Unload the newly imported modules (best effort finalization)
for
module
in
sys
.
modules
.
keys
():
if
module
not
in
save_modules
and
module
.
startswith
(
"test."
):
...
...
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