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

Unified Diff: tests/gclient_test.py

Issue 11246004: Allow DEPS file to specify 'target_os'. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Added pylint disable W0212 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 801f784f1de4edac0db049d2aaf25d29c4e6ec7c..02f57b4373780a5d33c860b4b3145a2672245c4d 100755
--- a/tests/gclient_test.py
+++ b/tests/gclient_test.py
@@ -307,6 +307,42 @@ class GclientTest(trial_dir.TestCase):
obj = gclient.GClient.LoadCurrentConfig(options)
self.assertEqual(['baz', 'unix'], sorted(obj.enforced_os))
+ def testTargetOsInDepsFile(self):
+ """Verifies that specifying a target_os value in a DEPS file pulls in all
+ relevant dependencies.
+
+ The target_os variable in a DEPS file allows specifying the name of an
+ additional OS which should be considered when selecting dependencies from a
+ DEPS' deps_os. The value will be appended to the _enforced_os tuple.
+ """
+
+ write(
+ '.gclient',
+ 'solutions = [\n'
+ ' { "name": "foo",\n'
+ ' "url": "svn://example.com/foo",\n'
+ ' }]\n')
+ write(
+ os.path.join('foo', 'DEPS'),
+ 'deps = {\n'
+ ' "foo/dir1": "/dir1",'
+ '}\n'
+ 'target_os = ["baz", "jaz"]\n'
+ 'deps_os = {\n'
+ ' "unix": { "foo/dir2": "/dir2", },\n'
+ ' "baz": { "foo/dir3": "/dir3", },\n'
+ ' "jaz": { "foo/dir4": "/dir4", },\n'
+ ' "maz": { "foo/dir5": "/dir5", },\n'
+ '}')
+
+ parser = gclient.Parser()
+ options, _ = parser.parse_args(['--jobs', '1'])
+ options.deps_os = 'unix'
+
+ obj = gclient.GClient.LoadCurrentConfig(options)
+ obj.RunOnDeps(None, None)
+ self.assertEqual(['baz', 'jaz', 'unix'], sorted(obj.enforced_os))
+
def testRecursionOverride(self):
"""Verifies gclient respects the recursion var syntax.
« gclient.py ('K') | « gclient.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698