Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 import os | 6 import os |
| 7 import subprocess | 7 import subprocess |
| 8 import sys | 8 import sys |
| 9 import time | 9 import time |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 sys.stderr.write('Command failed:\n%s\n' % quoted_arguments) | 44 sys.stderr.write('Command failed:\n%s\n' % quoted_arguments) |
| 45 if stdout: | 45 if stdout: |
| 46 sys.stderr.write(stdout) | 46 sys.stderr.write(stdout) |
| 47 | 47 |
| 48 | 48 |
| 49 def main(args): | 49 def main(args): |
| 50 def b(s): | 50 def b(s): |
| 51 """Adds ANSI escape-code for bold-face""" | 51 """Adds ANSI escape-code for bold-face""" |
| 52 return "\033[1m%s\033[0m" % s | 52 return "\033[1m%s\033[0m" % s |
| 53 | 53 |
| 54 # VM Checked, produces checked | |
| 54 print 'Started' | 55 print 'Started' |
| 55 start = time.time() | 56 start = time.time() |
| 56 RunCommand('./frog.py', | 57 RunCommand('./frog.py', |
| 57 '--vm_flags=--compile_all --enable_type_checks --enable_asserts', | 58 '--vm_flags=--compile_all --enable_type_checks --enable_asserts', |
| 58 '--', '--out=frogsh', 'frog.dart') | 59 '--', '--enable_type_checks', '--out=frogsh', 'frog.dart') |
| 59 elapsed = time.time() - start | 60 elapsed = time.time() - start |
| 60 print 'Compiling on Dart VM took %s seconds %s' % (b(elapsed), | 61 print 'Compiling on Dart VM took %s seconds %s' % (b(elapsed), |
| 61 b('in checked mode')) | 62 b('in checked mode')) |
| 63 | |
| 64 # VM Normal, produces checked | |
| 62 start = time.time() | 65 start = time.time() |
| 63 RunCommand('./frog.py', '--out=frogsh', 'frog.dart') | 66 RunCommand('./frog.py', '--out=frogsh', '--enable_type_checks', 'frog.dart') |
| 64 elapsed = time.time() - start | 67 elapsed = time.time() - start |
| 65 print 'Compiling on Dart VM took %s seconds' % b(elapsed) | 68 print 'Compiling on Dart VM took %s seconds' % b(elapsed) |
| 69 | |
| 70 # Selfhost Checked | |
|
Jennifer Messerly
2011/11/05 00:45:11
The speed/size is reasonable enough, so I just tur
| |
| 66 start = time.time() | 71 start = time.time() |
| 67 RunCommand('./frogsh', '--out=frogsh', 'frog.dart', 'tests/hello.dart') | 72 RunCommand('./frogsh', '--out=frogsh', '--enable_type_checks', 'frog.dart', |
| 73 '--enable_type_checks', 'tests/hello.dart') | |
| 68 elapsed = time.time() - start | 74 elapsed = time.time() - start |
| 69 size = os.path.getsize('./frogsh') / 1024 | 75 size = os.path.getsize('./frogsh') / 1024 |
| 70 print 'Bootstrapping took %s seconds' % b(elapsed) | 76 print 'Bootstrapping took %s seconds %s' % (b(elapsed), b('in checked mode')) |
| 71 print 'Generated frogsh is \033[1m%d\033[0m kB' % size | 77 print 'Generated %s frogsh is %s kB' % (b('checked'), b(size)) |
| 72 | 78 |
| 73 RunCommand('../tools/build.py', '--mode=release') | 79 RunCommand('../tools/build.py', '--mode=release') |
| 74 test_cmd = ['../tools/test.py', '--component=frog,frogsh,leg', | 80 test_cmd = ['../tools/test.py', '--component=frog,frogsh,leg', |
| 75 '--report', '--timeout=5', '--progress=color', | 81 '--report', '--timeout=5', '--progress=color', |
| 76 '--mode=release'] | 82 '--mode=release'] |
| 77 if args[1:]: | 83 if args[1:]: |
| 78 test_cmd.extend(args[1:]) | 84 test_cmd.extend(args[1:]) |
| 79 else: | 85 else: |
| 80 test_cmd.extend(['language', 'corelib', 'leg', 'peg']) | 86 test_cmd.extend(['language', 'corelib', 'leg', 'peg']) |
| 81 RunCommand(*test_cmd, verbose=True) | 87 RunCommand(*test_cmd, verbose=True) |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 100 '--vm_flags=--enable_type_checks --enable_asserts', | 106 '--vm_flags=--enable_type_checks --enable_asserts', |
| 101 '--', '--enable_leg', '--verbose', '--throw_on_errors', | 107 '--', '--enable_leg', '--verbose', '--throw_on_errors', |
| 102 filename, pattern=pattern, exit_code=vm_exit_code) | 108 filename, pattern=pattern, exit_code=vm_exit_code) |
| 103 | 109 |
| 104 if __name__ == '__main__': | 110 if __name__ == '__main__': |
| 105 try: | 111 try: |
| 106 sys.exit(main(sys.argv)) | 112 sys.exit(main(sys.argv)) |
| 107 except Error as e: | 113 except Error as e: |
| 108 sys.stderr.write('%s\n' % e) | 114 sys.stderr.write('%s\n' % e) |
| 109 sys.exit(1) | 115 sys.exit(1) |
| OLD | NEW |