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

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: 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
« no previous file with comments | « 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..801f784f1de4edac0db049d2aaf25d29c4e6ec7c 100755
--- a/tests/gclient_test.py
+++ b/tests/gclient_test.py
@@ -306,7 +306,57 @@ class GclientTest(trial_dir.TestCase):
obj = gclient.GClient.LoadCurrentConfig(options)
self.assertEqual(['baz', 'unix'], sorted(obj.enforced_os))
-
+
+ def testRecursionOverride(self):
+ """Verifies gclient respects the recursion var syntax.
+
+ We check several things here:
+ - recursion = 3 sets recursion on the foo dep to exactly 3
+ (we pull /fizz, but not /fuzz)
+ - pulling foo/bar at recursion level 1 (in .gclient) is overriden by
+ a later pull of foo/bar at recursion level 2 (in the dep tree)
+ """
+ write(
+ '.gclient',
+ 'solutions = [\n'
+ ' { "name": "foo", "url": "svn://example.com/foo" },\n'
+ ' { "name": "foo/bar", "url": "svn://example.com/bar" },\n'
+ ']')
+ write(
+ os.path.join('foo', 'DEPS'),
+ 'deps = {\n'
+ ' "bar": "/bar",\n'
+ '}\n'
+ 'recursion = 3')
+ 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'
+ ' "fuzz": "/fuzz",\n'
+ '}')
+
+ options, _ = gclient.Parser().parse_args([])
+ obj = gclient.GClient.LoadCurrentConfig(options)
+ obj.RunOnDeps('None', [])
+ self.assertEquals(
+ [
+ 'svn://example.com/foo',
+ 'svn://example.com/bar',
+ 'svn://example.com/foo/bar',
+ 'svn://example.com/foo/bar/baz',
+ 'svn://example.com/foo/bar/baz/fizz',
+ ],
+ self._get_processed())
+
if __name__ == '__main__':
sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout)
« no previous file with comments | « gclient.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698