Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
fd12f497
Kaydet (Commit)
fd12f497
authored
Mar 29, 2009
tarafından
Collin Winter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Port r70672 to py3k. Add the ability to control the random seed used by regrtest.py -r.
üst
9041daa9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
regrtest.py
Lib/test/regrtest.py
+18
-5
No files found.
Lib/test/regrtest.py
Dosyayı görüntüle @
fd12f497
...
@@ -35,6 +35,10 @@ If no test names are given, all tests are run.
...
@@ -35,6 +35,10 @@ If no test names are given, all tests are run.
-v is incompatible with -g and does not compare test output files.
-v is incompatible with -g and does not compare test output files.
-r randomizes test execution order. You can use --randseed=int to provide a
int seed value for the randomizer; this is useful for reproducing troublesome
test orders.
-T turns on code coverage tracing with the trace module.
-T turns on code coverage tracing with the trace module.
-D specifies the directory where coverage files are put.
-D specifies the directory where coverage files are put.
...
@@ -191,7 +195,8 @@ def usage(msg):
...
@@ -191,7 +195,8 @@ def usage(msg):
def
main
(
tests
=
None
,
testdir
=
None
,
verbose
=
0
,
quiet
=
False
,
generate
=
False
,
def
main
(
tests
=
None
,
testdir
=
None
,
verbose
=
0
,
quiet
=
False
,
generate
=
False
,
exclude
=
False
,
single
=
False
,
randomize
=
False
,
fromfile
=
None
,
exclude
=
False
,
single
=
False
,
randomize
=
False
,
fromfile
=
None
,
findleaks
=
False
,
use_resources
=
None
,
trace
=
False
,
coverdir
=
'coverage'
,
findleaks
=
False
,
use_resources
=
None
,
trace
=
False
,
coverdir
=
'coverage'
,
runleaks
=
False
,
huntrleaks
=
False
,
verbose2
=
False
,
print_slow
=
False
):
runleaks
=
False
,
huntrleaks
=
False
,
verbose2
=
False
,
print_slow
=
False
,
random_seed
=
None
):
"""Execute a test suite.
"""Execute a test suite.
This also parses command-line options and modifies its behavior
This also parses command-line options and modifies its behavior
...
@@ -209,9 +214,10 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
...
@@ -209,9 +214,10 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
files beginning with test_ will be used.
files beginning with test_ will be used.
The other default arguments (verbose, quiet, generate, exclude,
The other default arguments (verbose, quiet, generate, exclude,
single, randomize, findleaks, use_resources, trace, coverdir, and
single, randomize, findleaks, use_resources, trace, coverdir,
print_slow) allow programmers calling main() directly to set the
print_slow, and random_seed) allow programmers calling main()
values that would normally be set by flags on the command line.
directly to set the values that would normally be set by flags
on the command line.
"""
"""
support
.
record_original_stdout
(
sys
.
stdout
)
support
.
record_original_stdout
(
sys
.
stdout
)
...
@@ -222,12 +228,15 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
...
@@ -222,12 +228,15 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
'findleaks'
,
'use='
,
'threshold='
,
'trace'
,
'findleaks'
,
'use='
,
'threshold='
,
'trace'
,
'coverdir='
,
'nocoverdir'
,
'runleaks'
,
'coverdir='
,
'nocoverdir'
,
'runleaks'
,
'huntrleaks='
,
'verbose2'
,
'memlimit='
,
'huntrleaks='
,
'verbose2'
,
'memlimit='
,
'debug'
,
'start='
,
"nowindows"
'debug'
,
'start='
,
'nowindows'
,
'randseed='
,
])
])
except
getopt
.
error
as
msg
:
except
getopt
.
error
as
msg
:
usage
(
msg
)
usage
(
msg
)
# Defaults
# Defaults
if
random_seed
is
None
:
random_seed
=
random
.
randrange
(
10000000
)
if
use_resources
is
None
:
if
use_resources
is
None
:
use_resources
=
[]
use_resources
=
[]
debug
=
False
debug
=
False
...
@@ -255,6 +264,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
...
@@ -255,6 +264,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
print_slow
=
True
print_slow
=
True
elif
o
in
(
'-r'
,
'--randomize'
):
elif
o
in
(
'-r'
,
'--randomize'
):
randomize
=
True
randomize
=
True
elif
o
==
'--randseed'
:
random_seed
=
int
(
a
)
elif
o
in
(
'-f'
,
'--fromfile'
):
elif
o
in
(
'-f'
,
'--fromfile'
):
fromfile
=
a
fromfile
=
a
elif
o
in
(
'-l'
,
'--findleaks'
):
elif
o
in
(
'-l'
,
'--findleaks'
):
...
@@ -389,6 +400,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
...
@@ -389,6 +400,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
except
ValueError
:
except
ValueError
:
print
(
"Couldn't find starting test (
%
s), using all tests"
%
start
)
print
(
"Couldn't find starting test (
%
s), using all tests"
%
start
)
if
randomize
:
if
randomize
:
random
.
seed
(
random_seed
)
print
(
"Using random seed"
,
random_seed
)
random
.
shuffle
(
tests
)
random
.
shuffle
(
tests
)
if
trace
:
if
trace
:
import
trace
import
trace
...
...
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