OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 self.checkString('other', out[0][1]) | 366 self.checkString('other', out[0][1]) |
367 self.checkString(join('third_party', 'fpp'), out[0][2]) | 367 self.checkString(join('third_party', 'fpp'), out[0][2]) |
368 self.checkString(join('third_party', 'prout'), out[0][3]) | 368 self.checkString(join('third_party', 'prout'), out[0][3]) |
369 self.checkString('hi', out[1][1]) | 369 self.checkString('hi', out[1][1]) |
370 self.assertEquals(4, len(out[0])) | 370 self.assertEquals(4, len(out[0])) |
371 self.assertEquals(2, len(out[1])) | 371 self.assertEquals(2, len(out[1])) |
372 | 372 |
373 # So verify it works with --verbose. | 373 # So verify it works with --verbose. |
374 out = self.parseGclient(['status', '--deps', 'mac', '--verbose'], | 374 out = self.parseGclient(['status', '--deps', 'mac', '--verbose'], |
375 [['running', join(self.root_dir, 'src')], | 375 [['running', join(self.root_dir, 'src')], |
| 376 ['running', join(self.root_dir, 'src', 'third_party', 'fpp')], |
376 ['running', join(self.root_dir, 'src', 'other')], | 377 ['running', join(self.root_dir, 'src', 'other')], |
377 ['running', join(self.root_dir, 'src', 'third_party', 'fpp')], | |
378 ['running', join(self.root_dir, 'src', 'third_party', 'prout')]]) | 378 ['running', join(self.root_dir, 'src', 'third_party', 'prout')]]) |
379 out = self.svnBlockCleanup(out) | 379 out = self.svnBlockCleanup(out) |
380 self.checkString('other', out[0][1]) | 380 self.checkString('other', out[0][1]) |
381 self.checkString(join('third_party', 'fpp'), out[0][2]) | 381 self.checkString(join('third_party', 'fpp'), out[0][2]) |
382 self.checkString(join('third_party', 'prout'), out[0][3]) | 382 self.checkString(join('third_party', 'prout'), out[0][3]) |
383 self.checkString('hi', out[1][1]) | 383 self.checkString('hi', out[2][1]) |
384 self.assertEquals(4, len(out[0])) | 384 self.assertEquals(4, len(out[0])) |
385 self.assertEquals(2, len(out[1])) | 385 self.assertEquals(1, len(out[1])) |
| 386 self.assertEquals(2, len(out[2])) |
| 387 self.assertEquals(1, len(out[3])) |
| 388 self.assertEquals(4, len(out)) |
386 | 389 |
387 # Revert implies --force implies running hooks without looking at pattern | 390 # Revert implies --force implies running hooks without looking at pattern |
388 # matching. | 391 # matching. |
389 # TODO(maruel): In general, gclient revert output is wrong. It should output | 392 # TODO(maruel): In general, gclient revert output is wrong. It should output |
390 # the file list after some ___ running 'svn status' | 393 # the file list after some ___ running 'svn status' |
391 results = self.gclient(['revert', '--deps', 'mac']) | 394 results = self.gclient(['revert', '--deps', 'mac']) |
392 out = self.splitBlock(results[0]) | 395 out = self.splitBlock(results[0]) |
393 self.assertEquals(7, len(out)) | 396 self.assertEquals(7, len(out)) |
394 self.checkString('', results[1]) | 397 self.checkString('', results[1]) |
395 self.assertEquals(0, results[2]) | 398 self.assertEquals(0, results[2]) |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 if __name__ == '__main__': | 828 if __name__ == '__main__': |
826 if '-c' in sys.argv: | 829 if '-c' in sys.argv: |
827 COVERAGE = True | 830 COVERAGE = True |
828 sys.argv.remove('-c') | 831 sys.argv.remove('-c') |
829 if os.path.exists('.coverage'): | 832 if os.path.exists('.coverage'): |
830 os.remove('.coverage') | 833 os.remove('.coverage') |
831 os.environ['COVERAGE_FILE'] = os.path.join( | 834 os.environ['COVERAGE_FILE'] = os.path.join( |
832 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), | 835 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), |
833 '.coverage') | 836 '.coverage') |
834 unittest.main() | 837 unittest.main() |
OLD | NEW |