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

Side by Side Diff: tools/isolate/isolate_test.py

Issue 9835084: Implementing stateful directory tracking for dtrace on OSX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase against http://codereview.chromium.org/9834052 Created 8 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
« no previous file with comments | « no previous file | tools/isolate/trace_inputs.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import hashlib 6 import hashlib
7 import json 7 import json
8 import logging 8 import logging
9 import os 9 import os
10 import re 10 import re
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 '--', 218 '--',
219 sys.executable, os.path.join(ROOT_DIR, 'isolate_test.py'), '--ok', 219 sys.executable, os.path.join(ROOT_DIR, 'isolate_test.py'), '--ok',
220 ] 220 ]
221 out = self._execute(cmd, True) 221 out = self._execute(cmd, True)
222 self._expected_tree(['result', 'result.log']) 222 self._expected_tree(['result', 'result.log'])
223 # The 'result.log' log is OS-specific so we can't read it but we can read 223 # The 'result.log' log is OS-specific so we can't read it but we can read
224 # the gyp result. 224 # the gyp result.
225 # cmd[0] is not generated from infiles[0] so it's not using a relative path. 225 # cmd[0] is not generated from infiles[0] so it's not using a relative path.
226 self._expected_result( 226 self._expected_result(
227 False, ['isolate_test.py'], ['isolate_test.py', '--ok'], False) 227 False, ['isolate_test.py'], ['isolate_test.py', '--ok'], False)
228 if sys.platform == 'linux2': 228 expected = (
229 expected = ( 229 "{\n 'variables': {\n"
230 "{\n 'variables': {\n" 230 " 'isolate_files': [\n"
231 " 'isolate_files': [\n" 231 " '<(DEPTH)/isolate_test.py',\n"
232 " '<(DEPTH)/isolate_test.py',\n" 232 " ],\n"
233 " ],\n" 233 " 'isolate_dirs': [\n"
234 " 'isolate_dirs': [\n" 234 " ],\n },\n},\n")
235 " ],\n },\n},\n")
236 else:
237 # TODO(maruel): BUG with relative paths on darwin.
238 expected = (
239 "{\n 'variables': {\n"
240 " 'isolate_files': [\n"
241 " ],\n"
242 " 'isolate_dirs': [\n"
243 " ],\n },\n},\n")
244 self.assertEquals(expected, out) 235 self.assertEquals(expected, out)
245 236
246 237
247 def main(): 238 def main():
248 global VERBOSE 239 global VERBOSE
249 VERBOSE = '-v' in sys.argv 240 VERBOSE = '-v' in sys.argv
250 level = logging.DEBUG if VERBOSE else logging.ERROR 241 level = logging.DEBUG if VERBOSE else logging.ERROR
251 logging.basicConfig(level=level) 242 logging.basicConfig(level=level)
252 if len(sys.argv) == 1: 243 if len(sys.argv) == 1:
253 unittest.main() 244 unittest.main()
254 if sys.argv[1] == '--ok': 245 if sys.argv[1] == '--ok':
255 return 0 246 return 0
256 if sys.argv[1] == '--fail': 247 if sys.argv[1] == '--fail':
257 return 1 248 return 1
258 249
259 unittest.main() 250 unittest.main()
260 251
261 252
262 if __name__ == '__main__': 253 if __name__ == '__main__':
263 sys.exit(main()) 254 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | tools/isolate/trace_inputs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698