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

Side by Side Diff: tests/gclient_smoketest.py

Issue 7918027: Add a --unmanaged flag to gclient config to allow the main solution to be unmanaged by the scm. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/gclient_scm_test.py ('k') | tests/gclient_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Smoke tests for gclient.py. 6 """Smoke tests for gclient.py.
7 7
8 Shell out 'gclient' and run basic conformance tests. 8 Shell out 'gclient' and run basic conformance tests.
9 9
10 This test assumes GClientSmokeBase.URL_BASE is valid. 10 This test assumes GClientSmokeBase.URL_BASE is valid.
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 os.remove(p) 193 os.remove(p)
194 results = self.gclient(cmd) 194 results = self.gclient(cmd)
195 self.check(('', '', 0), results) 195 self.check(('', '', 0), results)
196 self.checkString(expected, open(p, 'rU').read()) 196 self.checkString(expected, open(p, 'rU').read())
197 197
198 test(['config', self.svn_base + 'trunk/src/'], 198 test(['config', self.svn_base + 'trunk/src/'],
199 ('solutions = [\n' 199 ('solutions = [\n'
200 ' { "name" : "src",\n' 200 ' { "name" : "src",\n'
201 ' "url" : "%strunk/src",\n' 201 ' "url" : "%strunk/src",\n'
202 ' "deps_file" : "DEPS",\n' 202 ' "deps_file" : "DEPS",\n'
203 ' "managed" : True,\n'
203 ' "custom_deps" : {\n' 204 ' "custom_deps" : {\n'
204 ' },\n' 205 ' },\n'
205 ' "safesync_url": "",\n' 206 ' "safesync_url": "",\n'
206 ' },\n' 207 ' },\n'
207 ']\n') % self.svn_base) 208 ']\n') % self.svn_base)
208 209
209 test(['config', self.git_base + 'repo_1', '--name', 'src'], 210 test(['config', self.git_base + 'repo_1', '--name', 'src'],
210 ('solutions = [\n' 211 ('solutions = [\n'
211 ' { "name" : "src",\n' 212 ' { "name" : "src",\n'
212 ' "url" : "%srepo_1",\n' 213 ' "url" : "%srepo_1",\n'
213 ' "deps_file" : "DEPS",\n' 214 ' "deps_file" : "DEPS",\n'
215 ' "managed" : True,\n'
214 ' "custom_deps" : {\n' 216 ' "custom_deps" : {\n'
215 ' },\n' 217 ' },\n'
216 ' "safesync_url": "",\n' 218 ' "safesync_url": "",\n'
217 ' },\n' 219 ' },\n'
218 ']\n') % self.git_base) 220 ']\n') % self.git_base)
219 221
220 test(['config', 'foo', 'faa'], 222 test(['config', 'foo', 'faa'],
221 'solutions = [\n' 223 'solutions = [\n'
222 ' { "name" : "foo",\n' 224 ' { "name" : "foo",\n'
223 ' "url" : "foo",\n' 225 ' "url" : "foo",\n'
224 ' "deps_file" : "DEPS",\n' 226 ' "deps_file" : "DEPS",\n'
227 ' "managed" : True,\n'
225 ' "custom_deps" : {\n' 228 ' "custom_deps" : {\n'
226 ' },\n' 229 ' },\n'
227 ' "safesync_url": "faa",\n' 230 ' "safesync_url": "faa",\n'
228 ' },\n' 231 ' },\n'
229 ']\n') 232 ']\n')
230 233
231 test(['config', 'foo', '--deps', 'blah'], 234 test(['config', 'foo', '--deps', 'blah'],
232 'solutions = [\n' 235 'solutions = [\n'
233 ' { "name" : "foo",\n' 236 ' { "name" : "foo",\n'
234 ' "url" : "foo",\n' 237 ' "url" : "foo",\n'
235 ' "deps_file" : "blah",\n' 238 ' "deps_file" : "blah",\n'
239 ' "managed" : True,\n'
236 ' "custom_deps" : {\n' 240 ' "custom_deps" : {\n'
237 ' },\n' 241 ' },\n'
238 ' "safesync_url": "",\n' 242 ' "safesync_url": "",\n'
239 ' },\n' 243 ' },\n'
240 ']\n') 244 ']\n')
241 245
242 test(['config', '--spec', '["blah blah"]'], '["blah blah"]') 246 test(['config', '--spec', '["blah blah"]'], '["blah blah"]')
243 247
244 os.remove(p) 248 os.remove(p)
245 results = self.gclient(['config', 'foo', 'faa', 'fuu']) 249 results = self.gclient(['config', 'foo', 'faa', 'fuu'])
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 'src/other: %(base)s/other@2\n' 684 'src/other: %(base)s/other@2\n'
681 'src/third_party/foo: %(base)s/third_party/foo@1\n' % 685 'src/third_party/foo: %(base)s/third_party/foo@1\n' %
682 { 'base': self.svn_base + 'trunk' }) 686 { 'base': self.svn_base + 'trunk' })
683 self.check((out, '', 0), results) 687 self.check((out, '', 0), results)
684 results = self.gclient(['revinfo', '--deps', 'mac', '--snapshot']) 688 results = self.gclient(['revinfo', '--deps', 'mac', '--snapshot'])
685 out = ('# Snapshot generated with gclient revinfo --snapshot\n' 689 out = ('# Snapshot generated with gclient revinfo --snapshot\n'
686 'solutions = [\n' 690 'solutions = [\n'
687 ' { "name" : "src",\n' 691 ' { "name" : "src",\n'
688 ' "url" : "%(base)s/src",\n' 692 ' "url" : "%(base)s/src",\n'
689 ' "deps_file" : "DEPS",\n' 693 ' "deps_file" : "DEPS",\n'
694 ' "managed" : True,\n'
690 ' "custom_deps" : {\n' 695 ' "custom_deps" : {\n'
691 ' "foo/bar": None,\n' 696 ' "foo/bar": None,\n'
692 ' "invalid": None,\n' 697 ' "invalid": None,\n'
693 ' "src/file/other": \'%(base)s/other/DEPS@2\',\n' 698 ' "src/file/other": \'%(base)s/other/DEPS@2\',\n'
694 ' "src/other": \'%(base)s/other@2\',\n' 699 ' "src/other": \'%(base)s/other@2\',\n'
695 ' "src/third_party/foo": ' 700 ' "src/third_party/foo": '
696 '\'%(base)s/third_party/foo@1\',\n' 701 '\'%(base)s/third_party/foo@1\',\n'
697 ' },\n' 702 ' },\n'
698 ' "safesync_url": "",\n' 703 ' "safesync_url": "",\n'
699 ' },\n' 704 ' },\n'
700 ']\n\n' % 705 ']\n\n' %
701 { 'base': self.svn_base + 'trunk' }) 706 { 'base': self.svn_base + 'trunk' })
702 self.check((out, '', 0), results) 707 self.check((out, '', 0), results)
703 708
704 def testRevInfoAltDeps(self): 709 def testRevInfoAltDeps(self):
705 if not self.enabled: 710 if not self.enabled:
706 return 711 return
707 self.gclient(['config', self.svn_base + 'trunk/src/', '--deps-file', 712 self.gclient(['config', self.svn_base + 'trunk/src/', '--deps-file',
708 'DEPS.alt']) 713 'DEPS.alt'])
709 self.gclient(['sync']) 714 self.gclient(['sync'])
710 results = self.gclient(['revinfo', '--snapshot']) 715 results = self.gclient(['revinfo', '--snapshot'])
711 out = ('# Snapshot generated with gclient revinfo --snapshot\n' 716 out = ('# Snapshot generated with gclient revinfo --snapshot\n'
712 'solutions = [\n' 717 'solutions = [\n'
713 ' { "name" : "src",\n' 718 ' { "name" : "src",\n'
714 ' "url" : "%(base)s/src",\n' 719 ' "url" : "%(base)s/src",\n'
715 ' "deps_file" : "DEPS.alt",\n' 720 ' "deps_file" : "DEPS.alt",\n'
721 ' "managed" : True,\n'
716 ' "custom_deps" : {\n' 722 ' "custom_deps" : {\n'
717 ' "src/other2": \'%(base)s/other@2\',\n' 723 ' "src/other2": \'%(base)s/other@2\',\n'
718 ' },\n' 724 ' },\n'
719 ' "safesync_url": "",\n' 725 ' "safesync_url": "",\n'
720 ' },\n' 726 ' },\n'
721 ']\n\n' % 727 ']\n\n' %
722 { 'base': self.svn_base + 'trunk' }) 728 { 'base': self.svn_base + 'trunk' })
723 self.check((out, '', 0), results) 729 self.check((out, '', 0), results)
724 730
725 731
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 1265
1260 if '-c' in sys.argv: 1266 if '-c' in sys.argv:
1261 COVERAGE = True 1267 COVERAGE = True
1262 sys.argv.remove('-c') 1268 sys.argv.remove('-c')
1263 if os.path.exists('.coverage'): 1269 if os.path.exists('.coverage'):
1264 os.remove('.coverage') 1270 os.remove('.coverage')
1265 os.environ['COVERAGE_FILE'] = os.path.join( 1271 os.environ['COVERAGE_FILE'] = os.path.join(
1266 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 1272 os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
1267 '.coverage') 1273 '.coverage')
1268 unittest.main() 1274 unittest.main()
OLDNEW
« no previous file with comments | « tests/gclient_scm_test.py ('k') | tests/gclient_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698