OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Defer to run_test_cases.py.""" | 6 """Defer to run_test_cases.py.""" |
7 | 7 |
8 import os | 8 import os |
9 import optparse | 9 import optparse |
10 import sys | 10 import sys |
(...skipping 19 matching lines...) Expand all Loading... |
30 # run_test_cases so automatic flaky test workaround is still used. | 30 # run_test_cases so automatic flaky test workaround is still used. |
31 run_test_cases_extra_args.append('-j1') | 31 run_test_cases_extra_args.append('-j1') |
32 rest.append(arg) | 32 rest.append(arg) |
33 elif 'browser_tests' in arg: | 33 elif 'browser_tests' in arg: |
34 # Test cases in this executable fire up *a lot* of child processes, | 34 # Test cases in this executable fire up *a lot* of child processes, |
35 # causing huge memory bottleneck. So use less than N-cpus jobs. | 35 # causing huge memory bottleneck. So use less than N-cpus jobs. |
36 run_test_cases_extra_args.append('--use-less-jobs') | 36 run_test_cases_extra_args.append('--use-less-jobs') |
37 rest.append(arg) | 37 rest.append(arg) |
38 else: | 38 else: |
39 rest.append(arg) | 39 rest.append(arg) |
| 40 |
| 41 # Use --jobs arg if exist. |
| 42 for arg in args: |
| 43 if arg.startswith('--jobs='): |
| 44 run_test_cases_extra_args.append(arg) |
| 45 break |
| 46 |
40 return run_test_cases_extra_args, rest | 47 return run_test_cases_extra_args, rest |
41 | 48 |
42 | 49 |
43 def main(): | 50 def main(): |
44 parser = optparse.OptionParser() | 51 parser = optparse.OptionParser() |
45 | 52 |
46 group = optparse.OptionGroup( | 53 group = optparse.OptionGroup( |
47 parser, 'Compability flag with the old sharding_supervisor') | 54 parser, 'Compability flag with the old sharding_supervisor') |
48 group.add_option( | 55 group.add_option( |
49 '--no-color', action='store_true', help='Ignored') | 56 '--no-color', action='store_true', help='Ignored') |
(...skipping 24 matching lines...) Expand all Loading... |
74 | 81 |
75 run_test_cases_extra_args, rest = pop_known_arguments(args) | 82 run_test_cases_extra_args, rest = pop_known_arguments(args) |
76 | 83 |
77 import run_test_cases # pylint: disable=F0401 | 84 import run_test_cases # pylint: disable=F0401 |
78 | 85 |
79 return run_test_cases.main(cmd + run_test_cases_extra_args + ['--'] + rest) | 86 return run_test_cases.main(cmd + run_test_cases_extra_args + ['--'] + rest) |
80 | 87 |
81 | 88 |
82 if __name__ == '__main__': | 89 if __name__ == '__main__': |
83 sys.exit(main()) | 90 sys.exit(main()) |
OLD | NEW |