| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 import datetime | 7 import datetime |
| 8 import math | 8 import math |
| 9 from matplotlib.font_manager import FontProperties | 9 from matplotlib.font_manager import FontProperties |
| 10 import matplotlib.pyplot as plt | 10 import matplotlib.pyplot as plt |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 stdout to | 61 stdout to |
| 62 append: True if we want to append to the file instead of overwriting it""" | 62 append: True if we want to append to the file instead of overwriting it""" |
| 63 if VERBOSE: | 63 if VERBOSE: |
| 64 print ' '.join(cmd_list) | 64 print ' '.join(cmd_list) |
| 65 out = subprocess.PIPE | 65 out = subprocess.PIPE |
| 66 if outfile: | 66 if outfile: |
| 67 mode = 'w' | 67 mode = 'w' |
| 68 if append: | 68 if append: |
| 69 mode = 'a' | 69 mode = 'a' |
| 70 out = open(outfile, mode) | 70 out = open(outfile, mode) |
| 71 if append: |
| 72 # Annoying Windows "feature" -- append doesn't actually append unless you |
| 73 # explicitly go to the end of the file. |
| 74 # http://mail.python.org/pipermail/python-list/2009-October/1221859.html |
| 75 out.seek(0, os.SEEK_END) |
| 71 p = subprocess.Popen(cmd_list, stdout = out, stderr = subprocess.PIPE, | 76 p = subprocess.Popen(cmd_list, stdout = out, stderr = subprocess.PIPE, |
| 72 shell=HAS_SHELL) | 77 shell=HAS_SHELL) |
| 73 output, not_used = p.communicate(); | 78 output, not_used = p.communicate(); |
| 74 if output: | 79 if output: |
| 75 print output | 80 print output |
| 76 return output | 81 return output |
| 77 | 82 |
| 78 def time_cmd(cmd): | 83 def time_cmd(cmd): |
| 79 """Determine the amount of (real) time it takes to execute a given command.""" | 84 """Determine the amount of (real) time it takes to execute a given command.""" |
| 80 start = time.time() | 85 start = time.time() |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 if has_new_code(): | 750 if has_new_code(): |
| 746 run_test_sequence(cl, size, language, perf) | 751 run_test_sequence(cl, size, language, perf) |
| 747 else: | 752 else: |
| 748 time.sleep(SLEEP_TIME) | 753 time.sleep(SLEEP_TIME) |
| 749 else: | 754 else: |
| 750 run_test_sequence(cl, size, language, perf) | 755 run_test_sequence(cl, size, language, perf) |
| 751 | 756 |
| 752 if __name__ == '__main__': | 757 if __name__ == '__main__': |
| 753 main() | 758 main() |
| 754 | 759 |
| OLD | NEW |