Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: tools/perf/benchmarks/benchmark_smoke_unittest.py

Issue 687893002: Propagate decorators properly in telemetry_perf_unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@switch_tel_over
Patch Set: add a TODO to discover all tests Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Run the first page of one benchmark for every module. 5 """Run the first page of one benchmark for every module.
6 6
7 Only benchmarks that have a composable measurement are included. 7 Only benchmarks that have a composable measurement are included.
8 Ideally this test would be comprehensive, however, running one page 8 Ideally this test would be comprehensive, however, running one page
9 of every benchmark would run impractically long. 9 of every benchmark would run impractically long.
10 """ 10 """
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 if (benchmark.Name().startswith('session_restore') or 87 if (benchmark.Name().startswith('session_restore') or
88 benchmark.Name().startswith('skpicture_printer')): 88 benchmark.Name().startswith('skpicture_printer')):
89 continue 89 continue
90 90
91 if hasattr(benchmark, 'generated_profile_archive'): 91 if hasattr(benchmark, 'generated_profile_archive'):
92 # We'd like to test these, but don't know how yet. 92 # We'd like to test these, but don't know how yet.
93 continue 93 continue
94 94
95 class BenchmarkSmokeTest(unittest.TestCase): 95 class BenchmarkSmokeTest(unittest.TestCase):
96 pass 96 pass
97 setattr(BenchmarkSmokeTest, benchmark.Name(), SmokeTestGenerator(benchmark)) 97
98 method = SmokeTestGenerator(benchmark)
99
100 # Make sure any decorators are propagated from the original declaration.
101 # (access to protected members) pylint: disable=W0212
102 # TODO(dpranke): Since we only pick the first test from every class
103 # (above), if that test is disabled, we'll end up not running *any*
104 # test from the class. We should probably discover all of the tests
105 # in a class, and then throw the ones we don't need away instead.
106 if hasattr(benchmark, '_enabled_strings'):
107 method._enabled_strings = benchmark._enabled_strings
108 if hasattr(benchmark, '_disabled_strings'):
109 method._disabled_strings = benchmark._disabled_strings
110 setattr(BenchmarkSmokeTest, benchmark.Name(), method)
111
98 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) 112 suite.addTest(BenchmarkSmokeTest(benchmark.Name()))
99 113
100 return suite 114 return suite
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698