Chromium Code Reviews| Index: tests/gclient_test.py |
| diff --git a/tests/gclient_test.py b/tests/gclient_test.py |
| index 449a49169c56861a442de43dc7816f59ea2839de..96ac1e799660811735079da91f8aad6793802713 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 overridded 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']) |
|
M-A Ruel
2012/11/05 19:48:05
Why not use: '--deps', 'unix' ?
Siva Chandra
2012/11/05 22:13:13
Can you clarify? Are you suggesting I use '--deps'
M-A Ruel
2012/11/06 15:13:18
You are right, I was confused.
|
| + 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. |