blob: debc4259776cffccc4202f2a96f171fa009e7e8d [file] [log] [blame]
msarett114912d2015-03-25 12:28:33 -07001#
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
mtklein11a2c502015-02-24 09:25:16 -08008#!/usr/bin/env python
9
10usage = '''
11Write extra flags to outfile for DM based on the bot name:
borenet1e37d172015-03-27 05:42:18 -070012 $ python dm_flags.py outfile Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug
mtklein11a2c502015-02-24 09:25:16 -080013Or run self-tests:
14 $ python dm_flags.py test
15'''
16
17import inspect
18import json
19import os
20import sys
21
22
23def lineno():
24 caller = inspect.stack()[1] # Up one level to our caller.
25 return inspect.getframeinfo(caller[0]).lineno
26
27
28cov_start = lineno()+1 # We care about coverage starting just past this def.
mtkleinf73e5892015-02-24 11:45:11 -080029def get_args(bot):
mtkleind9381ac2016-02-24 08:58:27 -080030 args = []
mtklein11a2c502015-02-24 09:25:16 -080031
mtkleind33fe1f2016-03-22 11:08:24 -070032 # 32-bit desktop bots tend to run out of memory, because they have relatively
33 # far more cores than RAM (e.g. 32 cores, 3G RAM). Hold them back a bit.
34 if '-x86-' in bot and not 'NexusPlayer' in bot:
mtkleinbee39c52016-03-22 12:36:01 -070035 args.extend('--threads 4'.split(' '))
mtkleind33fe1f2016-03-22 11:08:24 -070036
bsalomon3ddf9672016-04-06 09:22:36 -070037 # These are the canonical configs that we would ideally run on all bots. We
38 # may opt out or substitute some below for specific bots
39 configs = ['565', '8888', 'gpu', 'gpusrgb', 'pdf']
40 # Add in either msaa4 or msaa16 to the canonical set of configs to run
41 if 'Android' in bot or 'iOS' in bot:
42 configs.append('msaa4')
43 else:
44 configs.append('msaa16')
45
46 # With msaa, the S4 crashes and the NP produces a long error stream when we
47 # run with MSAA. The Tegra2 and Tegra3 just don't support it. No record of
48 # why we're not running msaa on iOS, probably started with gpu config and just
49 # haven't tried.
50 if ('GalaxyS4' in bot or
51 'NexusPlayer' in bot or
52 'Tegra3' in bot or
53 'iOS' in bot):
54 configs = [x for x in configs if 'msaa' not in x]
55
56 # Runs out of memory on Android bots and Daisy. Everyone else seems fine.
57 if 'Android' in bot or 'Daisy' in bot:
58 configs.remove('pdf')
borenete3aeaec2015-05-05 13:11:27 -070059
mtkleindd54e5d2016-02-29 09:51:09 -080060 if '-GCE-' in bot:
mtkleined854fb2016-03-02 17:15:15 -080061 configs.extend(['f16', 'srgb']) # Gamma-correct formats.
62 configs.extend(['sp-8888', '2ndpic-8888']) # Test niche uses of SkPicture.
mtkleindd54e5d2016-02-29 09:51:09 -080063
bsalomonf93982a2015-10-30 09:05:32 -070064 if '-TSAN' not in bot:
65 if ('TegraK1' in bot or
66 'GTX550Ti' in bot or
67 'GTX660' in bot or
68 'GT610' in bot):
69 if 'Android' in bot:
cdaltonc28afdb2016-03-29 20:05:07 -070070 configs.append('nvprdit4')
bsalomonf93982a2015-10-30 09:05:32 -070071 else:
cdaltonc28afdb2016-03-29 20:05:07 -070072 configs.append('nvprdit16')
mtkleinfca5c882015-04-21 10:34:47 -070073
bsalomonb8797bb2016-04-05 08:49:38 -070074 # We want to test the OpenGL config not the GLES config on the X1
75 if 'TegraX1' in bot:
bsalomon3ddf9672016-04-06 09:22:36 -070076 configs = [x.replace('gpu', 'gl') for x in configs]
77 configs = [x.replace('msaa', 'glmsaa') for x in configs]
mtklein083b8692016-04-06 12:27:07 -070078
borenet97025e32015-04-28 09:54:55 -070079 # NP is running out of RAM when we run all these modes. skia:3255
80 if 'NexusPlayer' not in bot:
mtklein11a2c502015-02-24 09:25:16 -080081 configs.extend(mode + '-8888' for mode in
mtklein4a34ecb2016-01-08 10:19:35 -080082 ['serialize', 'tiles_rt', 'pic'])
bsalomon0bb8c1f2015-06-04 15:10:45 -070083
mtkleinee2a3ea2015-02-25 08:16:19 -080084 if 'ANGLE' in bot:
85 configs.append('angle')
joshualitt815d5712015-12-08 09:14:01 -080086
87 # We want to run gpudft on atleast the mali 400
88 if 'GalaxyS3' in bot:
89 configs.append('gpudft')
90
borenet48b88cc2016-04-11 10:16:01 -070091 # CommandBuffer bot *only* runs the command_buffer config.
92 if 'CommandBuffer' in bot:
borenet903ec3c2016-04-13 06:00:42 -070093 configs = ['commandbuffer']
borenet48b88cc2016-04-11 10:16:01 -070094
borenet71e185c2016-04-12 08:13:56 -070095 # Vulkan bot *only* runs the vk config.
96 if 'Vulkan' in bot:
97 configs = ['vk']
98
mtklein11a2c502015-02-24 09:25:16 -080099 args.append('--config')
100 args.extend(configs)
101
msarett13a036b2016-02-08 09:10:47 -0800102 # Run tests, gms, and image decoding tests everywhere.
msarett13a036b2016-02-08 09:10:47 -0800103 args.extend('--src tests gm image'.split(' '))
mtklein1866b572015-06-12 11:31:51 -0700104
borenet97025e32015-04-28 09:54:55 -0700105 if 'GalaxyS' in bot:
106 args.extend(('--threads', '0'))
107
mtklein11a2c502015-02-24 09:25:16 -0800108 blacklist = []
scroggoc1121ef2015-07-16 12:36:10 -0700109
mtklein7fe18a82016-03-01 12:17:33 -0800110 # TODO: ???
111 blacklist.extend('f16 _ _ dstreadshuffle'.split(' '))
112 blacklist.extend('f16 image _ _'.split(' '))
113 blacklist.extend('srgb image _ _'.split(' '))
brianosman61d3b082016-03-30 11:19:36 -0700114 blacklist.extend('gpusrgb image _ _'.split(' '))
mtklein7fe18a82016-03-01 12:17:33 -0800115
egdaniel89c2a542015-03-19 13:09:17 -0700116 # Certain gm's on win7 gpu and pdf are never finishing and keeping the test
117 # running forever
118 if 'Win7' in bot:
djsollen54416de2015-04-03 07:24:48 -0700119 blacklist.extend('msaa16 gm _ colorwheelnative'.split(' '))
120 blacklist.extend('pdf gm _ fontmgr_iter_factory'.split(' '))
egdaniel89c2a542015-03-19 13:09:17 -0700121
mtklein150d3502015-03-05 13:38:17 -0800122 if 'Valgrind' in bot:
mtkleince866872015-03-26 05:12:13 -0700123 # These take 18+ hours to run.
djsollen54416de2015-04-03 07:24:48 -0700124 blacklist.extend('pdf gm _ fontmgr_iter'.split(' '))
125 blacklist.extend('pdf _ _ PANO_20121023_214540.jpg'.split(' '))
Mike Kleinfbcf0bd2015-04-09 06:03:22 -0400126 blacklist.extend('pdf skp _ worldjournal'.split(' '))
djsollen54416de2015-04-03 07:24:48 -0700127 blacklist.extend('pdf skp _ desk_baidu.skp'.split(' '))
borenet22ecae82015-04-13 13:29:26 -0700128 blacklist.extend('pdf skp _ desk_wikipedia.skp'.split(' '))
mtklein150d3502015-03-05 13:38:17 -0800129
stephanadeee2982015-05-05 07:55:06 -0700130 if 'iOS' in bot:
131 blacklist.extend('gpu skp _ _ msaa skp _ _'.split(' '))
stephanadeee2982015-05-05 07:55:06 -0700132 blacklist.extend('msaa16 gm _ tilemodesProcess'.split(' '))
133
msarett18976312016-03-09 14:20:58 -0800134 if 'Mac' in bot or 'iOS' in bot:
msarett5a609822016-03-17 10:45:41 -0700135 # CG fails on questionable bmps
msarett18976312016-03-09 14:20:58 -0800136 blacklist.extend('_ image gen_platf rgba32abf.bmp'.split(' '))
137 blacklist.extend('_ image gen_platf rgb24prof.bmp'.split(' '))
138 blacklist.extend('_ image gen_platf rgb24lprof.bmp'.split(' '))
139 blacklist.extend('_ image gen_platf 8bpp-pixeldata-cropped.bmp'.split(' '))
140 blacklist.extend('_ image gen_platf 4bpp-pixeldata-cropped.bmp'.split(' '))
141 blacklist.extend('_ image gen_platf 32bpp-pixeldata-cropped.bmp'.split(' '))
142 blacklist.extend('_ image gen_platf 24bpp-pixeldata-cropped.bmp'.split(' '))
mtkleind33fe1f2016-03-22 11:08:24 -0700143
msarett5a609822016-03-17 10:45:41 -0700144 # CG has unpredictable behavior on this questionable gif
145 # It's probably using uninitialized memory
146 blacklist.extend('_ image gen_platf frame_larger_than_image.gif'.split(' '))
msarett18976312016-03-09 14:20:58 -0800147
msarettfc0b6d12016-03-17 13:50:17 -0700148 # WIC fails on questionable bmps
149 if 'Win' in bot:
150 blacklist.extend('_ image gen_platf rle8-height-negative.bmp'.split(' '))
151 blacklist.extend('_ image gen_platf rle4-height-negative.bmp'.split(' '))
152 blacklist.extend('_ image gen_platf pal8os2v2.bmp'.split(' '))
153 blacklist.extend('_ image gen_platf pal8os2v2-16.bmp'.split(' '))
154 blacklist.extend('_ image gen_platf rgba32abf.bmp'.split(' '))
155 blacklist.extend('_ image gen_platf rgb24prof.bmp'.split(' '))
156 blacklist.extend('_ image gen_platf rgb24lprof.bmp'.split(' '))
157 blacklist.extend('_ image gen_platf 8bpp-pixeldata-cropped.bmp'.split(' '))
158 blacklist.extend('_ image gen_platf 4bpp-pixeldata-cropped.bmp'.split(' '))
159 blacklist.extend('_ image gen_platf 32bpp-pixeldata-cropped.bmp'.split(' '))
160 blacklist.extend('_ image gen_platf 24bpp-pixeldata-cropped.bmp'.split(' '))
161
mtklein5820fe82016-01-07 07:38:29 -0800162 # skia:4095
163 for test in ['not_native32_bitmap_config',
164 'bleed_image',
165 'bleed_alpha_image',
166 'bleed_alpha_image_shader',
mtklein5820fe82016-01-07 07:38:29 -0800167 'c_gms',
168 'colortype',
169 'colortype_xfermodes',
mtklein5820fe82016-01-07 07:38:29 -0800170 'drawfilter',
171 'fontmgr_bounds_0.75_0',
172 'fontmgr_bounds_1_-0.25',
173 'fontmgr_bounds',
174 'fontmgr_match',
175 'fontmgr_iter',
mtklein5820fe82016-01-07 07:38:29 -0800176 'verylargebitmap', # Windows only.
177 'verylarge_picture_image']: # Windows only.
178 blacklist.extend(['serialize-8888', 'gm', '_', test])
mtklein4a34ecb2016-01-08 10:19:35 -0800179 # skia:4769
mtklein48156ed2016-04-06 14:25:35 -0700180 for test in ['drawfilter']:
mtkleindd54e5d2016-02-29 09:51:09 -0800181 blacklist.extend([ 'sp-8888', 'gm', '_', test])
182 blacklist.extend([ 'pic-8888', 'gm', '_', test])
183 blacklist.extend(['2ndpic-8888', 'gm', '_', test])
mtklein0b558cb2016-01-11 06:30:47 -0800184 # skia:4703
185 for test in ['image-cacherator-from-picture',
186 'image-cacherator-from-raster',
187 'image-cacherator-from-ctable']:
mtkleindd54e5d2016-02-29 09:51:09 -0800188 blacklist.extend([ 'sp-8888', 'gm', '_', test])
mtklein0b558cb2016-01-11 06:30:47 -0800189 blacklist.extend([ 'pic-8888', 'gm', '_', test])
mtkleindd54e5d2016-02-29 09:51:09 -0800190 blacklist.extend([ '2ndpic-8888', 'gm', '_', test])
mtklein0b558cb2016-01-11 06:30:47 -0800191 blacklist.extend(['serialize-8888', 'gm', '_', test])
mtklein5820fe82016-01-07 07:38:29 -0800192
scroggo3ac66e92016-02-08 15:09:48 -0800193 # Extensions for RAW images
msarett772cc402016-02-08 11:43:50 -0800194 r = ["arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw",
195 "ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW"]
196
msarett772cc402016-02-08 11:43:50 -0800197 # skbug.com/4888
mtkleinbee39c52016-03-22 12:36:01 -0700198 # Blacklist RAW images (and a few large PNGs) on GPU bots
199 # until we can resolve failures
msarett772cc402016-02-08 11:43:50 -0800200 if 'GPU' in bot:
mtkleinbee39c52016-03-22 12:36:01 -0700201 blacklist.extend('_ image _ interlaced1.png'.split(' '))
202 blacklist.extend('_ image _ interlaced2.png'.split(' '))
203 blacklist.extend('_ image _ interlaced3.png'.split(' '))
scroggo1497f9f2016-02-02 11:56:33 -0800204 for raw_ext in r:
205 blacklist.extend(('_ image _ .%s' % raw_ext).split(' '))
206
brianosman8c7d7ad2016-03-24 10:33:42 -0700207 # Large image that overwhelms older Mac bots
208 if 'MacMini4.1-GPU' in bot:
209 blacklist.extend('_ image _ abnormal.wbmp'.split(' '))
210
mtklein11a2c502015-02-24 09:25:16 -0800211 match = []
mtklein11a2c502015-02-24 09:25:16 -0800212 if 'Valgrind' in bot: # skia:3021
213 match.append('~Threaded')
mtkleinaccaf482015-11-18 07:56:30 -0800214
borenet97025e32015-04-28 09:54:55 -0700215 if 'GalaxyS3' in bot: # skia:1699
mtklein11a2c502015-02-24 09:25:16 -0800216 match.append('~WritePixels')
mtklein5820fe82016-01-07 07:38:29 -0800217
joshualitt4541f6e2015-12-15 10:46:21 -0800218 if 'AndroidOne' in bot: # skia:4711
219 match.append('~WritePixels')
mtklein11a2c502015-02-24 09:25:16 -0800220
mtklein4e2d3be2015-03-10 11:55:18 -0700221 if 'NexusPlayer' in bot:
222 match.append('~ResourceCache')
223
borenet9b8d3582015-07-21 05:57:22 -0700224 if 'GalaxyS4' in bot: # skia:4079
225 match.append('~imagefiltersclipped')
egdanielccb88bc2015-10-06 11:20:09 -0700226 match.append('~imagefilterscropexpand')
borenetcf72ed62015-08-25 06:53:37 -0700227 match.append('~scaled_tilemodes_npot')
benjaminwagner6fccec32015-09-24 06:39:06 -0700228 match.append('~bleed_image') # skia:4367
229 match.append('~ReadPixels') # skia:4368
borenet9b8d3582015-07-21 05:57:22 -0700230
joshualittb81ceca2015-12-18 06:50:59 -0800231 if 'ANGLE' in bot and 'Debug' in bot:
232 match.append('~GLPrograms') # skia:4717
233
mtklein517558a2016-02-18 11:42:00 -0800234 if 'MSAN' in bot:
235 match.extend(['~Once', '~Shared']) # Not sure what's up with these tests.
236
mtkleine721a8e2016-02-06 19:12:23 -0800237 if blacklist:
238 args.append('--blacklist')
239 args.extend(blacklist)
240
mtklein11a2c502015-02-24 09:25:16 -0800241 if match:
242 args.append('--match')
243 args.extend(match)
244
scroggo3ac66e92016-02-08 15:09:48 -0800245 # These bots run out of memory running RAW codec tests. Do not run them in
246 # parallel
247 if 'NexusPlayer' in bot or 'Nexus5' in bot or 'Nexus9' in bot:
248 args.append('--noRAW_threading')
249
mtklein11a2c502015-02-24 09:25:16 -0800250 return args
251cov_end = lineno() # Don't care about code coverage past here.
252
253
254def self_test():
255 import coverage # This way the bots don't need coverage.py to be installed.
256 args = {}
257 cases = [
mtkleine4b19c42015-05-05 10:28:44 -0700258 'Pretend-iOS-Bot',
joshualitt4541f6e2015-12-15 10:46:21 -0800259 'Test-Android-GCC-AndroidOne-GPU-Mali400MP2-Arm7-Release',
borenet1e37d172015-03-27 05:42:18 -0700260 'Test-Android-GCC-GalaxyS3-GPU-Mali400-Arm7-Debug',
mtkleine4b19c42015-05-05 10:28:44 -0700261 'Test-Android-GCC-GalaxyS4-GPU-SGX544-Arm7-Release',
borenet1e37d172015-03-27 05:42:18 -0700262 'Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release',
borenet48b88cc2016-04-11 10:16:01 -0700263 'Test-Android-GCC-Nexus9-GPU-TegraK1-Arm64-Debug',
borenet1e37d172015-03-27 05:42:18 -0700264 'Test-Android-GCC-NexusPlayer-CPU-SSSE3-x86-Release',
borenet48b88cc2016-04-11 10:16:01 -0700265 'Test-Android-GCC-NVIDIA_Shield-GPU-TegraX1-Arm64-Release',
266 'Test-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Release',
267 'Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug-CommandBuffer',
268 'Test-Mac10.8-Clang-MacMini4.1-CPU-SSE4-x86_64-Release',
mtkleine721a8e2016-02-06 19:12:23 -0800269 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN',
borenet1e37d172015-03-27 05:42:18 -0700270 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN',
271 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind',
borenet48b88cc2016-04-11 10:16:01 -0700272 'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind',
borenet71e185c2016-04-12 08:13:56 -0700273 'Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-Vulkan',
borenet1e37d172015-03-27 05:42:18 -0700274 'Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE',
mtklein11a2c502015-02-24 09:25:16 -0800275 ]
276
277 cov = coverage.coverage()
278 cov.start()
279 for case in cases:
mtkleinf73e5892015-02-24 11:45:11 -0800280 args[case] = get_args(case)
mtklein11a2c502015-02-24 09:25:16 -0800281 cov.stop()
282
283 this_file = os.path.basename(__file__)
284 _, _, not_run, _ = cov.analysis(this_file)
285 filtered = [line for line in not_run if line > cov_start and line < cov_end]
286 if filtered:
287 print 'Lines not covered by test cases: ', filtered
288 sys.exit(1)
289
290 golden = this_file.replace('.py', '.json')
291 with open(os.path.join(os.path.dirname(__file__), golden), 'w') as f:
292 json.dump(args, f, indent=2, sort_keys=True)
293
294
295if __name__ == '__main__':
296 if len(sys.argv) == 2 and sys.argv[1] == 'test':
297 self_test()
298 sys.exit(0)
299
300 if len(sys.argv) != 3:
301 print usage
302 sys.exit(1)
303
304 with open(sys.argv[1], 'w') as out:
mtkleinf73e5892015-02-24 11:45:11 -0800305 json.dump(get_args(sys.argv[2]), out)