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 logging | 6 import logging |
7 import os | 7 import os |
8 import re | 8 import re |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 re.escape(l) for l in gtest_fake_base.get_footer(1, 1).splitlines() | 92 re.escape(l) for l in gtest_fake_base.get_footer(1, 1).splitlines() |
93 ] + [ | 93 ] + [ |
94 '', | 94 '', |
95 re.escape('Success: 3 75.00%'), | 95 re.escape('Success: 3 75.00%'), |
96 re.escape('Flaky: 0 0.00%'), | 96 re.escape('Flaky: 0 0.00%'), |
97 re.escape('Fail: 1 25.00%'), | 97 re.escape('Fail: 1 25.00%'), |
98 r'\d+\.\ds Done running 4 tests with 6 executions. \d+\.\d test/s', | 98 r'\d+\.\ds Done running 4 tests with 6 executions. \d+\.\d test/s', |
99 ] | 99 ] |
100 self._check_results(expected_out_re, out, err) | 100 self._check_results(expected_out_re, out, err) |
101 | 101 |
| 102 def test_simple_gtest_list_error(self): |
| 103 out, err, return_code = RunTest('gtest_fake_error.py') |
| 104 |
| 105 expected_out_re = [ |
| 106 'Failed to run .+gtest_fake_error.py', |
| 107 'Unable to list tests' |
| 108 ] |
| 109 |
| 110 self.assertEqual(1, return_code) |
| 111 self._check_results(expected_out_re, out, err) |
| 112 |
102 | 113 |
103 if __name__ == '__main__': | 114 if __name__ == '__main__': |
104 VERBOSE = '-v' in sys.argv | 115 VERBOSE = '-v' in sys.argv |
105 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) | 116 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) |
106 unittest.main() | 117 unittest.main() |
OLD | NEW |