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

Unified Diff: tools/perf/benchmarks/benchmark_smoke_unittest.py

Issue 1128433007: Merge suite and benchmark decorators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better Created 5 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/benchmarks/benchmark_smoke_unittest.py
diff --git a/tools/perf/benchmarks/benchmark_smoke_unittest.py b/tools/perf/benchmarks/benchmark_smoke_unittest.py
index bed257ebb9736c0a777a899a4fc23aed7018d43f..901a373c95154ed6a578a784b49340f405e66e55 100644
--- a/tools/perf/benchmarks/benchmark_smoke_unittest.py
+++ b/tools/perf/benchmarks/benchmark_smoke_unittest.py
@@ -103,10 +103,17 @@ def load_tests(_, _2, _3):
# (above), if that test is disabled, we'll end up not running *any*
# test from the class. We should probably discover all of the tests
# in a class, and then throw the ones we don't need away instead.
- if hasattr(benchmark, '_enabled_strings'):
- method._enabled_strings = benchmark._enabled_strings
- if hasattr(benchmark, '_disabled_strings'):
- method._disabled_strings = benchmark._disabled_strings
+
+ # Merge decorators.
+ for attr in ['_enabled_strings', '_disabled_strings']:
dtu 2015/05/05 21:09:08 style nit: don't abbreviate (not in google style g
achuithb 2015/05/05 22:01:10 Done.
+ tmp = set()
dtu 2015/05/05 21:09:08 Shorter: merged_attributes = set(getattr(method,
achuithb 2015/05/05 22:01:10 Done.
+ if hasattr(method, attr):
+ tmp.update(getattr(method, attr))
+ if hasattr(benchmark, attr):
+ tmp.update(getattr(benchmark, attr))
+ if tmp:
+ setattr(method, attr, list(tmp))
+
setattr(BenchmarkSmokeTest, benchmark.Name(), method)
suite.addTest(BenchmarkSmokeTest(benchmark.Name()))
« 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