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

Unified Diff: tests/gclient_test.py

Issue 11368067: 'dep_os' paths override 'deps' paths. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fix a typo Created 8 years, 1 month 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 449a49169c56861a442de43dc7816f59ea2839de..35f2be29c036b35213b821a0d08eb4859a4f8fa1 100755
--- a/tests/gclient_test.py
+++ b/tests/gclient_test.py
@@ -425,6 +425,46 @@ class GclientTest(trial_dir.TestCase):
],
sorted(self._get_processed()))
+ def testDepsOsOverrideDepsInDepsFile(self):
+ """Verifies that a 'deps_os' path can override a 'deps' path.
+ """
+
+ write(
+ '.gclient',
+ 'solutions = [\n'
+ ' { "name": "foo",\n'
+ ' "url": "svn://example.com/foo",\n'
+ ' },]\n')
+ write(
+ os.path.join('foo', 'DEPS'),
+ 'target_os = ["baz"]\n'
+ 'deps = {\n'
+ ' "foo/src": "/src",\n' # This path is to be overridden by similar path
+ # in deps_os['unix'].
+ '}\n'
+ 'deps_os = {\n'
+ ' "unix": { "foo/unix": "/unix",'
+ ' "foo/src": "/src_unix"},\n'
+ ' "baz": { "foo/baz": "/baz", },\n'
+ ' "jaz": { "foo/jaz": "/jaz", },\n'
+ '}')
+
+ parser = gclient.Parser()
+ options, _ = parser.parse_args(['--jobs', '1'])
+ options.deps_os = 'unix'
+
+ obj = gclient.GClient.LoadCurrentConfig(options)
+ obj.RunOnDeps('None', [])
+ self.assertEqual(['unix'], sorted(obj.enforced_os))
+ self.assertEquals(
+ [
+ 'svn://example.com/foo',
+ 'svn://example.com/foo/baz',
+ 'svn://example.com/foo/src_unix',
+ 'svn://example.com/foo/unix',
+ ],
+ sorted(self._get_processed()))
+
def testRecursionOverride(self):
"""Verifies gclient respects the recursion var syntax.
« 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