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

Unified Diff: tests/gclient_test.py

Issue 10127004: Add the ability to specify a target_os for gclient solutions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 8 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
===================================================================
--- tests/gclient_test.py (revision 134268)
+++ tests/gclient_test.py (working copy)
@@ -275,7 +275,39 @@
work_queue.flush({}, None, [], options=options)
self.assertEqual(client.GetHooks(options), [x['action'] for x in hooks])
+ def testTargetOS(self):
+ """Verifies that specifying a target_os pulls in all relevant dependencies.
+ The target_os variable 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'
+ 'target_os = ["baz"]')
+ write(
+ os.path.join('foo', 'DEPS'),
+ 'deps = {\n'
+ ' "foo/dir1": "/dir1",'
+ '}\n'
+ 'deps_os = {\n'
+ ' "unix": { "foo/dir2": "/dir2", },\n'
+ ' "baz": { "foo/dir3": "/dir3", },\n'
+ '}')
+
+ parser = gclient.Parser()
+ options, _ = parser.parse_args(['--jobs', '1'])
+ options.deps_os = "unix"
+
+ obj = gclient.GClient.LoadCurrentConfig(options)
+ self.assertEqual(['baz', 'unix'], sorted(obj.enforced_os))
+
+
if __name__ == '__main__':
sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout)
sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True)
« 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