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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |