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
9e9d4f8e
Commit
9e9d4f8e
authored
Jun 07, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added -t (--threshold) option to call gc.set_threshold(N).
parent
a4c2b247
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
25 deletions
+30
-25
Lib/test/regrtest.py
Lib/test/regrtest.py
+30
-25
No files found.
Lib/test/regrtest.py
View file @
9e9d4f8e
...
...
@@ -18,6 +18,7 @@ Command line options:
-l: findleaks -- if GC is available detect tests that leak memory
-u: use -- specify which special resource intensive tests to run
-h: help -- print this text and exit
-t: threshold -- call gc.set_threshold(N)
If non-option arguments are present, they are names for tests to run,
unless -x is given, in which case they are names for tests not to run.
...
...
@@ -25,34 +26,35 @@ If no test names are given, all tests are run.
-v is incompatible with -g and does not compare test output files.
-s means to run only a single test and exit. This is useful when doing memory
analysis on the Python interpreter (which tend to consume too many resources to
run the full regression test non-stop). The file /tmp/pynexttest is read to
find the next test to run. If this file is missing, the first test_*.py file
in testdir or on the command line is used. (actually tempfile.gettempdir() is
used instead of /tmp).
-s means to run only a single test and exit. This is useful when
doing memory analysis on the Python interpreter (which tend to consume
too many resources to run the full regression test non-stop). The
file /tmp/pynexttest is read to find the next test to run. If this
file is missing, the first test_*.py file in testdir or on the command
line is used. (actually tempfile.gettempdir() is used instead of
/tmp).
-f reads the names of tests from the file given as f's argument, one
or more
test names per line. Whitespace is ignored. Blank lines and lines beginning
with '#' are ignored. This is especially useful for whittling down failures
involving interactions among tests.
-f reads the names of tests from the file given as f's argument, one
or more test names per line. Whitespace is ignored. Blank lines and
lines beginning with '#' are ignored. This is especially useful for
whittling down failures
involving interactions among tests.
-u is used to specify which special resource intensive tests to run,
such as
those requiring large file support or network connectivity. The argument is a
comma-separated list of words indicating the resources to test. Currently
only the following are defined:
-u is used to specify which special resource intensive tests to run,
such as those requiring large file support or network connectivity.
The argument is a comma-separated list of words indicating the
resources to test. Currently
only the following are defined:
all - Enable all special resources.
curses - Tests that use curses and will modify the terminal's
state and output modes.
largefile - It is okay to run some test that may create huge
files. These
tests can take a long time and may consume >2GB of disk space
temporarily.
largefile - It is okay to run some test that may create huge
files. These tests can take a long time and may
consume >2GB of disk space
temporarily.
network - It is okay to run tests that use external network
resource,
e.g. testing SSL support for sockets.
network - It is okay to run tests that use external network
resource,
e.g. testing SSL support for sockets.
"""
import
sys
...
...
@@ -93,19 +95,19 @@ def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0,
command-line will be used. If that's empty, too, then all *.py
files beginning with test_ will be used.
The other default arguments (verbose, quiet, generate, exclude,
single,
randomize, findleaks, and use_resources) allow programmers calling main()
directly to set the values that would normally be set by flags on th
e
command line.
The other default arguments (verbose, quiet, generate, exclude,
single, randomize, findleaks, and use_resources) allow programmers
calling main() directly to set the values that would normally b
e
set by flags on the
command line.
"""
test_support
.
record_original_stdout
(
sys
.
stdout
)
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'hvgqxsrf:lu:'
,
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'hvgqxsrf:lu:
t:
'
,
[
'help'
,
'verbose'
,
'quiet'
,
'generate'
,
'exclude'
,
'single'
,
'random'
,
'fromfile'
,
'findleaks'
,
'use='
])
'findleaks'
,
'use='
,
'threshold='
])
except
getopt
.
error
,
msg
:
usage
(
2
,
msg
)
...
...
@@ -132,6 +134,9 @@ def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0,
fromfile
=
a
elif
o
in
(
'-l'
,
'--findleaks'
):
findleaks
=
1
elif
o
in
(
'-t'
,
'--threshold'
):
import
gc
gc
.
set_threshold
(
int
(
a
))
elif
o
in
(
'-u'
,
'--use'
):
u
=
[
x
.
lower
()
for
x
in
a
.
split
(
','
)]
for
r
in
u
:
...
...
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