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

Side by Side Diff: build/android/pylib/gtest/gtest_test_instance_test.py

Issue 2141723002: [Android] Fix handling of intentional crashes during death tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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
OLDNEW
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
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
OLDNEW
« no previous file with comments | « build/android/pylib/gtest/gtest_test_instance.py ('k') | testing/android/native_test/native_test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698