blob: 5542e4fb4bb882c4428e63fb66ac5ca97e2f8afc [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):
benjaminwagner8d61f0d2016-01-25 13:02:40 -080030 args = ['--pre_log']
mtklein11a2c502015-02-24 09:25:16 -080031
borenetd9b6be12015-05-06 08:33:51 -070032 configs = ['565', '8888', 'gpu']
borenete3aeaec2015-05-05 13:11:27 -070033
borenetd9b6be12015-05-06 08:33:51 -070034 if 'Android' not in bot:
35 configs.extend(('upright-matrix-8888', 'upright-matrix-gpu'))
36 args.extend('--matrix 0 1 1 0'.split(' '))
mtkleinfca5c882015-04-21 10:34:47 -070037
mtklein32618cb2015-05-07 10:26:44 -070038 if '-GCE-' in bot:
39 configs.append('sp-8888')
mtklein4a34ecb2016-01-08 10:19:35 -080040 configs.extend(['twice-8888', '2ndpic-8888'])
mtkleinff8b3f02015-10-17 09:25:21 -070041 configs.extend(['remote-8888', 'remote_cache-8888'])
mtklein32618cb2015-05-07 10:26:44 -070042
bsalomonf93982a2015-10-30 09:05:32 -070043 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')
mtkleinfca5c882015-04-21 10:34:47 -070052
bsalomon5abf5842015-02-27 10:13:36 -080053 # The S4 crashes and the NP produces a long error stream when we run with
mtkleind5574622015-04-21 11:25:47 -070054 # MSAA. The Tegra2 and Tegra3 just don't support it.
bsalomon5abf5842015-02-27 10:13:36 -080055 if ('GalaxyS4' not in bot and
mtkleind5574622015-04-21 11:25:47 -070056 'NexusPlayer' not in bot and
stephanadeee2982015-05-05 07:55:06 -070057 'Tegra3' not in bot and
58 'iOS' not in bot):
bsalomon5abf5842015-02-27 10:13:36 -080059 if 'Android' in bot:
mtkleinfca5c882015-04-21 10:34:47 -070060 configs.append('msaa4')
bsalomon5abf5842015-02-27 10:13:36 -080061 else:
mtkleinfca5c882015-04-21 10:34:47 -070062 configs.append('msaa16')
mtklein82b33db2015-03-04 13:58:05 -080063 # Runs out of memory on Android bots and Daisy. Everyone else seems fine.
mtklein150d3502015-03-05 13:38:17 -080064 if 'Android' not in bot and 'Daisy' not in bot:
mtklein84aada82015-03-04 11:47:11 -080065 configs.append('pdf')
halcanaryc11c62f2015-09-28 11:51:54 -070066 configs.append('pdf_poppler')
bsalomon5abf5842015-02-27 10:13:36 -080067
borenet97025e32015-04-28 09:54:55 -070068 # NP is running out of RAM when we run all these modes. skia:3255
69 if 'NexusPlayer' not in bot:
mtklein11a2c502015-02-24 09:25:16 -080070 configs.extend(mode + '-8888' for mode in
mtklein4a34ecb2016-01-08 10:19:35 -080071 ['serialize', 'tiles_rt', 'pic'])
bsalomon0bb8c1f2015-06-04 15:10:45 -070072
mtkleinee2a3ea2015-02-25 08:16:19 -080073 if 'ANGLE' in bot:
74 configs.append('angle')
joshualitt815d5712015-12-08 09:14:01 -080075
76 # We want to run gpudft on atleast the mali 400
77 if 'GalaxyS3' in bot:
78 configs.append('gpudft')
79
mtklein11a2c502015-02-24 09:25:16 -080080 args.append('--config')
81 args.extend(configs)
82
msarett13a036b2016-02-08 09:10:47 -080083 # Run tests, gms, and image decoding tests everywhere.
mtklein1866b572015-06-12 11:31:51 -070084 # TODO: remove skp from default --src list?
msarett13a036b2016-02-08 09:10:47 -080085 args.extend('--src tests gm image'.split(' '))
mtklein1866b572015-06-12 11:31:51 -070086
borenet97025e32015-04-28 09:54:55 -070087 if 'GalaxyS' in bot:
88 args.extend(('--threads', '0'))
89
mtklein11a2c502015-02-24 09:25:16 -080090 blacklist = []
scroggoc1121ef2015-07-16 12:36:10 -070091
egdaniel89c2a542015-03-19 13:09:17 -070092 # Certain gm's on win7 gpu and pdf are never finishing and keeping the test
93 # running forever
94 if 'Win7' in bot:
djsollen54416de2015-04-03 07:24:48 -070095 blacklist.extend('msaa16 gm _ colorwheelnative'.split(' '))
96 blacklist.extend('pdf gm _ fontmgr_iter_factory'.split(' '))
egdaniel89c2a542015-03-19 13:09:17 -070097
mtklein150d3502015-03-05 13:38:17 -080098 if 'Valgrind' in bot:
mtkleince866872015-03-26 05:12:13 -070099 # These take 18+ hours to run.
djsollen54416de2015-04-03 07:24:48 -0700100 blacklist.extend('pdf gm _ fontmgr_iter'.split(' '))
101 blacklist.extend('pdf _ _ PANO_20121023_214540.jpg'.split(' '))
Mike Kleinfbcf0bd2015-04-09 06:03:22 -0400102 blacklist.extend('pdf skp _ worldjournal'.split(' '))
djsollen54416de2015-04-03 07:24:48 -0700103 blacklist.extend('pdf skp _ desk_baidu.skp'.split(' '))
borenet22ecae82015-04-13 13:29:26 -0700104 blacklist.extend('pdf skp _ desk_wikipedia.skp'.split(' '))
mtklein150d3502015-03-05 13:38:17 -0800105
stephanadeee2982015-05-05 07:55:06 -0700106 if 'iOS' in bot:
107 blacklist.extend('gpu skp _ _ msaa skp _ _'.split(' '))
stephanadeee2982015-05-05 07:55:06 -0700108 blacklist.extend('msaa16 gm _ tilemodesProcess'.split(' '))
109
emmaleer8f4ba762015-08-14 07:44:46 -0700110 # the 32-bit GCE bots run out of memory in DM when running these large images
111 if 'x86' in bot and not 'x86-64' in bot:
112 blacklist.extend('_ image _ interlaced1.png'.split(' '))
113 blacklist.extend('_ image _ interlaced2.png'.split(' '))
114 blacklist.extend('_ image _ interlaced3.png'.split(' '))
115
mtklein5820fe82016-01-07 07:38:29 -0800116 # skia:4095
117 for test in ['not_native32_bitmap_config',
118 'bleed_image',
119 'bleed_alpha_image',
120 'bleed_alpha_image_shader',
121 'blend',
122 'c_gms',
123 'colortype',
124 'colortype_xfermodes',
125 'colorwheelnative',
126 'drawfilter',
127 'fontmgr_bounds_0.75_0',
128 'fontmgr_bounds_1_-0.25',
129 'fontmgr_bounds',
130 'fontmgr_match',
131 'fontmgr_iter',
132 'lightingshader',
133 'localmatriximagefilter',
134 'path_stroke_with_zero_length',
135 'textblobgeometrychange',
136 'verylargebitmap', # Windows only.
137 'verylarge_picture_image']: # Windows only.
138 blacklist.extend(['serialize-8888', 'gm', '_', test])
mtklein4a34ecb2016-01-08 10:19:35 -0800139 # skia:4769
140 for test in ['blend',
141 'drawfilter',
142 'path_stroke_with_zero_length',
143 'textblobgeometrychange']:
mtklein0b558cb2016-01-11 06:30:47 -0800144 blacklist.extend([ 'sp-8888', 'gm', '_', test])
145 blacklist.extend([ 'pic-8888', 'gm', '_', test])
mtklein4a34ecb2016-01-08 10:19:35 -0800146 blacklist.extend(['2ndpic-8888', 'gm', '_', test])
mtklein4a34ecb2016-01-08 10:19:35 -0800147 for test in ['patch_primitive']:
148 blacklist.extend(['sp-8888', 'gm', '_', test])
mtklein0b558cb2016-01-11 06:30:47 -0800149 # skia:4703
150 for test in ['image-cacherator-from-picture',
151 'image-cacherator-from-raster',
152 'image-cacherator-from-ctable']:
153 blacklist.extend([ 'sp-8888', 'gm', '_', test])
154 blacklist.extend([ 'pic-8888', 'gm', '_', test])
155 blacklist.extend([ '2ndpic-8888', 'gm', '_', test])
156 blacklist.extend(['serialize-8888', 'gm', '_', test])
mtklein5820fe82016-01-07 07:38:29 -0800157
scroggo3ac66e92016-02-08 15:09:48 -0800158 # Extensions for RAW images
msarett772cc402016-02-08 11:43:50 -0800159 r = ["arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw",
160 "ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW"]
161
msarett772cc402016-02-08 11:43:50 -0800162 # skbug.com/4888
163 # Blacklist RAW images on GPU tests until we can resolve failures
164 if 'GPU' in bot:
scroggo1497f9f2016-02-02 11:56:33 -0800165 for raw_ext in r:
166 blacklist.extend(('_ image _ .%s' % raw_ext).split(' '))
167
mtklein11a2c502015-02-24 09:25:16 -0800168 match = []
mtklein11a2c502015-02-24 09:25:16 -0800169 if 'Valgrind' in bot: # skia:3021
170 match.append('~Threaded')
mtkleinaccaf482015-11-18 07:56:30 -0800171
borenet97025e32015-04-28 09:54:55 -0700172 if 'GalaxyS3' in bot: # skia:1699
mtklein11a2c502015-02-24 09:25:16 -0800173 match.append('~WritePixels')
mtklein5820fe82016-01-07 07:38:29 -0800174
joshualitt4541f6e2015-12-15 10:46:21 -0800175 if 'AndroidOne' in bot: # skia:4711
176 match.append('~WritePixels')
mtklein11a2c502015-02-24 09:25:16 -0800177
mtklein4e2d3be2015-03-10 11:55:18 -0700178 if 'NexusPlayer' in bot:
179 match.append('~ResourceCache')
180
borenet9b8d3582015-07-21 05:57:22 -0700181 if 'GalaxyS4' in bot: # skia:4079
182 match.append('~imagefiltersclipped')
egdanielccb88bc2015-10-06 11:20:09 -0700183 match.append('~imagefilterscropexpand')
borenetcf72ed62015-08-25 06:53:37 -0700184 match.append('~scaled_tilemodes_npot')
benjaminwagner6fccec32015-09-24 06:39:06 -0700185 match.append('~bleed_image') # skia:4367
186 match.append('~ReadPixels') # skia:4368
borenet9b8d3582015-07-21 05:57:22 -0700187
joshualittb81ceca2015-12-18 06:50:59 -0800188 if 'ANGLE' in bot and 'Debug' in bot:
189 match.append('~GLPrograms') # skia:4717
190
mtkleine721a8e2016-02-06 19:12:23 -0800191 # Hacking around trying to get the MSAN bot green.
192 if 'MSAN' in bot:
mtkleine721a8e2016-02-06 19:12:23 -0800193 blacklist.extend(('_ image _ .wbmp').split(' ')) # skia:4900
194 blacklist.extend(('_ image _ .png').split(' ')) # I8 .png color tables
195 blacklist.extend(('_ image _ .bmp').split(' ')) # I8 .bmp color tables
196
mtkleine721a8e2016-02-06 19:12:23 -0800197 if blacklist:
198 args.append('--blacklist')
199 args.extend(blacklist)
200
mtklein11a2c502015-02-24 09:25:16 -0800201 if match:
202 args.append('--match')
203 args.extend(match)
204
scroggo3ac66e92016-02-08 15:09:48 -0800205 # These bots run out of memory running RAW codec tests. Do not run them in
206 # parallel
207 if 'NexusPlayer' in bot or 'Nexus5' in bot or 'Nexus9' in bot:
208 args.append('--noRAW_threading')
209
mtklein11a2c502015-02-24 09:25:16 -0800210 return args
211cov_end = lineno() # Don't care about code coverage past here.
212
213
214def self_test():
215 import coverage # This way the bots don't need coverage.py to be installed.
216 args = {}
217 cases = [
mtkleine4b19c42015-05-05 10:28:44 -0700218 'Pretend-iOS-Bot',
joshualitt4541f6e2015-12-15 10:46:21 -0800219 'Test-Android-GCC-AndroidOne-GPU-Mali400MP2-Arm7-Release',
mtkleinfca5c882015-04-21 10:34:47 -0700220 'Test-Android-GCC-Nexus9-GPU-TegraK1-Arm64-Debug',
borenet1e37d172015-03-27 05:42:18 -0700221 'Test-Android-GCC-GalaxyS3-GPU-Mali400-Arm7-Debug',
mtkleine4b19c42015-05-05 10:28:44 -0700222 'Test-Android-GCC-GalaxyS4-GPU-SGX544-Arm7-Release',
borenet1e37d172015-03-27 05:42:18 -0700223 'Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release',
224 'Test-Android-GCC-NexusPlayer-CPU-SSSE3-x86-Release',
borenet1e37d172015-03-27 05:42:18 -0700225 'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind',
mtkleine721a8e2016-02-06 19:12:23 -0800226 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN',
borenet1e37d172015-03-27 05:42:18 -0700227 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN',
228 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind',
229 'Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE',
msarett43432f32015-11-25 05:36:07 -0800230 'Test-Mac10.8-Clang-MacMini4.1-CPU-SSE4-x86_64-Release',
mtklein11a2c502015-02-24 09:25:16 -0800231 ]
232
233 cov = coverage.coverage()
234 cov.start()
235 for case in cases:
mtkleinf73e5892015-02-24 11:45:11 -0800236 args[case] = get_args(case)
mtklein11a2c502015-02-24 09:25:16 -0800237 cov.stop()
238
239 this_file = os.path.basename(__file__)
240 _, _, not_run, _ = cov.analysis(this_file)
241 filtered = [line for line in not_run if line > cov_start and line < cov_end]
242 if filtered:
243 print 'Lines not covered by test cases: ', filtered
244 sys.exit(1)
245
246 golden = this_file.replace('.py', '.json')
247 with open(os.path.join(os.path.dirname(__file__), golden), 'w') as f:
248 json.dump(args, f, indent=2, sort_keys=True)
249
250
251if __name__ == '__main__':
252 if len(sys.argv) == 2 and sys.argv[1] == 'test':
253 self_test()
254 sys.exit(0)
255
256 if len(sys.argv) != 3:
257 print usage
258 sys.exit(1)
259
260 with open(sys.argv[1], 'w') as out:
mtkleinf73e5892015-02-24 11:45:11 -0800261 json.dump(get_args(sys.argv[2]), out)