Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(113389)

Side by Side Diff: Lib/test/libregrtest/runtest_mp.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/libregrtest/main.py ('k') | Lib/test/__main__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import json 1 import json
2 import os 2 import os
3 import queue 3 import queue
4 import sys 4 import sys
5 import time 5 import time
6 import traceback 6 import traceback
7 import types 7 import types
8 from test import support 8 from test import support
9 try: 9 try:
10 import threading 10 import threading
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 try: 68 try:
69 result = runtest(ns, testname) 69 result = runtest(ns, testname)
70 except KeyboardInterrupt: 70 except KeyboardInterrupt:
71 result = INTERRUPTED, '' 71 result = INTERRUPTED, ''
72 except BaseException as e: 72 except BaseException as e:
73 traceback.print_exc() 73 traceback.print_exc()
74 result = CHILD_ERROR, str(e) 74 result = CHILD_ERROR, str(e)
75 75
76 print() # Force a newline (just in case) 76 print() # Force a newline (just in case)
77 print(json.dumps(result), flush=True) 77 print(json.dumps(result), flush=True)
78 sys.exit(0) 78 return 0
79 79
80 80
81 # We do not use a generator so multiple threads can call next(). 81 # We do not use a generator so multiple threads can call next().
82 class MultiprocessIterator: 82 class MultiprocessIterator:
83 83
84 """A thread-safe iterator over tests for multiprocess mode.""" 84 """A thread-safe iterator over tests for multiprocess mode."""
85 85
86 def __init__(self, tests): 86 def __init__(self, tests):
87 self.interrupted = False 87 self.interrupted = False
88 self.lock = threading.Lock() 88 self.lock = threading.Lock()
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 regrtest.interrupted = True 215 regrtest.interrupted = True
216 pending.interrupted = True 216 pending.interrupted = True
217 print() 217 print()
218 218
219 running = [worker.current_test for worker in workers] 219 running = [worker.current_test for worker in workers]
220 running = list(filter(bool, running)) 220 running = list(filter(bool, running))
221 if running: 221 if running:
222 print("Waiting for %s" % ', '.join(running)) 222 print("Waiting for %s" % ', '.join(running))
223 for worker in workers: 223 for worker in workers:
224 worker.join() 224 worker.join()
OLDNEW
« no previous file with comments | « Lib/test/libregrtest/main.py ('k') | Lib/test/__main__.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+