OLD | NEW |
1 # | 1 # |
2 # Copyright 2015 Google Inc. | 2 # Copyright 2015 Google Inc. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 | 7 |
8 #!/usr/bin/env python | 8 #!/usr/bin/env python |
9 | 9 |
10 usage = ''' | 10 usage = ''' |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 # parallel | 274 # parallel |
275 if ('NexusPlayer' in bot or 'Nexus5' in bot or 'Nexus9' in bot | 275 if ('NexusPlayer' in bot or 'Nexus5' in bot or 'Nexus9' in bot |
276 or 'Win8-MSVC-ShuttleB' in bot): | 276 or 'Win8-MSVC-ShuttleB' in bot): |
277 args.append('--noRAW_threading') | 277 args.append('--noRAW_threading') |
278 | 278 |
279 return args | 279 return args |
280 cov_end = lineno() # Don't care about code coverage past here. | 280 cov_end = lineno() # Don't care about code coverage past here. |
281 | 281 |
282 | 282 |
283 def self_test(): | 283 def self_test(): |
284 import coverage # This way the bots don't need coverage.py to be installed. | |
285 args = {} | 284 args = {} |
286 cases = [ | 285 cases = [ |
287 'Pretend-iOS-Bot', | 286 'Pretend-iOS-Bot', |
288 'Test-Android-GCC-AndroidOne-GPU-Mali400MP2-Arm7-Release', | 287 'Test-Android-GCC-AndroidOne-GPU-Mali400MP2-Arm7-Release', |
289 'Test-Android-GCC-GalaxyS3-GPU-Mali400-Arm7-Debug', | 288 'Test-Android-GCC-GalaxyS3-GPU-Mali400-Arm7-Debug', |
290 'Test-Android-GCC-GalaxyS4-GPU-SGX544-Arm7-Release', | 289 'Test-Android-GCC-GalaxyS4-GPU-SGX544-Arm7-Release', |
291 'Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release', | 290 'Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release', |
292 'Test-Android-GCC-Nexus9-GPU-TegraK1-Arm64-Debug', | 291 'Test-Android-GCC-Nexus9-GPU-TegraK1-Arm64-Debug', |
293 'Test-Android-GCC-Nexus10-GPU-MaliT604-Arm7-Debug', | 292 'Test-Android-GCC-Nexus10-GPU-MaliT604-Arm7-Debug', |
294 'Test-Android-GCC-NexusPlayer-CPU-SSSE3-x86-Release', | 293 'Test-Android-GCC-NexusPlayer-CPU-SSSE3-x86-Release', |
295 'Test-Android-GCC-NVIDIA_Shield-GPU-TegraX1-Arm64-Release', | 294 'Test-Android-GCC-NVIDIA_Shield-GPU-TegraX1-Arm64-Release', |
296 'Test-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Release', | 295 'Test-Mac-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Release', |
297 'Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug-CommandBuffer', | 296 'Test-Mac-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug-CommandBuffer', |
298 'Test-Mac10.8-Clang-MacMini4.1-CPU-SSE4-x86_64-Release', | 297 'Test-Mac10.8-Clang-MacMini4.1-CPU-SSE4-x86_64-Release', |
299 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN', | 298 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN', |
300 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN', | 299 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN', |
301 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind', | 300 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind', |
302 'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind', | 301 'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind', |
303 'Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug', | 302 'Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug', |
304 'Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-Vulkan', | 303 'Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-Vulkan', |
305 'Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE', | 304 'Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE', |
306 'Test-Win8-MSVC-GCE-CPU-AVX2-x86_64-Debug', | 305 'Test-Win8-MSVC-GCE-CPU-AVX2-x86_64-Debug', |
307 ] | 306 ] |
| 307 this_file = os.path.basename(__file__) |
308 | 308 |
309 cov = coverage.coverage() | 309 try: |
310 cov.start() | 310 import coverage |
311 for case in cases: | 311 cov = coverage.coverage() |
312 args[case] = get_args(case) | 312 cov.start() |
313 cov.stop() | 313 for case in cases: |
| 314 args[case] = get_args(case) |
| 315 cov.stop() |
314 | 316 |
315 this_file = os.path.basename(__file__) | 317 _, _, not_run, _ = cov.analysis(this_file) |
316 _, _, not_run, _ = cov.analysis(this_file) | 318 filtered = [line for line in not_run if line > cov_start and line < cov_end] |
317 filtered = [line for line in not_run if line > cov_start and line < cov_end] | 319 if filtered: |
318 if filtered: | 320 print 'Lines not covered by test cases: ', filtered |
319 print 'Lines not covered by test cases: ', filtered | 321 sys.exit(1) |
320 sys.exit(1) | 322 except ImportError: |
| 323 print ("We cannot guarantee that this files tests are comprehensive " + |
| 324 "without coverage.py. Please install it when you get a chance.") |
321 | 325 |
322 golden = this_file.replace('.py', '.json') | 326 golden = this_file.replace('.py', '.json') |
323 with open(os.path.join(os.path.dirname(__file__), golden), 'w') as f: | 327 with open(os.path.join(os.path.dirname(__file__), golden), 'w') as f: |
324 json.dump(args, f, indent=2, sort_keys=True) | 328 json.dump(args, f, indent=2, sort_keys=True) |
325 | 329 |
326 | 330 |
327 if __name__ == '__main__': | 331 if __name__ == '__main__': |
328 if len(sys.argv) == 2 and sys.argv[1] == 'test': | 332 if len(sys.argv) == 2 and sys.argv[1] == 'test': |
329 self_test() | 333 self_test() |
330 sys.exit(0) | 334 sys.exit(0) |
331 | 335 |
332 if len(sys.argv) != 3: | 336 if len(sys.argv) != 3: |
333 print usage | 337 print usage |
334 sys.exit(1) | 338 sys.exit(1) |
335 | 339 |
336 with open(sys.argv[1], 'w') as out: | 340 with open(sys.argv[1], 'w') as out: |
337 json.dump(get_args(sys.argv[2]), out) | 341 json.dump(get_args(sys.argv[2]), out) |
OLD | NEW |