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

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

Issue 10545098: Implement parallel support on LogmanTrace on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | « tools/isolate/trace_inputs.py ('k') | no next file » | 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 json 6 import json
7 import logging 7 import logging
8 import os 8 import os
9 import shutil 9 import shutil
10 import subprocess 10 import subprocess
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 self.assertEquals(expected, actual) 373 self.assertEquals(expected, actual)
374 files = [ 374 files = [
375 os.path.join(u'data', 'trace_inputs') + os.path.sep, 375 os.path.join(u'data', 'trace_inputs') + os.path.sep,
376 u'trace_inputs.py', 376 u'trace_inputs.py',
377 u'trace_inputs_smoke_test.py', 377 u'trace_inputs_smoke_test.py',
378 ] 378 ]
379 simplified = self.trace_inputs.extract_directories(ROOT_DIR, results.files) 379 simplified = self.trace_inputs.extract_directories(ROOT_DIR, results.files)
380 self.assertEquals(files, [f.path for f in simplified]) 380 self.assertEquals(files, [f.path for f in simplified])
381 381
382 def test_trace_multiple(self): 382 def test_trace_multiple(self):
383 if sys.platform not in ('darwin', 'linux2'):
384 # TODO(maruel): Soon!
385 return
386 # Starts PARALLEL threads and trace PARALLEL child processes simultaneously. 383 # Starts PARALLEL threads and trace PARALLEL child processes simultaneously.
387 # Some are started from 'data' directory, others from this script's 384 # Some are started from 'data' directory, others from this script's
388 # directory. One trace fails. Verify everything still goes one. 385 # directory. One trace fails. Verify everything still goes one.
389 PARALLEL = 8 386 PARALLEL = 8
390 387
391 def trace(tracer, cmd, cwd, tracename): 388 def trace(tracer, cmd, cwd, tracename):
392 resultcode, output = tracer.trace( 389 resultcode, output = tracer.trace(
393 cmd, cwd, tracename, True) 390 cmd, cwd, tracename, True)
394 return (tracename, resultcode, output) 391 return (tracename, resultcode, output)
395 392
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 actual = results.flatten() 451 actual = results.flatten()
455 self.assertTrue(actual['root'].pop('pid')) 452 self.assertTrue(actual['root'].pop('pid'))
456 if index != BUSTED: 453 if index != BUSTED:
457 self.assertTrue(actual['root']['children'][0].pop('pid')) 454 self.assertTrue(actual['root']['children'][0].pop('pid'))
458 self.assertEquals(expected_results[index], actual) 455 self.assertEquals(expected_results[index], actual)
459 456
460 if __name__ == '__main__': 457 if __name__ == '__main__':
461 VERBOSE = '-v' in sys.argv 458 VERBOSE = '-v' in sys.argv
462 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) 459 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR)
463 unittest.main() 460 unittest.main()
OLDNEW
« no previous file with comments | « tools/isolate/trace_inputs.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698