| OLD | NEW |
| 1 # Copyright 2013 the V8 project authors. All rights reserved. | 1 # Copyright 2013 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 if len(sys.argv) < 4: | 39 if len(sys.argv) < 4: |
| 40 error_message = ('Usage:' + sys.argv[0] + | 40 error_message = ('Usage:' + sys.argv[0] + |
| 41 'LEXER_SHELL_PATH FILE_LIST_FILE PARALLEL_PROCESS_COUNT ' + | 41 'LEXER_SHELL_PATH FILE_LIST_FILE PARALLEL_PROCESS_COUNT ' + |
| 42 '[OTHER_ARGS]') | 42 '[OTHER_ARGS]') |
| 43 print >> sys.stderr, error_message | 43 print >> sys.stderr, error_message |
| 44 sys.exit(1) | 44 sys.exit(1) |
| 45 lexer_shell = sys.argv[1] | 45 lexer_shell = sys.argv[1] |
| 46 file_file = sys.argv[2] | 46 file_file = sys.argv[2] |
| 47 process_count = int(sys.argv[3]) | 47 process_count = int(sys.argv[3]) |
| 48 with open(file_file, 'r') as f: | 48 with open(file_file, 'r') as f: |
| 49 test_files = f.read().split('\n') | 49 test_files = [filename for filename in f.read().split('\n') if filename] |
| 50 | 50 |
| 51 with open('/dev/null', 'w') as dev_null: | 51 with open('/dev/null', 'w') as dev_null: |
| 52 processes = [] | 52 processes = [] |
| 53 for i, f in enumerate(test_files): | 53 for i, f in enumerate(test_files): |
| 54 lexer_shell_args = [lexer_shell, f, '--break-after-illegal'] + sys.argv[4:
] | 54 lexer_shell_args = [lexer_shell, f, '--break-after-illegal'] + sys.argv[4:
] |
| 55 processes.append((f, subprocess.Popen(lexer_shell_args, stdout=dev_null))) | 55 processes.append((f, subprocess.Popen(lexer_shell_args, stdout=dev_null))) |
| 56 if i % process_count == process_count - 1: | 56 if i % process_count == process_count - 1: |
| 57 wait_processes(processes) | 57 wait_processes(processes) |
| 58 processes = [] | 58 processes = [] |
| 59 | 59 |
| 60 wait_processes(processes) | 60 wait_processes(processes) |
| OLD | NEW |