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): |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 30 | args = [] |
| 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') |
| 40 | |
mtklein | fca5c88 | 2015-04-21 10:34:47 -0700 | [diff] [blame] | 41 | if 'TegraK1' in bot or 'GTX550Ti' in bot or 'GTX660' in bot or 'GT610' in bot: |
| 42 | if 'Android' in bot: |
| 43 | configs.append('nvprmsaa4') |
| 44 | else: |
| 45 | configs.append('nvprmsaa16') |
| 46 | |
bsalomon | 5abf584 | 2015-02-27 10:13:36 -0800 | [diff] [blame] | 47 | # 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] | 48 | # MSAA. The Tegra2 and Tegra3 just don't support it. |
bsalomon | 5abf584 | 2015-02-27 10:13:36 -0800 | [diff] [blame] | 49 | if ('GalaxyS4' not in bot and |
mtklein | d557462 | 2015-04-21 11:25:47 -0700 | [diff] [blame] | 50 | 'NexusPlayer' not in bot and |
stephana | deee298 | 2015-05-05 07:55:06 -0700 | [diff] [blame] | 51 | 'Tegra3' not in bot and |
| 52 | 'iOS' not in bot): |
bsalomon | 5abf584 | 2015-02-27 10:13:36 -0800 | [diff] [blame] | 53 | if 'Android' in bot: |
mtklein | fca5c88 | 2015-04-21 10:34:47 -0700 | [diff] [blame] | 54 | configs.append('msaa4') |
bsalomon | 5abf584 | 2015-02-27 10:13:36 -0800 | [diff] [blame] | 55 | else: |
mtklein | fca5c88 | 2015-04-21 10:34:47 -0700 | [diff] [blame] | 56 | configs.append('msaa16') |
mtklein | 82b33db | 2015-03-04 13:58:05 -0800 | [diff] [blame] | 57 | # Runs out of memory on Android bots and Daisy. Everyone else seems fine. |
mtklein | 150d350 | 2015-03-05 13:38:17 -0800 | [diff] [blame] | 58 | if 'Android' not in bot and 'Daisy' not in bot: |
mtklein | 84aada8 | 2015-03-04 11:47:11 -0800 | [diff] [blame] | 59 | configs.append('pdf') |
bsalomon | 5abf584 | 2015-02-27 10:13:36 -0800 | [diff] [blame] | 60 | |
borenet | 97025e3 | 2015-04-28 09:54:55 -0700 | [diff] [blame] | 61 | # NP is running out of RAM when we run all these modes. skia:3255 |
| 62 | if 'NexusPlayer' not in bot: |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 63 | configs.extend(mode + '-8888' for mode in |
| 64 | ['serialize', 'tiles_rt', 'pipe']) |
bsalomon | 0bb8c1f | 2015-06-04 15:10:45 -0700 | [diff] [blame] | 65 | |
mtklein | ee2a3ea | 2015-02-25 08:16:19 -0800 | [diff] [blame] | 66 | if 'ANGLE' in bot: |
| 67 | configs.append('angle') |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 68 | args.append('--config') |
| 69 | args.extend(configs) |
| 70 | |
mtklein | 1866b57 | 2015-06-12 11:31:51 -0700 | [diff] [blame] | 71 | # Run tests and gms everywhere, |
| 72 | # and image decoding tests everywhere except GPU bots. |
| 73 | # TODO: remove skp from default --src list? |
| 74 | if 'GPU' in bot: |
| 75 | args.extend('--src tests gm'.split(' ')) |
| 76 | else: |
| 77 | args.extend('--src tests gm image'.split(' ')) |
| 78 | |
borenet | 97025e3 | 2015-04-28 09:54:55 -0700 | [diff] [blame] | 79 | if 'GalaxyS' in bot: |
| 80 | args.extend(('--threads', '0')) |
| 81 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 82 | blacklist = [] |
| 83 | # This image is too large to be a texture for many GPUs. |
djsollen | 54416de | 2015-04-03 07:24:48 -0700 | [diff] [blame] | 84 | blacklist.extend('gpu _ _ PANO_20121023_214540.jpg'.split(' ')) |
| 85 | blacklist.extend('msaa _ _ PANO_20121023_214540.jpg'.split(' ')) |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 86 | |
msarett | 114912d | 2015-03-25 12:28:33 -0700 | [diff] [blame] | 87 | # Several of the newest version bmps fail on SkImageDecoder |
djsollen | 54416de | 2015-04-03 07:24:48 -0700 | [diff] [blame] | 88 | blacklist.extend('_ image decode pal8os2v2.bmp'.split(' ')) |
| 89 | blacklist.extend('_ image decode pal8v4.bmp'.split(' ')) |
| 90 | blacklist.extend('_ image decode pal8v5.bmp'.split(' ')) |
| 91 | blacklist.extend('_ image decode rgb16-565.bmp'.split(' ')) |
| 92 | blacklist.extend('_ image decode rgb16-565pal.bmp'.split(' ')) |
| 93 | blacklist.extend('_ image decode rgb32-111110.bmp'.split(' ')) |
| 94 | blacklist.extend('_ image decode rgb32bf.bmp'.split(' ')) |
| 95 | blacklist.extend('_ image decode rgba32.bmp'.split(' ')) |
| 96 | blacklist.extend('_ image decode rgba32abf.bmp'.split(' ')) |
| 97 | blacklist.extend('_ image decode rgb24largepal.bmp'.split(' ')) |
| 98 | blacklist.extend('_ image decode pal8os2v2-16.bmp'.split(' ')) |
| 99 | blacklist.extend('_ image decode pal8oversizepal.bmp'.split(' ')) |
msarett | 2f273a1 | 2015-04-06 08:38:49 -0700 | [diff] [blame] | 100 | blacklist.extend('_ image decode pal4rletrns.bmp'.split(' ')) |
| 101 | blacklist.extend('_ image decode pal8rletrns.bmp'.split(' ')) |
msarett | 3c309db | 2015-04-10 14:36:48 -0700 | [diff] [blame] | 102 | blacklist.extend('_ image decode 4bpp-pixeldata-cropped.bmp'.split(' ')) |
| 103 | blacklist.extend('_ image decode 8bpp-pixeldata-cropped.bmp'.split(' ')) |
| 104 | blacklist.extend('_ image decode 24bpp-pixeldata-cropped.bmp'.split(' ')) |
| 105 | blacklist.extend('_ image decode 32bpp-pixeldata-cropped.bmp'.split(' ')) |
djsollen | 54416de | 2015-04-03 07:24:48 -0700 | [diff] [blame] | 106 | blacklist.extend('_ image subset rgb24largepal.bmp'.split(' ')) |
| 107 | blacklist.extend('_ image subset pal8os2v2-16.bmp'.split(' ')) |
| 108 | blacklist.extend('_ image subset pal8oversizepal.bmp'.split(' ')) |
msarett | 3c309db | 2015-04-10 14:36:48 -0700 | [diff] [blame] | 109 | blacklist.extend('_ image subset 4bpp-pixeldata-cropped.bmp'.split(' ')) |
| 110 | blacklist.extend('_ image subset 8bpp-pixeldata-cropped.bmp'.split(' ')) |
| 111 | blacklist.extend('_ image subset 24bpp-pixeldata-cropped.bmp'.split(' ')) |
| 112 | blacklist.extend('_ image subset 32bpp-pixeldata-cropped.bmp'.split(' ')) |
msarett | 114912d | 2015-03-25 12:28:33 -0700 | [diff] [blame] | 113 | |
| 114 | # New ico files that fail on SkImageDecoder |
djsollen | 54416de | 2015-04-03 07:24:48 -0700 | [diff] [blame] | 115 | blacklist.extend('_ image decode Hopstarter-Mac-Folders-Apple.ico'.split(' ')) |
msarett | 114912d | 2015-03-25 12:28:33 -0700 | [diff] [blame] | 116 | |
mtklein | e2aab90 | 2015-03-17 12:52:16 -0700 | [diff] [blame] | 117 | # Leon doesn't care about this, so why run it? |
| 118 | if 'Win' in bot: |
djsollen | 54416de | 2015-04-03 07:24:48 -0700 | [diff] [blame] | 119 | blacklist.extend('_ image decode _'.split(' ')) |
| 120 | blacklist.extend('_ image subset _'.split(' ')) |
mtklein | e2aab90 | 2015-03-17 12:52:16 -0700 | [diff] [blame] | 121 | |
egdaniel | 89c2a54 | 2015-03-19 13:09:17 -0700 | [diff] [blame] | 122 | # Certain gm's on win7 gpu and pdf are never finishing and keeping the test |
| 123 | # running forever |
| 124 | if 'Win7' in bot: |
djsollen | 54416de | 2015-04-03 07:24:48 -0700 | [diff] [blame] | 125 | blacklist.extend('msaa16 gm _ colorwheelnative'.split(' ')) |
| 126 | blacklist.extend('pdf gm _ fontmgr_iter_factory'.split(' ')) |
egdaniel | 89c2a54 | 2015-03-19 13:09:17 -0700 | [diff] [blame] | 127 | |
mtklein | 150d350 | 2015-03-05 13:38:17 -0800 | [diff] [blame] | 128 | if 'Valgrind' in bot: |
mtklein | de7665a | 2015-03-14 07:24:29 -0700 | [diff] [blame] | 129 | # PDF + .webp -> jumps depending on uninitialized memory. skia:3505 |
djsollen | 54416de | 2015-04-03 07:24:48 -0700 | [diff] [blame] | 130 | blacklist.extend('pdf _ _ .webp'.split(' ')) |
mtklein | ce86687 | 2015-03-26 05:12:13 -0700 | [diff] [blame] | 131 | # These take 18+ hours to run. |
djsollen | 54416de | 2015-04-03 07:24:48 -0700 | [diff] [blame] | 132 | blacklist.extend('pdf gm _ fontmgr_iter'.split(' ')) |
| 133 | blacklist.extend('pdf _ _ PANO_20121023_214540.jpg'.split(' ')) |
Mike Klein | fbcf0bd | 2015-04-09 06:03:22 -0400 | [diff] [blame] | 134 | blacklist.extend('pdf skp _ worldjournal'.split(' ')) |
djsollen | 54416de | 2015-04-03 07:24:48 -0700 | [diff] [blame] | 135 | blacklist.extend('pdf skp _ desk_baidu.skp'.split(' ')) |
borenet | 22ecae8 | 2015-04-13 13:29:26 -0700 | [diff] [blame] | 136 | blacklist.extend('pdf skp _ desk_wikipedia.skp'.split(' ')) |
mtklein | 150d350 | 2015-03-05 13:38:17 -0800 | [diff] [blame] | 137 | |
stephana | deee298 | 2015-05-05 07:55:06 -0700 | [diff] [blame] | 138 | if 'iOS' in bot: |
| 139 | blacklist.extend('gpu skp _ _ msaa skp _ _'.split(' ')) |
| 140 | blacklist.extend('gpu image decode _ msaa image decode _'.split(' ')) |
| 141 | blacklist.extend('gpu image subset _ msaa image subset _'.split(' ')) |
| 142 | blacklist.extend('msaa16 gm _ tilemodesProcess'.split(' ')) |
| 143 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 144 | if blacklist: |
| 145 | args.append('--blacklist') |
| 146 | args.extend(blacklist) |
| 147 | |
| 148 | match = [] |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 149 | if 'Valgrind' in bot: # skia:3021 |
| 150 | match.append('~Threaded') |
mtklein | 37cc0b2 | 2015-06-30 10:51:50 -0700 | [diff] [blame] | 151 | if 'TSAN' in bot: |
| 152 | match.append('~Math') # skia:3562 |
| 153 | match.append('~SkSharedMutexMultiThreaded') # skia:3997 |
mtklein | 905d01b | 2015-03-18 14:06:55 -0700 | [diff] [blame] | 154 | |
borenet | 97025e3 | 2015-04-28 09:54:55 -0700 | [diff] [blame] | 155 | if 'GalaxyS3' in bot: # skia:1699 |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 156 | match.append('~WritePixels') |
| 157 | |
| 158 | # skia:3249: these images flakily don't decode on Android. |
| 159 | if 'Android' in bot: |
| 160 | match.append('~tabl_mozilla_0') |
| 161 | match.append('~desk_yahoonews_0') |
| 162 | |
mtklein | 4e2d3be | 2015-03-10 11:55:18 -0700 | [diff] [blame] | 163 | if 'NexusPlayer' in bot: |
| 164 | match.append('~ResourceCache') |
| 165 | |
stephana | deee298 | 2015-05-05 07:55:06 -0700 | [diff] [blame] | 166 | if 'iOS' in bot: |
| 167 | match.append('~WritePixels') |
| 168 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 169 | if match: |
| 170 | args.append('--match') |
| 171 | args.extend(match) |
| 172 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 173 | return args |
| 174 | cov_end = lineno() # Don't care about code coverage past here. |
| 175 | |
| 176 | |
| 177 | def self_test(): |
| 178 | import coverage # This way the bots don't need coverage.py to be installed. |
| 179 | args = {} |
| 180 | cases = [ |
mtklein | e4b19c4 | 2015-05-05 10:28:44 -0700 | [diff] [blame] | 181 | 'Pretend-iOS-Bot', |
mtklein | fca5c88 | 2015-04-21 10:34:47 -0700 | [diff] [blame] | 182 | 'Test-Android-GCC-Nexus9-GPU-TegraK1-Arm64-Debug', |
borenet | 1e37d17 | 2015-03-27 05:42:18 -0700 | [diff] [blame] | 183 | 'Test-Android-GCC-GalaxyS3-GPU-Mali400-Arm7-Debug', |
mtklein | e4b19c4 | 2015-05-05 10:28:44 -0700 | [diff] [blame] | 184 | 'Test-Android-GCC-GalaxyS4-GPU-SGX544-Arm7-Release', |
borenet | 1e37d17 | 2015-03-27 05:42:18 -0700 | [diff] [blame] | 185 | 'Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release', |
| 186 | 'Test-Android-GCC-NexusPlayer-CPU-SSSE3-x86-Release', |
borenet | 1e37d17 | 2015-03-27 05:42:18 -0700 | [diff] [blame] | 187 | 'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind', |
| 188 | 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN', |
| 189 | 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind', |
| 190 | 'Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE', |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 191 | ] |
| 192 | |
| 193 | cov = coverage.coverage() |
| 194 | cov.start() |
| 195 | for case in cases: |
mtklein | f73e589 | 2015-02-24 11:45:11 -0800 | [diff] [blame] | 196 | args[case] = get_args(case) |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 197 | cov.stop() |
| 198 | |
| 199 | this_file = os.path.basename(__file__) |
| 200 | _, _, not_run, _ = cov.analysis(this_file) |
| 201 | filtered = [line for line in not_run if line > cov_start and line < cov_end] |
| 202 | if filtered: |
| 203 | print 'Lines not covered by test cases: ', filtered |
| 204 | sys.exit(1) |
| 205 | |
| 206 | golden = this_file.replace('.py', '.json') |
| 207 | with open(os.path.join(os.path.dirname(__file__), golden), 'w') as f: |
| 208 | json.dump(args, f, indent=2, sort_keys=True) |
| 209 | |
| 210 | |
| 211 | if __name__ == '__main__': |
| 212 | if len(sys.argv) == 2 and sys.argv[1] == 'test': |
| 213 | self_test() |
| 214 | sys.exit(0) |
| 215 | |
| 216 | if len(sys.argv) != 3: |
| 217 | print usage |
| 218 | sys.exit(1) |
| 219 | |
| 220 | with open(sys.argv[1], 'w') as out: |
mtklein | f73e589 | 2015-02-24 11:45:11 -0800 | [diff] [blame] | 221 | json.dump(get_args(sys.argv[2]), out) |