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

Unified Diff: test/analyzer/gyptest-analyzer.new.py

Issue 442083004: Adds support for detecting modified gyp* files to analyzer (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 4 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 | « test/analyzer/common.gypi ('k') | test/analyzer/subdir2/subdir.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/analyzer/gyptest-analyzer.new.py
===================================================================
--- test/analyzer/gyptest-analyzer.new.py (revision 1961)
+++ test/analyzer/gyptest-analyzer.new.py (working copy)
@@ -42,8 +42,14 @@
'-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|."""
+ """Verifies output contains |targets|."""
result = _ReadOutputFileContents()
if result.get('error', None):
print 'unexpected error', result.get('error')
@@ -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()
« no previous file with comments | « test/analyzer/common.gypi ('k') | test/analyzer/subdir2/subdir.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698