OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1698 self.gclient(['sync']) | 1698 self.gclient(['sync']) |
1699 | 1699 |
1700 # TODO(maruel): This is incorrect. | 1700 # TODO(maruel): This is incorrect. |
1701 out = self.parseGclient(['status', '--deps', 'mac', '--jobs', '1'], []) | 1701 out = self.parseGclient(['status', '--deps', 'mac', '--jobs', '1'], []) |
1702 | 1702 |
1703 # Revert implies --force implies running hooks without looking at pattern | 1703 # Revert implies --force implies running hooks without looking at pattern |
1704 # matching. | 1704 # matching. |
1705 results = self.gclient(['revert', '--deps', 'mac', '--jobs', '1']) | 1705 results = self.gclient(['revert', '--deps', 'mac', '--jobs', '1']) |
1706 out = self.splitBlock(results[0]) | 1706 out = self.splitBlock(results[0]) |
1707 self.assertEquals(2, len(out)) | 1707 self.assertEquals(2, len(out)) |
1708 self.checkString(2, len(out[0])) | 1708 # This value varies depending on the version of svn being run. |
1709 self.checkString(2, len(out[1])) | 1709 # New vesions (the one in Trust) print "Updating '.':" and "At revision 1.". |
| 1710 # Older versions (the one in Precise) print just "At revision 1.". |
| 1711 #self.assertEquals(3, len(out[0])) |
| 1712 self.assertEquals(2, len(out[1])) |
1710 self.checkString('foo', out[1][1]) | 1713 self.checkString('foo', out[1][1]) |
1711 self.checkString('', results[1]) | 1714 self.checkString('', results[1]) |
1712 self.assertEquals(0, results[2]) | 1715 self.assertEquals(0, results[2]) |
1713 tree = self.mangle_svn_tree( | 1716 tree = self.mangle_svn_tree( |
1714 ('trunk/webkit@2', ''), | 1717 ('trunk/webkit@2', ''), |
1715 ('trunk/third_party/foo@1', 'foo/bar')) | 1718 ('trunk/third_party/foo@1', 'foo/bar')) |
1716 self.assertTree(tree) | 1719 self.assertTree(tree) |
1717 | 1720 |
1718 # TODO(maruel): This is incorrect. | 1721 # TODO(maruel): This is incorrect. |
1719 out = self.parseGclient(['status', '--deps', 'mac'], []) | 1722 out = self.parseGclient(['status', '--deps', 'mac'], []) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1768 | 1771 |
1769 if '-c' in sys.argv: | 1772 if '-c' in sys.argv: |
1770 COVERAGE = True | 1773 COVERAGE = True |
1771 sys.argv.remove('-c') | 1774 sys.argv.remove('-c') |
1772 if os.path.exists('.coverage'): | 1775 if os.path.exists('.coverage'): |
1773 os.remove('.coverage') | 1776 os.remove('.coverage') |
1774 os.environ['COVERAGE_FILE'] = os.path.join( | 1777 os.environ['COVERAGE_FILE'] = os.path.join( |
1775 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), | 1778 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), |
1776 '.coverage') | 1779 '.coverage') |
1777 unittest.main() | 1780 unittest.main() |
OLD | NEW |