Chromium Code Reviews| Index: tests/gclient_test.py |
| =================================================================== |
| --- tests/gclient_test.py (revision 134268) |
| +++ tests/gclient_test.py (working copy) |
| @@ -275,7 +275,44 @@ |
| 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 = [ |
|
M-A Ruel
2012/04/27 16:03:37
style nit: If you look at the rest of this file, I
John Grabowski
2012/04/27 16:06:26
Ha! I told pete the opposite.
I think """ is pref
|
| + { "name": "foo", |
| + "url": "svn://example.com/foo", |
| + } |
| +] |
| +target_os = ["baz"]""") |
| + write( |
| + os.path.join('foo', 'DEPS'), |
| + """ |
| +deps = { |
| + "foo/dir1": "/dir1" |
| +} |
| +deps_os = { |
| + "unix": { "foo/dir2": "/dir2" }, |
| + "baz": { "foo/dir3": "/dir3" } |
| +}""") |
| + |
| + parser = gclient.Parser() |
| + options, args = parser.parse_args(['--jobs', '1']) |
| + options.deps_os = "unix" |
| + |
| + obj = gclient.GClient.LoadCurrentConfig(options) |
| + obj.RunOnDeps('None', args) |
| + |
| + self.assertEqual(4, len(self._get_processed())) |
| + |
| + |
| if __name__ == '__main__': |
| sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) |
| sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True) |