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

Side by Side Diff: tests/gclient_smoketest.py

Issue 6792060: Make more tests pass on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 8 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
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 def checkBlock(self, stdout, items): 120 def checkBlock(self, stdout, items):
121 results = self.splitBlock(stdout) 121 results = self.splitBlock(stdout)
122 for i in xrange(min(len(results), len(items))): 122 for i in xrange(min(len(results), len(items))):
123 if isinstance(items[i], (list, tuple)): 123 if isinstance(items[i], (list, tuple)):
124 verb = items[i][0] 124 verb = items[i][0]
125 path = items[i][1] 125 path = items[i][1]
126 else: 126 else:
127 verb = items[i] 127 verb = items[i]
128 path = self.root_dir 128 path = self.root_dir
129 self.checkString(results[i][0][0], verb, (i, results[i][0][0], verb)) 129 self.checkString(results[i][0][0], verb, (i, results[i][0][0], verb))
130 self.checkString(results[i][0][2], path, (i, results[i][0][2], path)) 130 if sys.platform == 'win32':
131 # Make path lower case since casing can change randomly.
132 self.checkString(
133 results[i][0][2].lower(),
134 path.lower(),
135 (i, results[i][0][2].lower(), path.lower()))
136 else:
137 self.checkString(results[i][0][2], path, (i, results[i][0][2], path))
131 self.assertEquals(len(results), len(items), (stdout, items, len(results))) 138 self.assertEquals(len(results), len(items), (stdout, items, len(results)))
132 return results 139 return results
133 140
134 @staticmethod 141 @staticmethod
135 def svnBlockCleanup(out): 142 def svnBlockCleanup(out):
136 """Work around svn status difference between svn 1.5 and svn 1.6 143 """Work around svn status difference between svn 1.5 and svn 1.6
137 I don't know why but on Windows they are reversed. So sorts the items.""" 144 I don't know why but on Windows they are reversed. So sorts the items."""
138 for i in xrange(len(out)): 145 for i in xrange(len(out)):
139 if len(out[i]) < 2: 146 if len(out[i]) < 2:
140 continue 147 continue
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 1182
1176 if '-c' in sys.argv: 1183 if '-c' in sys.argv:
1177 COVERAGE = True 1184 COVERAGE = True
1178 sys.argv.remove('-c') 1185 sys.argv.remove('-c')
1179 if os.path.exists('.coverage'): 1186 if os.path.exists('.coverage'):
1180 os.remove('.coverage') 1187 os.remove('.coverage')
1181 os.environ['COVERAGE_FILE'] = os.path.join( 1188 os.environ['COVERAGE_FILE'] = os.path.join(
1182 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 1189 os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
1183 '.coverage') 1190 '.coverage')
1184 unittest.main() 1191 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698