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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 self.assertTree(tree) | 510 self.assertTree(tree) |
511 | 511 |
512 def testPreDepsHooksError(self): | 512 def testPreDepsHooksError(self): |
513 if not self.enabled: | 513 if not self.enabled: |
514 return | 514 return |
515 self.gclient(['config', self.git_base + 'repo_5', '--name', 'src']) | 515 self.gclient(['config', self.git_base + 'repo_5', '--name', 'src']) |
516 expectated_stdout = [ | 516 expectated_stdout = [ |
517 ('running', self.root_dir), # pre-deps hook | 517 ('running', self.root_dir), # pre-deps hook |
518 ('running', self.root_dir), # pre-deps hook (fails) | 518 ('running', self.root_dir), # pre-deps hook (fails) |
519 ] | 519 ] |
520 expected_stderr = ("Error: Command '/usr/bin/python2.7 -c import sys; " | 520 expected_stderr = ("Error: Command '/usr/bin/python -c import sys; " |
521 "sys.exit(1)' returned non-zero exit status 1 in %s\n" | 521 "sys.exit(1)' returned non-zero exit status 1 in %s\n" |
522 % self.root_dir) | 522 % self.root_dir) |
523 stdout, stderr, retcode = self.gclient(['sync', '--deps', 'mac', '--jobs=1', | 523 stdout, stderr, retcode = self.gclient(['sync', '--deps', 'mac', '--jobs=1', |
524 '--revision', | 524 '--revision', |
525 'src@' + self.githash('repo_5', 3)]) | 525 'src@' + self.githash('repo_5', 3)]) |
526 self.assertEquals(stderr, expected_stderr) | 526 self.assertEquals(stderr, expected_stderr) |
527 self.assertEquals(2, retcode) | 527 self.assertEquals(2, retcode) |
528 self.checkBlock(stdout, expectated_stdout) | 528 self.checkBlock(stdout, expectated_stdout) |
529 | 529 |
530 def testRevInfo(self): | 530 def testRevInfo(self): |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 | 906 |
907 if '-c' in sys.argv: | 907 if '-c' in sys.argv: |
908 COVERAGE = True | 908 COVERAGE = True |
909 sys.argv.remove('-c') | 909 sys.argv.remove('-c') |
910 if os.path.exists('.coverage'): | 910 if os.path.exists('.coverage'): |
911 os.remove('.coverage') | 911 os.remove('.coverage') |
912 os.environ['COVERAGE_FILE'] = os.path.join( | 912 os.environ['COVERAGE_FILE'] = os.path.join( |
913 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), | 913 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), |
914 '.coverage') | 914 '.coverage') |
915 unittest.main() | 915 unittest.main() |
OLD | NEW |