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

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

Issue 10377105: Add scripts to list or trace all test cases in a gtest executable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 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/isolate.py ('k') | tools/isolate/list_test_cases.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 cStringIO 6 import cStringIO
7 import hashlib 7 import hashlib
8 import json 8 import json
9 import logging 9 import logging
10 import os 10 import os
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 LEVEL = isolate.STATS_ONLY 453 LEVEL = isolate.STATS_ONLY
454 454
455 @staticmethod 455 @staticmethod
456 def _to_string(values): 456 def _to_string(values):
457 buf = cStringIO.StringIO() 457 buf = cStringIO.StringIO()
458 isolate.trace_inputs.pretty_print(values, buf) 458 isolate.trace_inputs.pretty_print(values, buf)
459 return buf.getvalue() 459 return buf.getvalue()
460 460
461 def test_fail(self): 461 def test_fail(self):
462 try: 462 try:
463 self._execute('trace', 'fail.isolate', [], True) 463 self._execute('trace', 'fail.isolate', ['-v'], True)
464 self.fail() 464 self.fail()
465 except subprocess.CalledProcessError, e: 465 except subprocess.CalledProcessError, e:
466 out = e.output 466 out = e.output
467 self._expect_no_tree() 467 self._expect_no_tree()
468 self._expect_results(['fail.py'], None, None) 468 self._expect_results(['fail.py'], None, None)
469 # In theory, there should be 2 \n at the end of expected but for an 469 # In theory, there should be 2 \n at the end of expected but for an
470 # unknown reason there's 3 \n on Windows so just rstrip() and compare the 470 # unknown reason there's 3 \n on Windows so just rstrip() and compare the
471 # text, that's sufficient for this test. 471 # text, that's sufficient for this test.
472 expected = 'Failure: 1\nFailing' 472 expected = 'Failing'
473 self.assertEquals(expected, out.rstrip()) 473 self.assertEquals(expected, out.rstrip())
474 474
475 def test_missing_trailing_slash(self): 475 def test_missing_trailing_slash(self):
476 try: 476 try:
477 self._execute('trace', 'missing_trailing_slash.isolate', [], True) 477 self._execute('trace', 'missing_trailing_slash.isolate', [], True)
478 self.fail() 478 self.fail()
479 except subprocess.CalledProcessError, e: 479 except subprocess.CalledProcessError, e:
480 out = e.output 480 out = e.output
481 self._expect_no_tree() 481 self._expect_no_tree()
482 self._expect_no_result() 482 self._expect_no_result()
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 ], 552 ],
553 } 553 }
554 self.assertEquals(self._to_string(expected), out) 554 self.assertEquals(self._to_string(expected), out)
555 555
556 556
557 557
558 if __name__ == '__main__': 558 if __name__ == '__main__':
559 VERBOSE = '-v' in sys.argv 559 VERBOSE = '-v' in sys.argv
560 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) 560 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR)
561 unittest.main() 561 unittest.main()
OLDNEW
« no previous file with comments | « tools/isolate/isolate.py ('k') | tools/isolate/list_test_cases.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698