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
012f5b96
Unverified
Kaydet (Commit)
012f5b96
authored
Eyl 07, 2018
tarafından
Victor Stinner
Kaydeden (comit)
GitHub
Eyl 07, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-34605, libregrtest: Rename --slaveargs to --worker-args (GH-9099)
Rename also run_tests_slave() to run_tests_worker().
üst
23e65b25
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
cmdline.py
Lib/test/libregrtest/cmdline.py
+1
-1
main.py
Lib/test/libregrtest/main.py
+3
-3
runtest_mp.py
Lib/test/libregrtest/runtest_mp.py
+7
-7
test_regrtest.py
Lib/test/test_regrtest.py
+4
-4
No files found.
Lib/test/libregrtest/cmdline.py
Dosyayı görüntüle @
012f5b96
...
...
@@ -170,7 +170,7 @@ def _create_parser():
group
.
add_argument
(
'--wait'
,
action
=
'store_true'
,
help
=
'wait for user input, e.g., allow a debugger '
'to be attached'
)
group
.
add_argument
(
'--
slave
args'
,
metavar
=
'ARGS'
)
group
.
add_argument
(
'--
worker-
args'
,
metavar
=
'ARGS'
)
group
.
add_argument
(
'-S'
,
'--start'
,
metavar
=
'START'
,
help
=
'the name of the test at which to start.'
+
more_details
)
...
...
Lib/test/libregrtest/main.py
Dosyayı görüntüle @
012f5b96
...
...
@@ -542,9 +542,9 @@ class Regrtest:
print
(
msg
,
file
=
sys
.
stderr
,
flush
=
True
)
sys
.
exit
(
2
)
if
self
.
ns
.
slave
args
is
not
None
:
from
test.libregrtest.runtest_mp
import
run_tests_
slave
run_tests_
slave
(
self
.
ns
.
slave
args
)
if
self
.
ns
.
worker_
args
is
not
None
:
from
test.libregrtest.runtest_mp
import
run_tests_
worker
run_tests_
worker
(
self
.
ns
.
worker_
args
)
if
self
.
ns
.
wait
:
input
(
"Press any key to continue..."
)
...
...
Lib/test/libregrtest/runtest_mp.py
Dosyayı görüntüle @
012f5b96
...
...
@@ -24,23 +24,23 @@ WAIT_PROGRESS = 2.0 # seconds
def
run_test_in_subprocess
(
testname
,
ns
):
"""Run the given test in a subprocess with --
slave
args.
"""Run the given test in a subprocess with --
worker-
args.
ns is the option Namespace parsed from command-line arguments. regrtest
is invoked in a subprocess with the --
slave
args argument; when the
is invoked in a subprocess with the --
worker-
args argument; when the
subprocess exits, its return code, stdout and stderr are returned as a
3-tuple.
"""
from
subprocess
import
Popen
,
PIPE
ns_dict
=
vars
(
ns
)
slave
args
=
(
ns_dict
,
testname
)
slaveargs
=
json
.
dumps
(
slave
args
)
worker_
args
=
(
ns_dict
,
testname
)
worker_args
=
json
.
dumps
(
worker_
args
)
cmd
=
[
sys
.
executable
,
*
support
.
args_from_interpreter_flags
(),
'-u'
,
# Unbuffered stdout and stderr
'-m'
,
'test.regrtest'
,
'--
slaveargs'
,
slave
args
]
'--
worker-args'
,
worker_
args
]
if
ns
.
pgo
:
cmd
+=
[
'--pgo'
]
...
...
@@ -58,8 +58,8 @@ def run_test_in_subprocess(testname, ns):
return
retcode
,
stdout
,
stderr
def
run_tests_
slave
(
slave
args
):
ns_dict
,
testname
=
json
.
loads
(
slave
args
)
def
run_tests_
worker
(
worker_
args
):
ns_dict
,
testname
=
json
.
loads
(
worker_
args
)
ns
=
types
.
SimpleNamespace
(
**
ns_dict
)
setup_tests
(
ns
)
...
...
Lib/test/test_regrtest.py
Dosyayı görüntüle @
012f5b96
...
...
@@ -67,10 +67,10 @@ class ParseArgsTestCase(unittest.TestCase):
ns
=
libregrtest
.
_parse_args
([
'--wait'
])
self
.
assertTrue
(
ns
.
wait
)
def
test_
slave
args
(
self
):
ns
=
libregrtest
.
_parse_args
([
'--
slave
args'
,
'[[], {}]'
])
self
.
assertEqual
(
ns
.
slave
args
,
'[[], {}]'
)
self
.
checkError
([
'--
slave
args'
],
'expected one argument'
)
def
test_
worker_
args
(
self
):
ns
=
libregrtest
.
_parse_args
([
'--
worker-
args'
,
'[[], {}]'
])
self
.
assertEqual
(
ns
.
worker_
args
,
'[[], {}]'
)
self
.
checkError
([
'--
worker-
args'
],
'expected one argument'
)
def
test_start
(
self
):
for
opt
in
'-S'
,
'--start'
:
...
...
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