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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 | 63 |
| 64 RunCommand('../tools/build.py', '--mode=release') | 64 RunCommand('../tools/build.py', '--mode=release') |
| 65 test_cmd = ['../tools/test.py', '--component=frog,frogsh', | 65 test_cmd = ['../tools/test.py', '--component=frog,frogsh', |
| 66 '--report', '--timeout=5', '--progress=color', | 66 '--report', '--timeout=5', '--progress=color', |
| 67 '--mode=release'] | 67 '--mode=release'] |
| 68 if args[1:]: | 68 if args[1:]: |
| 69 test_cmd.extend(args[1:]) | 69 test_cmd.extend(args[1:]) |
| 70 else: | 70 else: |
| 71 test_cmd.extend(['language', 'corelib', 'leg', 'peg']) | 71 test_cmd.extend(['language', 'corelib', 'leg', 'peg']) |
| 72 RunCommand(*test_cmd, verbose=True) | 72 RunCommand(*test_cmd, verbose=True) |
| 73 | |
| 74 print 'Running tests on leg' | |
| 75 test_cmd[1] = '--component=leg' | |
|
kasperl
2011/11/04 10:13:00
This seems easy to break. Maybe long-term this cou
ngeoffray
2011/11/04 10:16:44
I can actually just add leg as a component line 65
kasperl
2011/11/04 10:21:01
Much better.
| |
| 76 RunCommand(*test_cmd, verbose=True) | |
| 77 | |
| 73 leg_test_dir = os.path.join('leg', 'tests') | 78 leg_test_dir = os.path.join('leg', 'tests') |
| 74 for current_dir, directories, filenames in os.walk(leg_test_dir): | 79 for current_dir, directories, filenames in os.walk(leg_test_dir): |
| 75 for filename in filenames: | 80 for filename in filenames: |
| 76 if filename.endswith('.dart'): | 81 if filename.endswith('.dart'): |
| 77 pattern = 'info: [leg] compilation succeeded' | 82 pattern = 'info: [leg] compilation succeeded' |
| 78 node_exit_code = 0 | 83 node_exit_code = 0 |
| 79 vm_exit_code = 0 | 84 vm_exit_code = 0 |
| 80 if filename == 'empty.dart': | 85 if filename == 'empty.dart': |
| 81 pattern = 'info: [leg] compiler cancelled: Could not find main' | 86 pattern = 'info: [leg] compiler cancelled: Could not find main' |
| 82 node_exit_code = 1 | 87 node_exit_code = 1 |
| 83 vm_exit_code = 255 # Sigh. | 88 vm_exit_code = 255 # Sigh. |
| 84 filename = os.path.join(current_dir, filename) | 89 filename = os.path.join(current_dir, filename) |
| 85 frog_bin = os.path.join('.', 'frogsh') | 90 frog_bin = os.path.join('.', 'frogsh') |
| 86 RunCommand(frog_bin, '--enable_leg', '--verbose', '--throw_on_errors', | 91 RunCommand(frog_bin, '--enable_leg', '--verbose', '--throw_on_errors', |
| 87 filename, pattern=pattern, exit_code=node_exit_code) | 92 filename, pattern=pattern, exit_code=node_exit_code) |
| 88 frog_bin = os.path.join('.', 'frog.py') | 93 frog_bin = os.path.join('.', 'frog.py') |
| 89 RunCommand(frog_bin, | 94 RunCommand(frog_bin, |
| 90 '--vm_flags=--enable_type_checks --enable_asserts', | 95 '--vm_flags=--enable_type_checks --enable_asserts', |
| 91 '--', '--enable_leg', '--verbose', '--throw_on_errors', | 96 '--', '--enable_leg', '--verbose', '--throw_on_errors', |
| 92 filename, pattern=pattern, exit_code=vm_exit_code) | 97 filename, pattern=pattern, exit_code=vm_exit_code) |
| 93 | 98 |
| 94 if __name__ == '__main__': | 99 if __name__ == '__main__': |
| 95 try: | 100 try: |
| 96 sys.exit(main(sys.argv)) | 101 sys.exit(main(sys.argv)) |
| 97 except Error as e: | 102 except Error as e: |
| 98 sys.stderr.write('%s\n' % e) | 103 sys.stderr.write('%s\n' % e) |
| 99 sys.exit(1) | 104 sys.exit(1) |
| OLD | NEW |