OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """ | 6 """ |
7 Performance runner for d8. | 7 Performance runner for d8. |
8 | 8 |
9 Call e.g. with tools/run-perf.py --arch ia32 some_suite.json | 9 Call e.g. with tools/run-perf.py --arch ia32 some_suite.json |
10 | 10 |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 pass | 479 pass |
480 | 480 |
481 def PostExecution(self): | 481 def PostExecution(self): |
482 pass | 482 pass |
483 | 483 |
484 def PreTests(self, node, path): | 484 def PreTests(self, node, path): |
485 if isinstance(node, Runnable): | 485 if isinstance(node, Runnable): |
486 node.ChangeCWD(path) | 486 node.ChangeCWD(path) |
487 | 487 |
488 def Run(self, runnable, count): | 488 def Run(self, runnable, count): |
489 output = commands.Execute(runnable.GetCommand(self.shell_dir), | 489 try: |
490 timeout=runnable.timeout) | 490 output = commands.Execute(runnable.GetCommand(self.shell_dir), |
| 491 timeout=runnable.timeout) |
| 492 except OSError as e: |
| 493 print ">>> OSError (#%d):" % (count + 1) |
| 494 print e |
| 495 return "" |
491 print ">>> Stdout (#%d):" % (count + 1) | 496 print ">>> Stdout (#%d):" % (count + 1) |
492 print output.stdout | 497 print output.stdout |
493 if output.stderr: # pragma: no cover | 498 if output.stderr: # pragma: no cover |
494 # Print stderr for debugging. | 499 # Print stderr for debugging. |
495 print ">>> Stderr (#%d):" % (count + 1) | 500 print ">>> Stderr (#%d):" % (count + 1) |
496 print output.stderr | 501 print output.stderr |
497 if output.timed_out: | 502 if output.timed_out: |
498 print ">>> Test timed out after %ss." % runnable.timeout | 503 print ">>> Test timed out after %ss." % runnable.timeout |
499 return output.stdout | 504 return output.stdout |
500 | 505 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 | 716 |
712 if options.json_test_results: | 717 if options.json_test_results: |
713 results.WriteToFile(options.json_test_results) | 718 results.WriteToFile(options.json_test_results) |
714 else: # pragma: no cover | 719 else: # pragma: no cover |
715 print results | 720 print results |
716 | 721 |
717 return min(1, len(results.errors)) | 722 return min(1, len(results.errors)) |
718 | 723 |
719 if __name__ == "__main__": # pragma: no cover | 724 if __name__ == "__main__": # pragma: no cover |
720 sys.exit(Main(sys.argv[1:])) | 725 sys.exit(Main(sys.argv[1:])) |
OLD | NEW |