| OLD | NEW |
| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 method = SmokeTestGenerator(benchmark) | 137 method = SmokeTestGenerator(benchmark) |
| 138 | 138 |
| 139 # Make sure any decorators are propagated from the original declaration. | 139 # Make sure any decorators are propagated from the original declaration. |
| 140 # (access to protected members) pylint: disable=protected-access | 140 # (access to protected members) pylint: disable=protected-access |
| 141 # TODO(dpranke): Since we only pick the first test from every class | 141 # TODO(dpranke): Since we only pick the first test from every class |
| 142 # (above), if that test is disabled, we'll end up not running *any* | 142 # (above), if that test is disabled, we'll end up not running *any* |
| 143 # test from the class. We should probably discover all of the tests | 143 # test from the class. We should probably discover all of the tests |
| 144 # in a class, and then throw the ones we don't need away instead. | 144 # in a class, and then throw the ones we don't need away instead. |
| 145 | 145 |
| 146 # TODO(aiolos): remove try after all telemetry-side changes land. | 146 disabled_benchmark_attr = decorators.DisabledAttributeName(benchmark) |
| 147 try: | 147 disabled_method_attr = decorators.DisabledAttributeName(method) |
| 148 decorators.IS_UPDATED_DECORATORS | 148 enabled_benchmark_attr = decorators.EnabledAttributeName(benchmark) |
| 149 except AttributeError: | 149 enabled_method_attr = decorators.EnabledAttributeName(method) |
| 150 enabled_benchmark_attr = '_enabled_strings' | |
| 151 enabled_method_attr = '_enabled_strings' | |
| 152 disabled_benchmark_attr = '_disabled_strings' | |
| 153 disabled_method_attr = '_disabled_strings' | |
| 154 else: | |
| 155 disabled_benchmark_attr = decorators.DisabledAttributeName(benchmark) | |
| 156 disabled_method_attr = decorators.DisabledAttributeName(method) | |
| 157 enabled_benchmark_attr = decorators.EnabledAttributeName(benchmark) | |
| 158 enabled_method_attr = decorators.EnabledAttributeName(method) | |
| 159 | 150 |
| 160 MergeDecorators(method, disabled_method_attr, benchmark, | 151 MergeDecorators(method, disabled_method_attr, benchmark, |
| 161 disabled_benchmark_attr) | 152 disabled_benchmark_attr) |
| 162 MergeDecorators(method, enabled_method_attr, benchmark, | 153 MergeDecorators(method, enabled_method_attr, benchmark, |
| 163 enabled_benchmark_attr) | 154 enabled_benchmark_attr) |
| 164 | 155 |
| 165 setattr(BenchmarkSmokeTest, benchmark.Name(), method) | 156 setattr(BenchmarkSmokeTest, benchmark.Name(), method) |
| 166 | 157 |
| 167 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) | 158 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) |
| 168 | 159 |
| 169 return suite | 160 return suite |
| OLD | NEW |