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
012f5b96
Commit
012f5b96
authored
Sep 07, 2018
by
Victor Stinner
Committed by
GitHub
Sep 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-34605, libregrtest: Rename --slaveargs to --worker-args (GH-9099)
Rename also run_tests_slave() to run_tests_worker().
parent
23e65b25
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
Lib/test/libregrtest/cmdline.py
Lib/test/libregrtest/cmdline.py
+1
-1
Lib/test/libregrtest/main.py
Lib/test/libregrtest/main.py
+3
-3
Lib/test/libregrtest/runtest_mp.py
Lib/test/libregrtest/runtest_mp.py
+7
-7
Lib/test/test_regrtest.py
Lib/test/test_regrtest.py
+4
-4
No files found.
Lib/test/libregrtest/cmdline.py
View file @
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
View file @
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
View file @
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
View file @
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