OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 |
| 3 usage = ''' |
| 4 Write extra flags to outfile for DM based on the bot name: |
| 5 $ python dm_flags.py outfile Test-Mac10.9-MacMini6.2-HD4000-x86_64-Release |
| 6 Or run self-tests: |
| 7 $ python dm_flags.py test |
| 8 ''' |
| 9 |
| 10 import inspect |
| 11 import json |
| 12 import os |
| 13 import sys |
| 14 |
| 15 |
| 16 def lineno(): |
| 17 caller = inspect.stack()[1] # Up one level to our caller. |
| 18 return inspect.getframeinfo(caller[0]).lineno |
| 19 |
| 20 |
| 21 cov_start = lineno()+1 # We care about coverage starting just past this def. |
| 22 def get_dm_args(bot): |
| 23 args = [] |
| 24 |
| 25 configs = ['565', '8888', 'gpu', 'nvprmsaa'] |
| 26 # Xoom and NP are running out of RAM when we run all these modes. skia:3255 |
| 27 if ('Xoom' not in bot and |
| 28 'NexusPlayer' not in bot): |
| 29 configs.extend(mode + '-8888' for mode in |
| 30 ['serialize', 'tiles_rt', 'pipe']) |
| 31 configs.append('tiles_rt-gpu') |
| 32 if 'ANGLE' in bot: |
| 33 configs.append('angle') |
| 34 args.append('--config') |
| 35 args.extend(configs) |
| 36 |
| 37 blacklist = [] |
| 38 # This image is too large to be a texture for many GPUs. |
| 39 blacklist.extend('gpu _ PANO_20121023_214540.jpg'.split(' ')) |
| 40 blacklist.extend('msaa _ PANO_20121023_214540.jpg'.split(' ')) |
| 41 |
| 42 # Drawing SKPs or images into GPU canvases is a New Thing. |
| 43 # It seems like we're running out of RAM on some Android bots, so start off |
| 44 # with a very wide blacklist disabling all these tests on all Android bots. |
| 45 if 'Android' in bot: # skia:3255 |
| 46 blacklist.extend('gpu skp _ gpu image _ gpu subset _'.split(' ')) |
| 47 blacklist.extend('msaa skp _ msaa image _ gpu subset _'.split(' ')) |
| 48 |
| 49 if blacklist: |
| 50 args.append('--blacklist') |
| 51 args.extend(blacklist) |
| 52 |
| 53 match = [] |
| 54 if 'Alex' in bot: # skia:2793 |
| 55 # This machine looks to be running out of heap. |
| 56 # Running with fewer threads may help. |
| 57 args.extend(['--threads', '1']) |
| 58 if 'Valgrind' in bot: # skia:3021 |
| 59 match.append('~Threaded') |
| 60 if 'Xoom' in bot: # skia:1699 |
| 61 match.append('~WritePixels') |
| 62 |
| 63 # skia:3249: these images flakily don't decode on Android. |
| 64 if 'Android' in bot: |
| 65 match.append('~tabl_mozilla_0') |
| 66 match.append('~desk_yahoonews_0') |
| 67 |
| 68 if match: |
| 69 args.append('--match') |
| 70 args.extend(match) |
| 71 |
| 72 # Though their GPUs are interesting, these don't test anything on |
| 73 # the CPU that other ARMv7+NEON bots don't test faster (N5). |
| 74 if ('Nexus10' in bot or |
| 75 'Nexus7' in bot or |
| 76 'GalaxyS3' in bot or |
| 77 'GalaxyS4' in bot): |
| 78 args.append('--nocpu') |
| 79 return args |
| 80 cov_end = lineno() # Don't care about code coverage past here. |
| 81 |
| 82 |
| 83 def self_test(): |
| 84 import coverage # This way the bots don't need coverage.py to be installed. |
| 85 args = {} |
| 86 cases = [ |
| 87 'Test-Android-Nexus7-Tegra3-Arm7-Release', |
| 88 'Test-Android-Xoom-Tegra2-Arm7-Release', |
| 89 'Test-ChromeOS-Alex-GMA3150-x86-Debug', |
| 90 'Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind', |
| 91 'Test-Win7-ShuttleA-HD2000-x86-Debug-ANGLE', |
| 92 ] |
| 93 |
| 94 cov = coverage.coverage() |
| 95 cov.start() |
| 96 for case in cases: |
| 97 args[case] = get_dm_args(case) |
| 98 cov.stop() |
| 99 |
| 100 this_file = os.path.basename(__file__) |
| 101 _, _, not_run, _ = cov.analysis(this_file) |
| 102 filtered = [line for line in not_run if line > cov_start and line < cov_end] |
| 103 if filtered: |
| 104 print 'Lines not covered by test cases: ', filtered |
| 105 sys.exit(1) |
| 106 |
| 107 golden = this_file.replace('.py', '.json') |
| 108 with open(os.path.join(os.path.dirname(__file__), golden), 'w') as f: |
| 109 json.dump(args, f, indent=2, sort_keys=True) |
| 110 |
| 111 |
| 112 if __name__ == '__main__': |
| 113 if len(sys.argv) == 2 and sys.argv[1] == 'test': |
| 114 self_test() |
| 115 sys.exit(0) |
| 116 |
| 117 if len(sys.argv) != 3: |
| 118 print usage |
| 119 sys.exit(1) |
| 120 |
| 121 with open(sys.argv[1], 'w') as out: |
| 122 json.dump(get_dm_args(sys.argv[2]), out) |
OLD | NEW |