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
69649f21
Kaydet (Commit)
69649f21
authored
Mar 23, 2016
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
regrtest: display test duration in sequential mode
Only display duration if a test takes more than 30 seconds.
üst
e9857265
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
9 deletions
+29
-9
main.py
Lib/test/libregrtest/main.py
+19
-2
runtest.py
Lib/test/libregrtest/runtest.py
+5
-0
runtest_mp.py
Lib/test/libregrtest/runtest_mp.py
+2
-5
test_regrtest.py
Lib/test/test_regrtest.py
+3
-2
No files found.
Lib/test/libregrtest/main.py
Dosyayı görüntüle @
69649f21
...
...
@@ -13,7 +13,8 @@ from test.libregrtest.cmdline import _parse_args
from
test.libregrtest.runtest
import
(
findtests
,
runtest
,
STDTESTS
,
NOTTESTS
,
PASSED
,
FAILED
,
ENV_CHANGED
,
SKIPPED
,
RESOURCE_DENIED
,
INTERRUPTED
,
CHILD_ERROR
)
INTERRUPTED
,
CHILD_ERROR
,
PROGRESS_MIN_TIME
)
from
test.libregrtest.setup
import
setup_tests
from
test
import
support
try
:
...
...
@@ -293,8 +294,15 @@ class Regrtest:
save_modules
=
sys
.
modules
.
keys
()
previous_test
=
None
for
test_index
,
test
in
enumerate
(
self
.
tests
,
1
):
self
.
display_progress
(
test_index
,
test
)
start_time
=
time
.
monotonic
()
text
=
test
if
previous_test
:
text
=
'
%
s --
%
s'
%
(
text
,
previous_test
)
self
.
display_progress
(
test_index
,
text
)
if
self
.
tracer
:
# If we're tracing code coverage, then we don't exit with status
# if on a false return value from main.
...
...
@@ -311,6 +319,12 @@ class Regrtest:
else
:
self
.
accumulate_result
(
test
,
result
)
test_time
=
time
.
monotonic
()
-
start_time
if
test_time
>=
PROGRESS_MIN_TIME
:
previous_test
=
'
%
s took
%.0
f sec'
%
(
test
,
test_time
)
else
:
previous_test
=
None
if
self
.
ns
.
findleaks
:
gc
.
collect
()
if
gc
.
garbage
:
...
...
@@ -326,6 +340,9 @@ class Regrtest:
if
module
not
in
save_modules
and
module
.
startswith
(
"test."
):
support
.
unload
(
module
)
if
previous_test
:
print
(
previous_test
)
def
_test_forever
(
self
,
tests
):
while
True
:
for
test
in
tests
:
...
...
Lib/test/libregrtest/runtest.py
Dosyayı görüntüle @
69649f21
...
...
@@ -20,6 +20,11 @@ RESOURCE_DENIED = -3
INTERRUPTED
=
-
4
CHILD_ERROR
=
-
5
# error in a child process
# Minimum duration of a test to display its duration or to mention that
# the test is running in background
PROGRESS_MIN_TIME
=
30.0
# seconds
# small set of tests to determine if we have a basically functioning interpreter
# (i.e. if any of these fail, then anything else is likely to follow)
...
...
Lib/test/libregrtest/runtest_mp.py
Dosyayı görüntüle @
69649f21
...
...
@@ -13,14 +13,11 @@ except ImportError:
print
(
"Multiprocess option requires thread support"
)
sys
.
exit
(
2
)
from
test.libregrtest.runtest
import
runtest
,
INTERRUPTED
,
CHILD_ERROR
from
test.libregrtest.runtest
import
(
runtest
,
INTERRUPTED
,
CHILD_ERROR
,
PROGRESS_MIN_TIME
)
from
test.libregrtest.setup
import
setup_tests
# Minimum duration of a test to display its duration or to mention that
# the test is running in background
PROGRESS_MIN_TIME
=
30.0
# seconds
# Display the running tests if nothing happened last N seconds
PROGRESS_UPDATE
=
30.0
# seconds
...
...
Lib/test/test_regrtest.py
Dosyayı görüntüle @
69649f21
...
...
@@ -304,7 +304,7 @@ class ParseArgsTestCase(unittest.TestCase):
class
BaseTestCase
(
unittest
.
TestCase
):
TEST_UNIQUE_ID
=
1
TESTNAME_PREFIX
=
'test_regrtest_'
TESTNAME_REGEX
=
r'test_[a-z0-9_]+'
TESTNAME_REGEX
=
r'test_[a-z
A-Z
0-9_]+'
def
setUp
(
self
):
self
.
testdir
=
os
.
path
.
realpath
(
os
.
path
.
dirname
(
__file__
))
...
...
@@ -351,7 +351,8 @@ class BaseTestCase(unittest.TestCase):
self
.
assertRegex
(
output
,
regex
)
def
parse_executed_tests
(
self
,
output
):
regex
=
r'^[0-9]+:[0-9]+:[0-9]+ \[ *[0-9]+(?:/ *[0-9]+)?\] (
%
s)$'
%
self
.
TESTNAME_REGEX
regex
=
(
r'^[0-9]+:[0-9]+:[0-9]+ \[ *[0-9]+(?:/ *[0-9]+)?\] (
%
s)'
%
self
.
TESTNAME_REGEX
)
parser
=
re
.
finditer
(
regex
,
output
,
re
.
MULTILINE
)
return
list
(
match
.
group
(
1
)
for
match
in
parser
)
...
...
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