msarett | 114912d | 2015-03-25 12:28:33 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright 2015 Google Inc. |
| 3 | # |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | # |
| 7 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 8 | #!/usr/bin/env python |
| 9 | |
| 10 | usage = ''' |
| 11 | Write extra flags to outfile for DM based on the bot name: |
borenet | 1e37d17 | 2015-03-27 05:42:18 -0700 | [diff] [blame] | 12 | $ python dm_flags.py outfile Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 13 | Or run self-tests: |
| 14 | $ python dm_flags.py test |
| 15 | ''' |
| 16 | |
| 17 | import inspect |
| 18 | import json |
| 19 | import os |
| 20 | import sys |
| 21 | |
| 22 | |
| 23 | def lineno(): |
| 24 | caller = inspect.stack()[1] # Up one level to our caller. |
| 25 | return inspect.getframeinfo(caller[0]).lineno |
| 26 | |
| 27 | |
| 28 | cov_start = lineno()+1 # We care about coverage starting just past this def. |
mtklein | f73e589 | 2015-02-24 11:45:11 -0800 | [diff] [blame] | 29 | def get_args(bot): |
benjaminwagner | 8d61f0d | 2016-01-25 13:02:40 -0800 | [diff] [blame] | 30 | args = ['--pre_log'] |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 31 | |
borenet | d9b6be1 | 2015-05-06 08:33:51 -0700 | [diff] [blame] | 32 | configs = ['565', '8888', 'gpu'] |
borenet | e3aeaec | 2015-05-05 13:11:27 -0700 | [diff] [blame] | 33 | |
borenet | d9b6be1 | 2015-05-06 08:33:51 -0700 | [diff] [blame] | 34 | if 'Android' not in bot: |
| 35 | configs.extend(('upright-matrix-8888', 'upright-matrix-gpu')) |
| 36 | args.extend('--matrix 0 1 1 0'.split(' ')) |
mtklein | fca5c88 | 2015-04-21 10:34:47 -0700 | [diff] [blame] | 37 | |
mtklein | 32618cb | 2015-05-07 10:26:44 -0700 | [diff] [blame] | 38 | if '-GCE-' in bot: |
| 39 | configs.append('sp-8888') |
mtklein | 4a34ecb | 2016-01-08 10:19:35 -0800 | [diff] [blame] | 40 | configs.extend(['twice-8888', '2ndpic-8888']) |
mtklein | ff8b3f0 | 2015-10-17 09:25:21 -0700 | [diff] [blame] | 41 | configs.extend(['remote-8888', 'remote_cache-8888']) |
mtklein | 32618cb | 2015-05-07 10:26:44 -0700 | [diff] [blame] | 42 | |
bsalomon | f93982a | 2015-10-30 09:05:32 -0700 | [diff] [blame] | 43 | if '-TSAN' not in bot: |
| 44 | if ('TegraK1' in bot or |
| 45 | 'GTX550Ti' in bot or |
| 46 | 'GTX660' in bot or |
| 47 | 'GT610' in bot): |
| 48 | if 'Android' in bot: |
| 49 | configs.append('nvprmsaa4') |
| 50 | else: |
| 51 | configs.append('nvprmsaa16') |
mtklein | fca5c88 | 2015-04-21 10:34:47 -0700 | [diff] [blame] | 52 | |
bsalomon | 5abf584 | 2015-02-27 10:13:36 -0800 | [diff] [blame] | 53 | # The S4 crashes and the NP produces a long error stream when we run with |
mtklein | d557462 | 2015-04-21 11:25:47 -0700 | [diff] [blame] | 54 | # MSAA. The Tegra2 and Tegra3 just don't support it. |
bsalomon | 5abf584 | 2015-02-27 10:13:36 -0800 | [diff] [blame] | 55 | if ('GalaxyS4' not in bot and |
mtklein | d557462 | 2015-04-21 11:25:47 -0700 | [diff] [blame] | 56 | 'NexusPlayer' not in bot and |
stephana | deee298 | 2015-05-05 07:55:06 -0700 | [diff] [blame] | 57 | 'Tegra3' not in bot and |
| 58 | 'iOS' not in bot): |
bsalomon | 5abf584 | 2015-02-27 10:13:36 -0800 | [diff] [blame] | 59 | if 'Android' in bot: |
mtklein | fca5c88 | 2015-04-21 10:34:47 -0700 | [diff] [blame] | 60 | configs.append('msaa4') |
bsalomon | 5abf584 | 2015-02-27 10:13:36 -0800 | [diff] [blame] | 61 | else: |
mtklein | fca5c88 | 2015-04-21 10:34:47 -0700 | [diff] [blame] | 62 | configs.append('msaa16') |
mtklein | 82b33db | 2015-03-04 13:58:05 -0800 | [diff] [blame] | 63 | # Runs out of memory on Android bots and Daisy. Everyone else seems fine. |
mtklein | 150d350 | 2015-03-05 13:38:17 -0800 | [diff] [blame] | 64 | if 'Android' not in bot and 'Daisy' not in bot: |
mtklein | 84aada8 | 2015-03-04 11:47:11 -0800 | [diff] [blame] | 65 | configs.append('pdf') |
halcanary | c11c62f | 2015-09-28 11:51:54 -0700 | [diff] [blame] | 66 | configs.append('pdf_poppler') |
bsalomon | 5abf584 | 2015-02-27 10:13:36 -0800 | [diff] [blame] | 67 | |
borenet | 97025e3 | 2015-04-28 09:54:55 -0700 | [diff] [blame] | 68 | # NP is running out of RAM when we run all these modes. skia:3255 |
| 69 | if 'NexusPlayer' not in bot: |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 70 | configs.extend(mode + '-8888' for mode in |
mtklein | 4a34ecb | 2016-01-08 10:19:35 -0800 | [diff] [blame] | 71 | ['serialize', 'tiles_rt', 'pic']) |
bsalomon | 0bb8c1f | 2015-06-04 15:10:45 -0700 | [diff] [blame] | 72 | |
mtklein | ee2a3ea | 2015-02-25 08:16:19 -0800 | [diff] [blame] | 73 | if 'ANGLE' in bot: |
| 74 | configs.append('angle') |
joshualitt | 815d571 | 2015-12-08 09:14:01 -0800 | [diff] [blame] | 75 | |
| 76 | # We want to run gpudft on atleast the mali 400 |
| 77 | if 'GalaxyS3' in bot: |
| 78 | configs.append('gpudft') |
| 79 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 80 | args.append('--config') |
| 81 | args.extend(configs) |
| 82 | |
jcgregorio | bd9dabd | 2016-02-03 08:31:07 -0800 | [diff] [blame] | 83 | # Run tests and gms everywhere, |
| 84 | # and image decoding tests everywhere except GPU bots. |
mtklein | 1866b57 | 2015-06-12 11:31:51 -0700 | [diff] [blame] | 85 | # TODO: remove skp from default --src list? |
jcgregorio | bd9dabd | 2016-02-03 08:31:07 -0800 | [diff] [blame] | 86 | if 'GPU' in bot: |
| 87 | args.extend('--src tests gm'.split(' ')) |
| 88 | else: |
| 89 | args.extend('--src tests gm image'.split(' ')) |
mtklein | 1866b57 | 2015-06-12 11:31:51 -0700 | [diff] [blame] | 90 | |
borenet | 97025e3 | 2015-04-28 09:54:55 -0700 | [diff] [blame] | 91 | if 'GalaxyS' in bot: |
| 92 | args.extend(('--threads', '0')) |
| 93 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 94 | blacklist = [] |
scroggo | c1121ef | 2015-07-16 12:36:10 -0700 | [diff] [blame] | 95 | |
egdaniel | 89c2a54 | 2015-03-19 13:09:17 -0700 | [diff] [blame] | 96 | # Certain gm's on win7 gpu and pdf are never finishing and keeping the test |
| 97 | # running forever |
| 98 | if 'Win7' in bot: |
djsollen | 54416de | 2015-04-03 07:24:48 -0700 | [diff] [blame] | 99 | blacklist.extend('msaa16 gm _ colorwheelnative'.split(' ')) |
| 100 | blacklist.extend('pdf gm _ fontmgr_iter_factory'.split(' ')) |
egdaniel | 89c2a54 | 2015-03-19 13:09:17 -0700 | [diff] [blame] | 101 | |
mtklein | 150d350 | 2015-03-05 13:38:17 -0800 | [diff] [blame] | 102 | if 'Valgrind' in bot: |
mtklein | ce86687 | 2015-03-26 05:12:13 -0700 | [diff] [blame] | 103 | # These take 18+ hours to run. |
djsollen | 54416de | 2015-04-03 07:24:48 -0700 | [diff] [blame] | 104 | blacklist.extend('pdf gm _ fontmgr_iter'.split(' ')) |
| 105 | blacklist.extend('pdf _ _ PANO_20121023_214540.jpg'.split(' ')) |
Mike Klein | fbcf0bd | 2015-04-09 06:03:22 -0400 | [diff] [blame] | 106 | blacklist.extend('pdf skp _ worldjournal'.split(' ')) |
djsollen | 54416de | 2015-04-03 07:24:48 -0700 | [diff] [blame] | 107 | blacklist.extend('pdf skp _ desk_baidu.skp'.split(' ')) |
borenet | 22ecae8 | 2015-04-13 13:29:26 -0700 | [diff] [blame] | 108 | blacklist.extend('pdf skp _ desk_wikipedia.skp'.split(' ')) |
mtklein | 150d350 | 2015-03-05 13:38:17 -0800 | [diff] [blame] | 109 | |
stephana | deee298 | 2015-05-05 07:55:06 -0700 | [diff] [blame] | 110 | if 'iOS' in bot: |
| 111 | blacklist.extend('gpu skp _ _ msaa skp _ _'.split(' ')) |
stephana | deee298 | 2015-05-05 07:55:06 -0700 | [diff] [blame] | 112 | blacklist.extend('msaa16 gm _ tilemodesProcess'.split(' ')) |
| 113 | |
emmaleer | 8f4ba76 | 2015-08-14 07:44:46 -0700 | [diff] [blame] | 114 | # the 32-bit GCE bots run out of memory in DM when running these large images |
| 115 | if 'x86' in bot and not 'x86-64' in bot: |
| 116 | blacklist.extend('_ image _ interlaced1.png'.split(' ')) |
| 117 | blacklist.extend('_ image _ interlaced2.png'.split(' ')) |
| 118 | blacklist.extend('_ image _ interlaced3.png'.split(' ')) |
| 119 | |
mtklein | 5820fe8 | 2016-01-07 07:38:29 -0800 | [diff] [blame] | 120 | # skia:4095 |
| 121 | for test in ['not_native32_bitmap_config', |
| 122 | 'bleed_image', |
| 123 | 'bleed_alpha_image', |
| 124 | 'bleed_alpha_image_shader', |
| 125 | 'blend', |
| 126 | 'c_gms', |
| 127 | 'colortype', |
| 128 | 'colortype_xfermodes', |
| 129 | 'colorwheelnative', |
| 130 | 'drawfilter', |
| 131 | 'fontmgr_bounds_0.75_0', |
| 132 | 'fontmgr_bounds_1_-0.25', |
| 133 | 'fontmgr_bounds', |
| 134 | 'fontmgr_match', |
| 135 | 'fontmgr_iter', |
| 136 | 'lightingshader', |
| 137 | 'localmatriximagefilter', |
| 138 | 'path_stroke_with_zero_length', |
| 139 | 'textblobgeometrychange', |
| 140 | 'verylargebitmap', # Windows only. |
| 141 | 'verylarge_picture_image']: # Windows only. |
| 142 | blacklist.extend(['serialize-8888', 'gm', '_', test]) |
mtklein | 4a34ecb | 2016-01-08 10:19:35 -0800 | [diff] [blame] | 143 | # skia:4769 |
| 144 | for test in ['blend', |
| 145 | 'drawfilter', |
| 146 | 'path_stroke_with_zero_length', |
| 147 | 'textblobgeometrychange']: |
mtklein | 0b558cb | 2016-01-11 06:30:47 -0800 | [diff] [blame] | 148 | blacklist.extend([ 'sp-8888', 'gm', '_', test]) |
| 149 | blacklist.extend([ 'pic-8888', 'gm', '_', test]) |
mtklein | 4a34ecb | 2016-01-08 10:19:35 -0800 | [diff] [blame] | 150 | blacklist.extend(['2ndpic-8888', 'gm', '_', test]) |
mtklein | 4a34ecb | 2016-01-08 10:19:35 -0800 | [diff] [blame] | 151 | for test in ['patch_primitive']: |
| 152 | blacklist.extend(['sp-8888', 'gm', '_', test]) |
mtklein | 0b558cb | 2016-01-11 06:30:47 -0800 | [diff] [blame] | 153 | # skia:4703 |
| 154 | for test in ['image-cacherator-from-picture', |
| 155 | 'image-cacherator-from-raster', |
| 156 | 'image-cacherator-from-ctable']: |
| 157 | blacklist.extend([ 'sp-8888', 'gm', '_', test]) |
| 158 | blacklist.extend([ 'pic-8888', 'gm', '_', test]) |
| 159 | blacklist.extend([ '2ndpic-8888', 'gm', '_', test]) |
| 160 | blacklist.extend(['serialize-8888', 'gm', '_', test]) |
mtklein | 5820fe8 | 2016-01-07 07:38:29 -0800 | [diff] [blame] | 161 | |
scroggo | 1497f9f | 2016-02-02 11:56:33 -0800 | [diff] [blame] | 162 | # NexusPlayer runs out of memory running RAW codec tests |
| 163 | if 'NexusPlayer' in bot: |
| 164 | r = ["arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw", |
| 165 | "ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW"] |
| 166 | for raw_ext in r: |
| 167 | blacklist.extend(('_ image _ .%s' % raw_ext).split(' ')) |
| 168 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 169 | match = [] |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 170 | if 'Valgrind' in bot: # skia:3021 |
| 171 | match.append('~Threaded') |
mtklein | accaf48 | 2015-11-18 07:56:30 -0800 | [diff] [blame] | 172 | |
borenet | 97025e3 | 2015-04-28 09:54:55 -0700 | [diff] [blame] | 173 | if 'GalaxyS3' in bot: # skia:1699 |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 174 | match.append('~WritePixels') |
mtklein | 5820fe8 | 2016-01-07 07:38:29 -0800 | [diff] [blame] | 175 | |
joshualitt | 4541f6e | 2015-12-15 10:46:21 -0800 | [diff] [blame] | 176 | if 'AndroidOne' in bot: # skia:4711 |
| 177 | match.append('~WritePixels') |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 178 | |
mtklein | 4e2d3be | 2015-03-10 11:55:18 -0700 | [diff] [blame] | 179 | if 'NexusPlayer' in bot: |
| 180 | match.append('~ResourceCache') |
| 181 | |
borenet | 9b8d358 | 2015-07-21 05:57:22 -0700 | [diff] [blame] | 182 | if 'GalaxyS4' in bot: # skia:4079 |
| 183 | match.append('~imagefiltersclipped') |
egdaniel | ccb88bc | 2015-10-06 11:20:09 -0700 | [diff] [blame] | 184 | match.append('~imagefilterscropexpand') |
borenet | cf72ed6 | 2015-08-25 06:53:37 -0700 | [diff] [blame] | 185 | match.append('~scaled_tilemodes_npot') |
benjaminwagner | 6fccec3 | 2015-09-24 06:39:06 -0700 | [diff] [blame] | 186 | match.append('~bleed_image') # skia:4367 |
| 187 | match.append('~ReadPixels') # skia:4368 |
borenet | 9b8d358 | 2015-07-21 05:57:22 -0700 | [diff] [blame] | 188 | |
joshualitt | b81ceca | 2015-12-18 06:50:59 -0800 | [diff] [blame] | 189 | if 'ANGLE' in bot and 'Debug' in bot: |
| 190 | match.append('~GLPrograms') # skia:4717 |
| 191 | |
mtklein | e721a8e | 2016-02-06 19:12:23 -0800 | [diff] [blame^] | 192 | # Hacking around trying to get the MSAN bot green. |
| 193 | if 'MSAN' in bot: |
| 194 | # S32A_Opaque_BlitRow32_SSE4's sk_msan_assert_initialized failing on .SRW. |
| 195 | r = ["arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw", |
| 196 | "ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW"] |
| 197 | for raw_ext in r: |
| 198 | blacklist.extend(('_ image _ .%s' % raw_ext).split(' ')) |
| 199 | |
| 200 | blacklist.extend(('_ image _ .wbmp').split(' ')) # skia:4900 |
| 201 | blacklist.extend(('_ image _ .png').split(' ')) # I8 .png color tables |
| 202 | blacklist.extend(('_ image _ .bmp').split(' ')) # I8 .bmp color tables |
| 203 | |
| 204 | match.append('~Codec') # Uninitialzied memory used in PIEX. |
| 205 | match.append('~BlurLargeImage') # Bug in the GM? |
| 206 | match.append('~FontMgrAndroidParser') # expat currently uninstrumented. |
| 207 | |
| 208 | if blacklist: |
| 209 | args.append('--blacklist') |
| 210 | args.extend(blacklist) |
| 211 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 212 | if match: |
| 213 | args.append('--match') |
| 214 | args.extend(match) |
| 215 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 216 | return args |
| 217 | cov_end = lineno() # Don't care about code coverage past here. |
| 218 | |
| 219 | |
| 220 | def self_test(): |
| 221 | import coverage # This way the bots don't need coverage.py to be installed. |
| 222 | args = {} |
| 223 | cases = [ |
mtklein | e4b19c4 | 2015-05-05 10:28:44 -0700 | [diff] [blame] | 224 | 'Pretend-iOS-Bot', |
joshualitt | 4541f6e | 2015-12-15 10:46:21 -0800 | [diff] [blame] | 225 | 'Test-Android-GCC-AndroidOne-GPU-Mali400MP2-Arm7-Release', |
mtklein | fca5c88 | 2015-04-21 10:34:47 -0700 | [diff] [blame] | 226 | 'Test-Android-GCC-Nexus9-GPU-TegraK1-Arm64-Debug', |
borenet | 1e37d17 | 2015-03-27 05:42:18 -0700 | [diff] [blame] | 227 | 'Test-Android-GCC-GalaxyS3-GPU-Mali400-Arm7-Debug', |
mtklein | e4b19c4 | 2015-05-05 10:28:44 -0700 | [diff] [blame] | 228 | 'Test-Android-GCC-GalaxyS4-GPU-SGX544-Arm7-Release', |
borenet | 1e37d17 | 2015-03-27 05:42:18 -0700 | [diff] [blame] | 229 | 'Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release', |
| 230 | 'Test-Android-GCC-NexusPlayer-CPU-SSSE3-x86-Release', |
borenet | 1e37d17 | 2015-03-27 05:42:18 -0700 | [diff] [blame] | 231 | 'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind', |
mtklein | e721a8e | 2016-02-06 19:12:23 -0800 | [diff] [blame^] | 232 | 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN', |
borenet | 1e37d17 | 2015-03-27 05:42:18 -0700 | [diff] [blame] | 233 | 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN', |
| 234 | 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind', |
| 235 | 'Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE', |
msarett | 43432f3 | 2015-11-25 05:36:07 -0800 | [diff] [blame] | 236 | 'Test-Mac10.8-Clang-MacMini4.1-CPU-SSE4-x86_64-Release', |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 237 | ] |
| 238 | |
| 239 | cov = coverage.coverage() |
| 240 | cov.start() |
| 241 | for case in cases: |
mtklein | f73e589 | 2015-02-24 11:45:11 -0800 | [diff] [blame] | 242 | args[case] = get_args(case) |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 243 | cov.stop() |
| 244 | |
| 245 | this_file = os.path.basename(__file__) |
| 246 | _, _, not_run, _ = cov.analysis(this_file) |
| 247 | filtered = [line for line in not_run if line > cov_start and line < cov_end] |
| 248 | if filtered: |
| 249 | print 'Lines not covered by test cases: ', filtered |
| 250 | sys.exit(1) |
| 251 | |
| 252 | golden = this_file.replace('.py', '.json') |
| 253 | with open(os.path.join(os.path.dirname(__file__), golden), 'w') as f: |
| 254 | json.dump(args, f, indent=2, sort_keys=True) |
| 255 | |
| 256 | |
| 257 | if __name__ == '__main__': |
| 258 | if len(sys.argv) == 2 and sys.argv[1] == 'test': |
| 259 | self_test() |
| 260 | sys.exit(0) |
| 261 | |
| 262 | if len(sys.argv) != 3: |
| 263 | print usage |
| 264 | sys.exit(1) |
| 265 | |
| 266 | with open(sys.argv[1], 'w') as out: |
mtklein | f73e589 | 2015-02-24 11:45:11 -0800 | [diff] [blame] | 267 | json.dump(get_args(sys.argv[2]), out) |