OLD | NEW |
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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 ('trunk/src@2', 'src'), | 320 ('trunk/src@2', 'src'), |
321 ('trunk/third_party/foo@2', 'src/third_party/fpp'), | 321 ('trunk/third_party/foo@2', 'src/third_party/fpp'), |
322 ('trunk/third_party/foo@1', 'src/third_party/foo'), | 322 ('trunk/third_party/foo@1', 'src/third_party/foo'), |
323 ('trunk/other@2', 'src/other'), | 323 ('trunk/other@2', 'src/other'), |
324 ('trunk/third_party/foo@2', 'src/third_party/prout')) | 324 ('trunk/third_party/foo@2', 'src/third_party/prout')) |
325 tree['src/file/other/DEPS'] = ( | 325 tree['src/file/other/DEPS'] = ( |
326 self.FAKE_REPOS.svn_revs[2]['trunk/other/DEPS']) | 326 self.FAKE_REPOS.svn_revs[2]['trunk/other/DEPS']) |
327 tree['src/svn_hooked1'] = 'svn_hooked1' | 327 tree['src/svn_hooked1'] = 'svn_hooked1' |
328 self.assertTree(tree) | 328 self.assertTree(tree) |
329 | 329 |
| 330 def testSyncTransitive(self): |
| 331 # TODO(maruel): safesync. |
| 332 if not self.enabled: |
| 333 return |
| 334 self.gclient(['config', self.svn_base + 'trunk/src/']) |
| 335 |
| 336 # Make sure we can populate a new repository with --transitive. |
| 337 self.parseGclient( |
| 338 ['sync', '--transitive', '--revision', 'src@1', '--deps', 'mac', |
| 339 '--jobs', '1'], |
| 340 ['running', 'running', 'running', 'running']) |
| 341 tree = self.mangle_svn_tree( |
| 342 ('trunk/src@1', 'src'), |
| 343 ('trunk/third_party/foo@1', 'src/third_party/fpp'), |
| 344 ('trunk/other@1', 'src/other'), |
| 345 ('trunk/third_party/foo@1', 'src/third_party/prout')) |
| 346 |
| 347 # Get up to date, so we can test synching back. |
| 348 self.gclient(['sync', '--deps', 'mac', '--jobs', '1']) |
| 349 |
| 350 # Manually remove svn_hooked1 before synching to make sure it's not |
| 351 # recreated. |
| 352 os.remove(join(self.root_dir, 'src', 'svn_hooked1')) |
| 353 |
| 354 self.parseGclient( |
| 355 ['sync', '--transitive', '--revision', 'src@1', '--deps', 'mac', |
| 356 '--delete_unversioned_trees', '--jobs', '1'], |
| 357 ['running', 'running', 'running', 'running', 'deleting']) |
| 358 tree = self.mangle_svn_tree( |
| 359 ('trunk/src@1', 'src'), |
| 360 ('trunk/third_party/foo@1', 'src/third_party/fpp'), |
| 361 ('trunk/other@1', 'src/other'), |
| 362 ('trunk/third_party/foo@1', 'src/third_party/prout')) |
| 363 tree['src/file/other/DEPS'] = ( |
| 364 self.FAKE_REPOS.svn_revs[2]['trunk/other/DEPS']) |
| 365 self.assertTree(tree) |
| 366 |
330 def testSyncIgnoredSolutionName(self): | 367 def testSyncIgnoredSolutionName(self): |
331 """TODO(maruel): This will become an error soon.""" | 368 """TODO(maruel): This will become an error soon.""" |
332 if not self.enabled: | 369 if not self.enabled: |
333 return | 370 return |
334 self.gclient(['config', self.svn_base + 'trunk/src/']) | 371 self.gclient(['config', self.svn_base + 'trunk/src/']) |
335 results = self.gclient( | 372 results = self.gclient( |
336 ['sync', '--deps', 'mac', '-r', 'invalid@1', '--jobs', '1']) | 373 ['sync', '--deps', 'mac', '-r', 'invalid@1', '--jobs', '1']) |
337 self.checkBlock(results[0], [ | 374 self.checkBlock(results[0], [ |
338 'running', 'running', | 375 'running', 'running', |
339 # This is due to the way svn update is called for a single file when | 376 # This is due to the way svn update is called for a single file when |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 | 1219 |
1183 if '-c' in sys.argv: | 1220 if '-c' in sys.argv: |
1184 COVERAGE = True | 1221 COVERAGE = True |
1185 sys.argv.remove('-c') | 1222 sys.argv.remove('-c') |
1186 if os.path.exists('.coverage'): | 1223 if os.path.exists('.coverage'): |
1187 os.remove('.coverage') | 1224 os.remove('.coverage') |
1188 os.environ['COVERAGE_FILE'] = os.path.join( | 1225 os.environ['COVERAGE_FILE'] = os.path.join( |
1189 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), | 1226 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), |
1190 '.coverage') | 1227 '.coverage') |
1191 unittest.main() | 1228 unittest.main() |
OLD | NEW |