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 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 self.fail() | 471 self.fail() |
472 except subprocess.CalledProcessError, e: | 472 except subprocess.CalledProcessError, e: |
473 out = e.output | 473 out = e.output |
474 self._expect_no_tree() | 474 self._expect_no_tree() |
475 self._expect_results(['fail.py'], None, None) | 475 self._expect_results(['fail.py'], None, None) |
476 expected = 'Failing' | 476 expected = 'Failing' |
477 if sys.platform == 'win32': | 477 if sys.platform == 'win32': |
478 # Includes spew from tracerpt.exe. | 478 # Includes spew from tracerpt.exe. |
479 self.assertTrue(out.startswith(expected)) | 479 self.assertTrue(out.startswith(expected)) |
480 else: | 480 else: |
481 self.assertEquals(expected, out.rstrip()) | 481 lines = out.strip().splitlines() |
| 482 self.assertEquals(3, len(lines)) |
| 483 self.assertTrue(lines[0].startswith('WARNING')) |
| 484 self.assertTrue(lines[1].startswith('WARNING')) |
| 485 self.assertEquals(expected, lines[2]) |
482 | 486 |
483 def test_missing_trailing_slash(self): | 487 def test_missing_trailing_slash(self): |
484 try: | 488 try: |
485 self._execute('trace', 'missing_trailing_slash.isolate', [], True) | 489 self._execute('trace', 'missing_trailing_slash.isolate', [], True) |
486 self.fail() | 490 self.fail() |
487 except subprocess.CalledProcessError, e: | 491 except subprocess.CalledProcessError, e: |
488 out = e.output | 492 out = e.output |
489 self._expect_no_tree() | 493 self._expect_no_tree() |
490 self._expect_no_result() | 494 self._expect_no_result() |
491 expected = ( | 495 expected = ( |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 # Clean the directory from the logs, which are OS-specific. | 703 # Clean the directory from the logs, which are OS-specific. |
700 isolate.trace_inputs.get_api().clean_trace( | 704 isolate.trace_inputs.get_api().clean_trace( |
701 os.path.join(self.tempdir, 'isolate_smoke_test.results.log')) | 705 os.path.join(self.tempdir, 'isolate_smoke_test.results.log')) |
702 self.assertEquals(files, list_files_tree(self.tempdir)) | 706 self.assertEquals(files, list_files_tree(self.tempdir)) |
703 | 707 |
704 | 708 |
705 if __name__ == '__main__': | 709 if __name__ == '__main__': |
706 VERBOSE = '-v' in sys.argv | 710 VERBOSE = '-v' in sys.argv |
707 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) | 711 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) |
708 unittest.main() | 712 unittest.main() |
OLD | NEW |