OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 unittest | 6 import unittest |
7 | 7 |
8 from pylib.base import base_test_result | 8 from pylib.base import base_test_result |
9 from pylib.gtest import gtest_test_instance | 9 from pylib.gtest import gtest_test_instance |
10 | 10 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 self.assertEquals(2, len(actual)) | 145 self.assertEquals(2, len(actual)) |
146 | 146 |
147 self.assertEquals('FooTest.Bar', actual[0].GetName()) | 147 self.assertEquals('FooTest.Bar', actual[0].GetName()) |
148 self.assertEquals(0, actual[0].GetDuration()) | 148 self.assertEquals(0, actual[0].GetDuration()) |
149 self.assertEquals(base_test_result.ResultType.UNKNOWN, actual[0].GetType()) | 149 self.assertEquals(base_test_result.ResultType.UNKNOWN, actual[0].GetType()) |
150 | 150 |
151 self.assertEquals('FooTest.Baz', actual[1].GetName()) | 151 self.assertEquals('FooTest.Baz', actual[1].GetName()) |
152 self.assertEquals(1, actual[1].GetDuration()) | 152 self.assertEquals(1, actual[1].GetDuration()) |
153 self.assertEquals(base_test_result.ResultType.PASS, actual[1].GetType()) | 153 self.assertEquals(base_test_result.ResultType.PASS, actual[1].GetType()) |
154 | 154 |
| 155 def testParseGTestOutput_deathTestCrashOk(self): |
| 156 raw_output = [ |
| 157 '[ RUN ] FooTest.Bar', |
| 158 '[ CRASHED ]', |
| 159 '[ OK ] FooTest.Bar (1 ms)', |
| 160 ] |
| 161 actual = gtest_test_instance.ParseGTestOutput(raw_output) |
| 162 self.assertEquals(1, len(actual)) |
| 163 |
| 164 self.assertEquals('FooTest.Bar', actual[0].GetName()) |
| 165 self.assertEquals(1, actual[0].GetDuration()) |
| 166 self.assertEquals(base_test_result.ResultType.PASS, actual[0].GetType()) |
| 167 |
155 | 168 |
156 if __name__ == '__main__': | 169 if __name__ == '__main__': |
157 unittest.main(verbosity=2) | 170 unittest.main(verbosity=2) |
158 | 171 |
OLD | NEW |