| OLD | NEW |
| 1 # | 1 # |
| 2 # Copyright 2015 Google Inc. | 2 # Copyright 2015 Google Inc. |
| 3 # | 3 # |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 # | 6 # |
| 7 | 7 |
| 8 #!/usr/bin/env python | 8 #!/usr/bin/env python |
| 9 | 9 |
| 10 usage = ''' | 10 usage = ''' |
| 11 Write extra flags to outfile for DM based on the bot name: | 11 Write extra flags to outfile for DM based on the bot name: |
| 12 $ python dm_flags.py outfile Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug | 12 $ python dm_flags.py outfile Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug |
| 13 Or run self-tests: | 13 Or run self-tests: |
| 14 $ python dm_flags.py test | 14 $ python dm_flags.py test |
| 15 ''' | 15 ''' |
| 16 | 16 |
| 17 import inspect | 17 import inspect |
| 18 import json | 18 import json |
| 19 import os | 19 import os |
| 20 import sys | 20 import sys |
| 21 | 21 |
| 22 | 22 |
| 23 def lineno(): | 23 def lineno(): |
| 24 caller = inspect.stack()[1] # Up one level to our caller. | 24 caller = inspect.stack()[1] # Up one level to our caller. |
| 25 return inspect.getframeinfo(caller[0]).lineno | 25 return inspect.getframeinfo(caller[0]).lineno |
| 26 | 26 |
| 27 | 27 |
| 28 cov_start = lineno()+1 # We care about coverage starting just past this def. | 28 cov_start = lineno()+1 # We care about coverage starting just past this def. |
| 29 def get_args(bot): | 29 def get_args(bot): |
| 30 args = ['--pre_log'] | 30 args = [] |
| 31 | 31 |
| 32 configs = ['565', '8888', 'gpu'] | 32 configs = ['565', '8888', 'gpu'] |
| 33 | 33 |
| 34 if 'Android' not in bot: | 34 if 'Android' not in bot: |
| 35 configs.extend(('upright-matrix-8888', 'upright-matrix-gpu')) | 35 configs.extend(('upright-matrix-8888', 'upright-matrix-gpu')) |
| 36 args.extend('--matrix 0 1 1 0'.split(' ')) | 36 args.extend('--matrix 0 1 1 0'.split(' ')) |
| 37 | 37 |
| 38 if '-GCE-' in bot: | 38 if '-GCE-' in bot: |
| 39 configs.append('sp-8888') | 39 configs.append('sp-8888') |
| 40 configs.extend(['twice-8888', '2ndpic-8888']) | 40 configs.extend(['twice-8888', '2ndpic-8888']) |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 if len(sys.argv) == 2 and sys.argv[1] == 'test': | 249 if len(sys.argv) == 2 and sys.argv[1] == 'test': |
| 250 self_test() | 250 self_test() |
| 251 sys.exit(0) | 251 sys.exit(0) |
| 252 | 252 |
| 253 if len(sys.argv) != 3: | 253 if len(sys.argv) != 3: |
| 254 print usage | 254 print usage |
| 255 sys.exit(1) | 255 sys.exit(1) |
| 256 | 256 |
| 257 with open(sys.argv[1], 'w') as out: | 257 with open(sys.argv[1], 'w') as out: |
| 258 json.dump(get_args(sys.argv[2]), out) | 258 json.dump(get_args(sys.argv[2]), out) |
| OLD | NEW |