From d5766bb0cef8b1e4e7377fbe6cd49698f83114e7 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Thu, 28 Oct 2010 11:40:58 +0000 Subject: [PATCH] Add a new regression test for custom_deps in .gclient files. To make sure to regression is added while looking into the code more deeply. BUG=none TEST=new smoke test Review URL: http://codereview.chromium.org/4215001 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64230 0039d316-1c4b-4281-b951-d872f2087c98 --- tests/gclient_smoketest.py | 42 +++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/tests/gclient_smoketest.py b/tests/gclient_smoketest.py index 189b06451..17269b547 100755 --- a/tests/gclient_smoketest.py +++ b/tests/gclient_smoketest.py @@ -262,11 +262,11 @@ class GClientSmokeSVN(GClientSmokeBase): self.gclient(['config', self.svn_base + 'trunk/src/']) # Test unversioned checkout. self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1'], - ['running', 'running', - # This is due to the way svn update is called for a - # single file when File() is used in a DEPS file. - ('running', os.path.join(self.root_dir, 'src', 'file', 'other')), - 'running', 'running', 'running', 'running']) + ['running', 'running', + # This is due to the way svn update is called for a + # single file when File() is used in a DEPS file. + ('running', os.path.join(self.root_dir, 'src', 'file', 'other')), + 'running', 'running', 'running', 'running']) tree = self.mangle_svn_tree( ('trunk/src@2', 'src'), ('trunk/third_party/foo@1', 'src/third_party/foo'), @@ -402,6 +402,38 @@ class GClientSmokeSVN(GClientSmokeBase): tree['src/svn_hooked1'] = 'svn_hooked1' self.assertTree(tree) + def testSyncCustomDeps(self): + if not self.enabled: + return + out = ( + 'solutions = [\n' + ' { "name" : "src",\n' + ' "url" : "%(base)s/src",\n' + ' "custom_deps" : {\n' + # Remove 2 deps, change 1, add 1. + ' "src/other": None,\n' + ' "src/third_party/foo": \'%(base)s/third_party/prout\',\n' + ' "src/file/other": None,\n' + ' "new_deps": "/trunk/src/third_party",\n' + ' },\n' + ' "safesync_url": "",\n' + ' },\n' + ']\n\n' % + { 'base': self.svn_base + 'trunk' }) + fileobj = open(os.path.join(self.root_dir, '.gclient'), 'w') + fileobj.write(out) + fileobj.close() + self.parseGclient( + ['sync', '--deps', 'mac', '--jobs', '1'], + ['running', 'running', 'running', 'running'], + untangle=True) + tree = self.mangle_svn_tree( + ('trunk/src@2', 'src'), + ('trunk/third_party/prout@2', 'src/third_party/foo'), + ('trunk/src/third_party@2', 'new_deps')) + tree['src/svn_hooked1'] = 'svn_hooked1' + self.assertTree(tree) + def testRevertAndStatus(self): if not self.enabled: return