Chromium Code Reviews| Index: test/analyzer/gyptest-analyzer.new.py |
| =================================================================== |
| --- test/analyzer/gyptest-analyzer.new.py (revision 1961) |
| +++ test/analyzer/gyptest-analyzer.new.py (working copy) |
| @@ -42,6 +42,12 @@ |
| '-Ganalyzer_output_path=analyzer_output') |
| test.run_gyp('test.gyp', *args, **kw) |
| +def run_analyzer2(*args, **kw): |
| + """Runs the test specifying a particular config and output path.""" |
| + args += ('-Gconfig_path=test_file', |
| + '-Ganalyzer_output_path=analyzer_output') |
| + test.run_gyp('test2.gyp', *args, **kw) |
| + |
| def EnsureContains(targets=set(), matched=False): |
| """Verifies output contains |targets| and |direct_targets|.""" |
|
scottmg
2014/08/05 23:02:43
Looks like there's no |direct_targets| any longer.
sky
2014/08/06 00:26:07
Done.
|
| result = _ReadOutputFileContents() |
| @@ -196,4 +202,28 @@ |
| run_analyzer() |
| EnsureContains(matched=True) |
| +# Assertions when modifying build (gyp/gypi) files, especially when said files |
| +# are included. |
| +_CreateTestFile(['subdir2/d.cc'], ['exe', 'exe2', 'foo', 'exe3']) |
| +run_analyzer2() |
| +EnsureContains(matched=True, targets={'exe', 'foo'}) |
| + |
| +_CreateTestFile(['subdir2/subdir.includes.gypi'], |
| + ['exe', 'exe2', 'foo', 'exe3']) |
| +run_analyzer2() |
| +EnsureContains(matched=True, targets={'exe', 'foo'}) |
| + |
| +_CreateTestFile(['subdir2/subdir.gyp'], ['exe', 'exe2', 'foo', 'exe3']) |
| +run_analyzer2() |
| +EnsureContains(matched=True, targets={'exe', 'foo'}) |
| + |
| +_CreateTestFile(['test2.includes.gypi'], ['exe', 'exe2', 'foo', 'exe3']) |
| +run_analyzer2() |
| +EnsureContains(matched=True, targets={'exe', 'exe2', 'exe3'}) |
| + |
| +# Verify modifying a file included makes all targets dirty. |
| +_CreateTestFile(['common.gypi'], ['exe', 'exe2', 'foo', 'exe3']) |
| +run_analyzer2('-Icommon.gypi') |
| +EnsureContains(matched=True, targets={'exe', 'foo', 'exe2', 'exe3'}) |
| + |
| test.pass_test() |