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

Side by Side Diff: third_party/recipe_engine/expect_tests/util.py

Issue 1151423002: Move recipe engine to third_party/recipe_engine. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Moved field_composer_test with its buddies Created 5 years, 6 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 unified diff | Download patch | Annotate | Revision Log
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 import inspect 5 import inspect
6 6
7 EXPECT_TESTS_COVER_FUNCTION = 'EXPECT_TESTS_COVER_FUNCTION' 7 EXPECT_TESTS_COVER_FUNCTION = 'EXPECT_TESTS_COVER_FUNCTION'
8 8
9 def covers(coverage_path_function): 9 def covers(coverage_path_function):
10 """Allows annotation of a Test generator function with a function that will 10 """Allows annotation of a Test generator function with a function that will
11 return a list of coverage patterns which should be enabled during the use of 11 return a list of coverage patterns which should be enabled during the use of
12 the Test generator function. 12 the Test generator function.
13 """ 13 """
14 def _decorator(func): 14 def _decorator(func):
15 setattr(func, EXPECT_TESTS_COVER_FUNCTION, coverage_path_function) 15 setattr(func, EXPECT_TESTS_COVER_FUNCTION, coverage_path_function)
16 return func 16 return func
17 return _decorator 17 return _decorator
18 18
19 19
20 def get_cover_list(test_gen_function): 20 def get_cover_list(test_gen_function):
21 """Given a Test generator, return the list of coverage globs that should 21 """Given a Test generator, return the list of coverage globs that should
22 be included while executing the Test generator.""" 22 be included while executing the Test generator."""
23 return getattr(test_gen_function, EXPECT_TESTS_COVER_FUNCTION, 23 return getattr(test_gen_function, EXPECT_TESTS_COVER_FUNCTION,
24 lambda: [inspect.getabsfile(test_gen_function)])() 24 lambda: [inspect.getabsfile(test_gen_function)])()
OLDNEW
« no previous file with comments | « third_party/recipe_engine/expect_tests/unittest_helper.py ('k') | third_party/recipe_engine/field_composer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698