blob: 4a4175c1381b1857cc80442d43f33fff925bfdf7 [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(' '))
scroggo23b80c42016-05-23 14:35:52 -0700161 if 'x86_64' in bot and 'CPU' in bot:
162 # This GM triggers a SkSmallAllocator assert.
163 blacklist.extend('_ gm _ composeshader_bitmap'.split(' '))
msarettfc0b6d12016-03-17 13:50:17 -0700164
bsalomonddbc6e52016-06-20 12:48:33 -0700165 if 'Android' in bot or 'iOS' in bot:
166 # This test crashes the N9 (perhaps because of large malloc/frees). It also
167 # is fairly slow and not platform-specific. So we just disable it on all of
168 # Android and iOS. skia:5438
169 blacklist.extend('_ test _ GrShape'.split(' '))
benjaminwagnerc3ea34b2016-07-06 06:55:04 -0700170
171 if 'Win8' in bot:
172 # bungeman: "Doesn't work on Windows anyway, produces unstable GMs with
173 # 'Unexpected error' from DirectWrite"
174 blacklist.extend('_ gm _ fontscalerdistortable'.split(' '))
175
mtklein5820fe82016-01-07 07:38:29 -0800176 # skia:4095
mtklein96e4e1c2016-06-09 10:38:08 -0700177 for test in ['bleed_image',
mtklein5820fe82016-01-07 07:38:29 -0800178 'c_gms',
179 'colortype',
180 'colortype_xfermodes',
mtklein5820fe82016-01-07 07:38:29 -0800181 'drawfilter',
182 'fontmgr_bounds_0.75_0',
183 'fontmgr_bounds_1_-0.25',
184 'fontmgr_bounds',
185 'fontmgr_match',
mtklein96e4e1c2016-06-09 10:38:08 -0700186 'fontmgr_iter']:
mtklein5820fe82016-01-07 07:38:29 -0800187 blacklist.extend(['serialize-8888', 'gm', '_', test])
mtklein96e4e1c2016-06-09 10:38:08 -0700188 if 'Mac' not in bot:
189 for test in ['bleed_alpha_image', 'bleed_alpha_image_shader']:
190 blacklist.extend(['serialize-8888', 'gm', '_', test])
mtkleinc9b4ccd2016-06-09 18:57:20 -0700191 # It looks like we skip these only for out-of-memory concerns.
192 if 'Win' in bot or 'Android' in bot:
mtklein96e4e1c2016-06-09 10:38:08 -0700193 for test in ['verylargebitmap', 'verylarge_picture_image']:
194 blacklist.extend(['serialize-8888', 'gm', '_', test])
195
mtklein4a34ecb2016-01-08 10:19:35 -0800196 # skia:4769
mtklein48156ed2016-04-06 14:25:35 -0700197 for test in ['drawfilter']:
mtkleindd54e5d2016-02-29 09:51:09 -0800198 blacklist.extend([ 'sp-8888', 'gm', '_', test])
199 blacklist.extend([ 'pic-8888', 'gm', '_', test])
200 blacklist.extend(['2ndpic-8888', 'gm', '_', test])
mtklein0b558cb2016-01-11 06:30:47 -0800201 # skia:4703
202 for test in ['image-cacherator-from-picture',
203 'image-cacherator-from-raster',
204 'image-cacherator-from-ctable']:
mtkleindd54e5d2016-02-29 09:51:09 -0800205 blacklist.extend([ 'sp-8888', 'gm', '_', test])
mtklein0b558cb2016-01-11 06:30:47 -0800206 blacklist.extend([ 'pic-8888', 'gm', '_', test])
mtkleindd54e5d2016-02-29 09:51:09 -0800207 blacklist.extend([ '2ndpic-8888', 'gm', '_', test])
mtklein0b558cb2016-01-11 06:30:47 -0800208 blacklist.extend(['serialize-8888', 'gm', '_', test])
mtklein5820fe82016-01-07 07:38:29 -0800209
scroggo3ac66e92016-02-08 15:09:48 -0800210 # Extensions for RAW images
msarett772cc402016-02-08 11:43:50 -0800211 r = ["arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw",
212 "ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW"]
213
msarett772cc402016-02-08 11:43:50 -0800214 # skbug.com/4888
mtkleinbee39c52016-03-22 12:36:01 -0700215 # Blacklist RAW images (and a few large PNGs) on GPU bots
216 # until we can resolve failures
msarett772cc402016-02-08 11:43:50 -0800217 if 'GPU' in bot:
mtkleinbee39c52016-03-22 12:36:01 -0700218 blacklist.extend('_ image _ interlaced1.png'.split(' '))
219 blacklist.extend('_ image _ interlaced2.png'.split(' '))
220 blacklist.extend('_ image _ interlaced3.png'.split(' '))
scroggo1497f9f2016-02-02 11:56:33 -0800221 for raw_ext in r:
222 blacklist.extend(('_ image _ .%s' % raw_ext).split(' '))
223
brianosman8c7d7ad2016-03-24 10:33:42 -0700224 # Large image that overwhelms older Mac bots
225 if 'MacMini4.1-GPU' in bot:
226 blacklist.extend('_ image _ abnormal.wbmp'.split(' '))
bsalomonea406dd2016-06-10 06:58:16 -0700227 blacklist.extend(['msaa16', 'gm', '_', 'blurcircles'])
brianosman8c7d7ad2016-03-24 10:33:42 -0700228
mtklein11a2c502015-02-24 09:25:16 -0800229 match = []
mtklein11a2c502015-02-24 09:25:16 -0800230 if 'Valgrind' in bot: # skia:3021
231 match.append('~Threaded')
mtkleinaccaf482015-11-18 07:56:30 -0800232
borenet97025e32015-04-28 09:54:55 -0700233 if 'GalaxyS3' in bot: # skia:1699
mtklein11a2c502015-02-24 09:25:16 -0800234 match.append('~WritePixels')
mtklein5820fe82016-01-07 07:38:29 -0800235
joshualitt4541f6e2015-12-15 10:46:21 -0800236 if 'AndroidOne' in bot: # skia:4711
237 match.append('~WritePixels')
mtklein11a2c502015-02-24 09:25:16 -0800238
mtklein4e2d3be2015-03-10 11:55:18 -0700239 if 'NexusPlayer' in bot:
240 match.append('~ResourceCache')
241
borenet9b8d3582015-07-21 05:57:22 -0700242 if 'GalaxyS4' in bot: # skia:4079
243 match.append('~imagefiltersclipped')
egdanielccb88bc2015-10-06 11:20:09 -0700244 match.append('~imagefilterscropexpand')
borenetcf72ed62015-08-25 06:53:37 -0700245 match.append('~scaled_tilemodes_npot')
benjaminwagner6fccec32015-09-24 06:39:06 -0700246 match.append('~bleed_image') # skia:4367
247 match.append('~ReadPixels') # skia:4368
borenet9b8d3582015-07-21 05:57:22 -0700248
joshualittb81ceca2015-12-18 06:50:59 -0800249 if 'ANGLE' in bot and 'Debug' in bot:
250 match.append('~GLPrograms') # skia:4717
251
mtklein517558a2016-02-18 11:42:00 -0800252 if 'MSAN' in bot:
253 match.extend(['~Once', '~Shared']) # Not sure what's up with these tests.
254
stephana338eaea2016-04-27 06:50:03 -0700255 if 'TSAN' in bot:
mtklein96e4e1c2016-06-09 10:38:08 -0700256 match.extend(['~ReadWriteAlpha']) # Flaky on TSAN-covered on nvidia bots.
stephana338eaea2016-04-27 06:50:03 -0700257
mtkleine721a8e2016-02-06 19:12:23 -0800258 if blacklist:
259 args.append('--blacklist')
260 args.extend(blacklist)
261
mtklein11a2c502015-02-24 09:25:16 -0800262 if match:
263 args.append('--match')
264 args.extend(match)
265
scroggo3ac66e92016-02-08 15:09:48 -0800266 # These bots run out of memory running RAW codec tests. Do not run them in
267 # parallel
scroggo00e94522016-05-10 06:11:20 -0700268 if ('NexusPlayer' in bot or 'Nexus5' in bot or 'Nexus9' in bot
269 or 'Win8-MSVC-ShuttleB' in bot):
scroggo3ac66e92016-02-08 15:09:48 -0800270 args.append('--noRAW_threading')
271
mtklein11a2c502015-02-24 09:25:16 -0800272 return args
273cov_end = lineno() # Don't care about code coverage past here.
274
275
276def self_test():
277 import coverage # This way the bots don't need coverage.py to be installed.
278 args = {}
279 cases = [
mtkleine4b19c42015-05-05 10:28:44 -0700280 'Pretend-iOS-Bot',
joshualitt4541f6e2015-12-15 10:46:21 -0800281 'Test-Android-GCC-AndroidOne-GPU-Mali400MP2-Arm7-Release',
borenet1e37d172015-03-27 05:42:18 -0700282 'Test-Android-GCC-GalaxyS3-GPU-Mali400-Arm7-Debug',
mtkleine4b19c42015-05-05 10:28:44 -0700283 'Test-Android-GCC-GalaxyS4-GPU-SGX544-Arm7-Release',
borenet1e37d172015-03-27 05:42:18 -0700284 'Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release',
borenet48b88cc2016-04-11 10:16:01 -0700285 'Test-Android-GCC-Nexus9-GPU-TegraK1-Arm64-Debug',
borenet1e37d172015-03-27 05:42:18 -0700286 'Test-Android-GCC-NexusPlayer-CPU-SSSE3-x86-Release',
borenet48b88cc2016-04-11 10:16:01 -0700287 'Test-Android-GCC-NVIDIA_Shield-GPU-TegraX1-Arm64-Release',
288 'Test-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Release',
289 'Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug-CommandBuffer',
290 'Test-Mac10.8-Clang-MacMini4.1-CPU-SSE4-x86_64-Release',
mtkleine721a8e2016-02-06 19:12:23 -0800291 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN',
borenet1e37d172015-03-27 05:42:18 -0700292 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN',
293 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind',
borenet48b88cc2016-04-11 10:16:01 -0700294 'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind',
borenetac26aa62016-05-18 08:12:51 -0700295 'Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug',
borenet71e185c2016-04-12 08:13:56 -0700296 'Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-Vulkan',
borenet1e37d172015-03-27 05:42:18 -0700297 'Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE',
benjaminwagnerc3ea34b2016-07-06 06:55:04 -0700298 'Test-Win8-MSVC-GCE-CPU-AVX2-x86_64-Debug',
mtklein11a2c502015-02-24 09:25:16 -0800299 ]
300
301 cov = coverage.coverage()
302 cov.start()
303 for case in cases:
mtkleinf73e5892015-02-24 11:45:11 -0800304 args[case] = get_args(case)
mtklein11a2c502015-02-24 09:25:16 -0800305 cov.stop()
306
307 this_file = os.path.basename(__file__)
308 _, _, not_run, _ = cov.analysis(this_file)
309 filtered = [line for line in not_run if line > cov_start and line < cov_end]
310 if filtered:
311 print 'Lines not covered by test cases: ', filtered
312 sys.exit(1)
313
314 golden = this_file.replace('.py', '.json')
315 with open(os.path.join(os.path.dirname(__file__), golden), 'w') as f:
316 json.dump(args, f, indent=2, sort_keys=True)
317
318
319if __name__ == '__main__':
320 if len(sys.argv) == 2 and sys.argv[1] == 'test':
321 self_test()
322 sys.exit(0)
323
324 if len(sys.argv) != 3:
325 print usage
326 sys.exit(1)
327
328 with open(sys.argv[1], 'w') as out:
mtkleinf73e5892015-02-24 11:45:11 -0800329 json.dump(get_args(sys.argv[2]), out)