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

Unified Diff: tests/gclient_test.py

Issue 11146032: Add recursion=n syntax to DEPS files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Addressed formatting nits, added unit test Created 8 years, 2 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
« gclient.py ('K') | « gclient.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_test.py
diff --git a/tests/gclient_test.py b/tests/gclient_test.py
index 235ca54f574f6a67fb9c4560f33e5ffb1c1a9a3f..b2d04e8797cf3263f601d637c619e34579a55111 100755
--- a/tests/gclient_test.py
+++ b/tests/gclient_test.py
@@ -306,7 +306,50 @@ class GclientTest(trial_dir.TestCase):
obj = gclient.GClient.LoadCurrentConfig(options)
self.assertEqual(['baz', 'unix'], sorted(obj.enforced_os))
-
+
+ def testRecursionOverride(self):
+ """Verifies that recursion variable allows gclient to pull additional deps.
+
+ We only test the case of recursion override for top-level deps, as that is
+ all we support.
+ """
+ write(
+ '.gclient',
+ 'solutions = [\n'
+ ' { "name": "foo", "url": "svn://example.com/foo" },\n'
+ ']')
+ write(
+ os.path.join('foo', 'DEPS'),
+ 'deps = {\n'
+ ' "bar": "/bar",\n'
+ '}\n'
+ 'recursion = 2')
+ write(
+ os.path.join('bar', 'DEPS'),
+ 'deps = {\n'
+ ' "baz": "/baz",\n'
+ '}')
+ write(
+ os.path.join('baz', 'DEPS'),
+ 'deps = {\n'
+ ' "fizz": "/fizz",\n'
+ '}')
+ write(
+ os.path.join('fizz', 'DEPS'),
+ 'deps = {\n'
+ '}')
+
+ options, _ = gclient.Parser().parse_args([])
+ obj = gclient.GClient.LoadCurrentConfig(options)
+ obj.RunOnDeps('None', [])
+ self.assertEquals(
+ [
+ 'svn://example.com/foo',
+ 'svn://example.com/foo/bar',
+ 'svn://example.com/foo/bar/baz',
+ ],
+ self._get_processed())
+
if __name__ == '__main__':
sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout)
« gclient.py ('K') | « gclient.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698