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

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
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()

Powered by Google App Engine
This is Rietveld 408576698