OLD | NEW |
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 def __init__(self, sock, server, ctx): | 43 def __init__(self, sock, server, ctx): |
44 super(EndpointProgress, self).__init__() | 44 super(EndpointProgress, self).__init__() |
45 self.sock = sock | 45 self.sock = sock |
46 self.server = server | 46 self.server = server |
47 self.context = ctx | 47 self.context = ctx |
48 self.results_queue = [] # Accessors must synchronize themselves. | 48 self.results_queue = [] # Accessors must synchronize themselves. |
49 self.sender_lock = threading.Lock() | 49 self.sender_lock = threading.Lock() |
50 self.senderthread = threading.Thread(target=self._SenderThread) | 50 self.senderthread = threading.Thread(target=self._SenderThread) |
51 self.senderthread.start() | 51 self.senderthread.start() |
52 | 52 |
53 def HasRun(self, test): | 53 def HasRun(self, test, has_unexpected_output): |
54 # The runners that call this have a lock anyway, so this is safe. | 54 # The runners that call this have a lock anyway, so this is safe. |
55 self.results_queue.append(test) | 55 self.results_queue.append(test) |
56 | 56 |
57 def _SenderThread(self): | 57 def _SenderThread(self): |
58 keep_running = True | 58 keep_running = True |
59 tests = [] | 59 tests = [] |
60 self.sender_lock.acquire() | 60 self.sender_lock.acquire() |
61 while keep_running: | 61 while keep_running: |
62 time.sleep(0.1) | 62 time.sleep(0.1) |
63 # This should be "atomic enough" without locking :-) | 63 # This should be "atomic enough" without locking :-) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 runner = execution.Runner(suites, progress_indicator, ctx) | 112 runner = execution.Runner(suites, progress_indicator, ctx) |
113 try: | 113 try: |
114 runner.Run(server.jobs) | 114 runner.Run(server.jobs) |
115 except IOError, e: | 115 except IOError, e: |
116 if e.errno == 2: | 116 if e.errno == 2: |
117 message = ("File not found: %s, maybe you forgot to 'git add' it?" % | 117 message = ("File not found: %s, maybe you forgot to 'git add' it?" % |
118 e.filename) | 118 e.filename) |
119 else: | 119 else: |
120 message = "%s" % e | 120 message = "%s" % e |
121 compression.Send([[-1, message]], sock) | 121 compression.Send([[-1, message]], sock) |
122 progress_indicator.HasRun(None) # Sentinel to signal the end. | 122 progress_indicator.HasRun(None, None) # Sentinel to signal the end. |
123 progress_indicator.sender_lock.acquire() # Released when sending is done. | 123 progress_indicator.sender_lock.acquire() # Released when sending is done. |
124 progress_indicator.sender_lock.release() | 124 progress_indicator.sender_lock.release() |
OLD | NEW |