Index: scripts/slave/recipe_modules/filter/example.py |
diff --git a/scripts/slave/recipe_modules/filter/example.py b/scripts/slave/recipe_modules/filter/example.py |
index 83c66b0284ba5beb44aff20ec877297fd6af3d53..071b31ebc3326173e6f4cb2049c9103e7c7d98a8 100644 |
--- a/scripts/slave/recipe_modules/filter/example.py |
+++ b/scripts/slave/recipe_modules/filter/example.py |
@@ -21,6 +21,9 @@ def GenSteps(api): |
assert (not api.properties['example_matching_exes'] or |
list(api.properties['example_matching_exes']) == |
api.filter.matching_exes) |
+ assert (not api.properties['example_matching_compile_targets'] or |
+ list(api.properties['example_matching_compile_targets']) == |
+ api.filter.compile_targets) |
iannucci
2014/08/20 17:54:39
nit: these asserts seem overly verbose... couldn't
sky
2014/08/20 20:26:33
I only wanted to do the interesting part of the as
|
api.step('hello', ['echo', 'Why hello, there.']) |
def GenTests(api): |
@@ -29,6 +32,7 @@ def GenTests(api): |
api.properties(filter_exclusions=[]) + |
api.properties(example_result=None) + |
api.properties(example_matching_exes=None) + |
+ api.properties(example_matching_compile_targets=None) + |
iannucci
2014/08/20 17:54:39
fyi: you can do multiple properties per call here:
sky
2014/08/20 20:26:32
Done.
|
api.override_step_data( |
'git diff to analyze patch', |
api.raw_io.stream_output('yy'))) |
@@ -38,6 +42,7 @@ def GenTests(api): |
api.properties(filter_exclusions=['fo.*']) + |
api.properties(example_result=1) + |
api.properties(example_matching_exes=None) + |
+ api.properties(example_matching_compile_targets=None) + |
api.override_step_data( |
'git diff to analyze patch', |
api.raw_io.stream_output('foo.cc'))) |
@@ -47,6 +52,7 @@ def GenTests(api): |
api.properties(filter_exclusions=['fo.*']) + |
api.properties(example_result=None) + |
api.properties(example_matching_exes=None) + |
+ api.properties(example_matching_compile_targets=None) + |
api.override_step_data( |
'git diff to analyze patch', |
api.raw_io.stream_output('bar.cc'))) |
@@ -55,35 +61,50 @@ def GenTests(api): |
yield (api.test('analyzes_returns_true') + |
api.properties(example_result=1) + |
api.properties(example_matching_exes=None) + |
+ api.properties(example_matching_compile_targets=None) + |
api.override_step_data( |
'analyze', |
api.json.output({'status': 'Found dependency', |
- 'targets': []}))) |
+ 'targets': [], |
+ 'build_targets': []}))) |
# Analyze returns matching tests while matching all. |
yield (api.test('analyzes_matches_all_exes') + |
- api.properties(matching_exes=['foo', 'bar']) + |
- api.properties(example_matching_exes=['foo']) + |
api.properties(example_result=1) + |
+ api.properties(example_matching_exes=None) + |
+ api.properties(example_matching_compile_targets=None) + |
api.override_step_data( |
'analyze', |
- api.json.output({'status': 'Found dependency (all)', |
- 'targets': ['foo']}))) |
+ api.json.output({'status': 'Found dependency (all)'}))) |
# Analyze matches all and returns matching tests. |
yield (api.test('analyzes_matches_exes') + |
api.properties(matching_exes=['foo', 'bar']) + |
api.properties(example_matching_exes=['foo']) + |
+ api.properties(example_matching_compile_targets=None) + |
+ api.properties(example_result=1) + |
+ api.override_step_data( |
+ 'analyze', |
+ api.json.output({'status': 'Found dependency', |
+ 'targets': ['foo'], |
+ 'build_targets': []}))) |
+ |
+ # Analyze matches all and returns matching tests. |
+ yield (api.test('analyzes_matches_compile_targets') + |
+ api.properties(example_matching_exes=None) + |
+ api.properties(example_matching_compile_targets=['bar']) + |
api.properties(example_result=1) + |
api.override_step_data( |
'analyze', |
api.json.output({'status': 'Found dependency', |
- 'targets': ['foo']}))) |
+ 'targets': ['foo'], |
+ 'build_targets': ['bar']}))) |
# Analyze with error condition. |
yield (api.test('analyzes_error') + |
api.properties(matching_exes=None) + |
api.properties(example_matching_exes=None) + |
+ api.properties(example_matching_compile_targets=None) + |
api.properties(example_result=1) + |
api.override_step_data( |
'analyze', |
@@ -93,6 +114,7 @@ def GenTests(api): |
yield (api.test('bad_retcode_doesnt_fail') + |
api.properties(matching_exes=None) + |
api.properties(example_matching_exes=None) + |
+ api.properties(example_matching_compile_targets=None) + |
api.properties(example_result=1) + |
api.step_data( |
'analyze', |