| 293 | |
| 294 | |
| 295 | def RunResultsProcessor(results_processor, output, count): |
| 296 | # Dummy pass through for null-runs. |
| 297 | if output.stdout is None: |
| 298 | return output |
| 299 | |
| 300 | # We assume the results processor is relative to the suite. |
| 301 | assert os.path.exists(results_processor) |
| 302 | p = subprocess.Popen( |
| 303 | [sys.executable, results_processor], |
| 304 | stdin=subprocess.PIPE, |
| 305 | stdout=subprocess.PIPE, |
| 306 | stderr=subprocess.PIPE, |
| 307 | ) |
| 308 | new_output = copy.copy(output) |
| 309 | new_output.stdout = p.communicate( |
| 310 | input=output.stdout.encode('utf-8'))[0].decode('utf-8') |
| 311 | logging.info('>>> Processed stdout (#%d):\n%s', count, output.stdout) |
| 312 | return new_output |
| 313 | |
| 314 | |
| 315 | class Node(object): |