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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 print 'Bootstrapping took %s seconds %s' % (b(elapsed), b('in checked mode')) | 76 print 'Bootstrapping took %s seconds %s' % (b(elapsed), b('in checked mode')) |
77 print 'Generated %s frogsh is %s kB' % (b('checked'), b(size)) | 77 print 'Generated %s frogsh is %s kB' % (b('checked'), b(size)) |
78 | 78 |
79 RunCommand('../tools/build.py', '--mode=release') | 79 RunCommand('../tools/build.py', '--mode=release') |
80 test_cmd = ['../tools/test.py', '--component=frog,frogsh,leg', | 80 test_cmd = ['../tools/test.py', '--component=frog,frogsh,leg', |
81 '--report', '--timeout=5', '--progress=color', | 81 '--report', '--timeout=5', '--progress=color', |
82 '--mode=release'] | 82 '--mode=release'] |
83 if args[1:]: | 83 if args[1:]: |
84 test_cmd.extend(args[1:]) | 84 test_cmd.extend(args[1:]) |
85 else: | 85 else: |
86 test_cmd.extend(['language', 'corelib', 'leg', 'isolate', 'peg']) | 86 test_cmd.extend(['language', 'corelib', 'leg', 'isolate', 'peg', 'leg_only'] ) |
kasperl
2011/11/08 11:34:13
Long line.
ngeoffray
2011/11/08 11:46:11
Done.
| |
87 RunCommand(*test_cmd, verbose=True) | 87 RunCommand(*test_cmd, verbose=True) |
88 | 88 |
89 leg_test_dir = os.path.join('leg', 'tests') | |
90 for current_dir, directories, filenames in os.walk(leg_test_dir): | |
91 for filename in filenames: | |
92 if filename.endswith('.dart'): | |
93 pattern = 'info: [leg] compilation succeeded' | |
94 node_exit_code = 0 | |
95 vm_exit_code = 0 | |
96 if filename == 'empty.dart': | |
97 pattern = 'info: [leg] compiler cancelled: Could not find main' | |
98 node_exit_code = 1 | |
99 vm_exit_code = 255 # Sigh. | |
100 filename = os.path.join(current_dir, filename) | |
101 frog_bin = os.path.join('.', 'frogsh') | |
102 RunCommand(frog_bin, '--enable_leg', '--verbose', '--throw_on_errors', | |
103 filename, pattern=pattern, exit_code=node_exit_code) | |
104 frog_bin = os.path.join('.', 'frog.py') | |
105 RunCommand(frog_bin, | |
106 '--vm_flags=--enable_type_checks --enable_asserts', | |
107 '--', '--enable_leg', '--verbose', '--throw_on_errors', | |
108 filename, pattern=pattern, exit_code=vm_exit_code) | |
109 | |
110 if __name__ == '__main__': | 89 if __name__ == '__main__': |
111 try: | 90 try: |
112 sys.exit(main(sys.argv)) | 91 sys.exit(main(sys.argv)) |
113 except Error as e: | 92 except Error as e: |
114 sys.stderr.write('%s\n' % e) | 93 sys.stderr.write('%s\n' % e) |
115 sys.exit(1) | 94 sys.exit(1) |
OLD | NEW |