| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 3 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| 4 # | 4 # |
| 5 # Use of this source code is governed by a BSD-style license | 5 # Use of this source code is governed by a BSD-style license |
| 6 # that can be found in the LICENSE file in the root of the source | 6 # that can be found in the LICENSE file in the root of the source |
| 7 # tree. An additional intellectual property rights grant can be found | 7 # tree. An additional intellectual property rights grant can be found |
| 8 # in the file PATENTS. All contributing project authors may | 8 # in the file PATENTS. All contributing project authors may |
| 9 # be found in the AUTHORS file in the root of the source tree. | 9 # be found in the AUTHORS file in the root of the source tree. |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 | 53 |
| 54 def main(): | 54 def main(): |
| 55 # Ignore '--'. Options unprocessed by this script will be passed to the test | 55 # Ignore '--'. Options unprocessed by this script will be passed to the test |
| 56 # as arguments. | 56 # as arguments. |
| 57 if '--' in sys.argv: | 57 if '--' in sys.argv: |
| 58 del sys.argv[sys.argv.index('--')] | 58 del sys.argv[sys.argv.index('--')] |
| 59 | 59 |
| 60 parser = argparse.ArgumentParser() | 60 parser = argparse.ArgumentParser() |
| 61 parser.add_argument('--isolated-script-test-output', type=str, default=None) | 61 parser.add_argument('--isolated-script-test-output', type=str, default=None) |
| 62 |
| 63 # TODO(ehmaldonado): Implement this flag instead of just "eating" it. |
| 64 parser.add_argument('--isolated-script-test-chartjson-output', type=str, |
| 65 default=None) |
| 66 |
| 62 parser.add_argument('--output_dir', type=str, default=None) | 67 parser.add_argument('--output_dir', type=str, default=None) |
| 63 parser.add_argument('--timeout', type=int, default=None) | 68 parser.add_argument('--timeout', type=int, default=None) |
| 64 | 69 |
| 65 # GTEST_SHARD_INDEX and GTEST_TOTAL_SHARDS must be removed from the | 70 # GTEST_SHARD_INDEX and GTEST_TOTAL_SHARDS must be removed from the |
| 66 # environment. Otherwise it will be picked up by the binary, causing a bug | 71 # environment. Otherwise it will be picked up by the binary, causing a bug |
| 67 # where only tests in the first shard are executed. | 72 # where only tests in the first shard are executed. |
| 68 test_env = os.environ.copy() | 73 test_env = os.environ.copy() |
| 69 gtest_shard_index = test_env.pop('GTEST_SHARD_INDEX', '0') | 74 gtest_shard_index = test_env.pop('GTEST_SHARD_INDEX', '0') |
| 70 gtest_total_shards = test_env.pop('GTEST_TOTAL_SHARDS', '1') | 75 gtest_total_shards = test_env.pop('GTEST_TOTAL_SHARDS', '1') |
| 71 | 76 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 logs = [os.path.join(logs_dir, log) for log in os.listdir(logs_dir)] | 128 logs = [os.path.join(logs_dir, log) for log in os.listdir(logs_dir)] |
| 124 log_file = os.path.join(options.output_dir, '%s-tests.log' % test_status) | 129 log_file = os.path.join(options.output_dir, '%s-tests.log' % test_status) |
| 125 cat_files(logs, log_file) | 130 cat_files(logs, log_file) |
| 126 os.rmdir(logs_dir) | 131 os.rmdir(logs_dir) |
| 127 | 132 |
| 128 return exit_code | 133 return exit_code |
| 129 | 134 |
| 130 | 135 |
| 131 if __name__ == '__main__': | 136 if __name__ == '__main__': |
| 132 sys.exit(main()) | 137 sys.exit(main()) |
| OLD | NEW |