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

Side by Side Diff: build/android/pylib/instrumentation/instrumentation_test_instance_test.py

Issue 1514453007: Show more stack trace in instrumentation tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add command-line flag. Created 5 years 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 6
7 """Unit tests for instrumentation.TestRunner.""" 7 """Unit tests for instrumentation.TestRunner."""
8 8
9 # pylint: disable=W0212 9 # pylint: disable=W0212
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 (-2, { 97 (-2, {
98 'class': 'test.package.TestClass', 98 'class': 'test.package.TestClass',
99 'test': 'testMethod', 99 'test': 'testMethod',
100 }), 100 }),
101 ] 101 ]
102 results = instrumentation_test_instance.GenerateTestResults( 102 results = instrumentation_test_instance.GenerateTestResults(
103 None, None, statuses, 0, 1000) 103 None, None, statuses, 0, 1000)
104 self.assertEqual(1, len(results)) 104 self.assertEqual(1, len(results))
105 self.assertEqual(base_test_result.ResultType.FAIL, results[0].GetType()) 105 self.assertEqual(base_test_result.ResultType.FAIL, results[0].GetType())
106 106
107 def testGenerateTestResults_testUnknownException(self):
108 stacktrace = 'long\nstacktrace'
109 statuses = [
110 (1, {
111 'class': 'test.package.TestClass',
112 'test': 'testMethod',
113 }),
114 (-1, {
115 'stack': stacktrace,
116 }),
117 ]
118 results = instrumentation_test_instance.GenerateTestResults(
119 None, None, statuses, 0, 1000)
120 self.assertEqual(1, len(results))
121 self.assertEqual(base_test_result.ResultType.FAIL, results[0].GetType())
122 self.assertEqual(stacktrace, results[0].GetLog())
123
107 124
108 if __name__ == '__main__': 125 if __name__ == '__main__':
109 unittest.main(verbosity=2) 126 unittest.main(verbosity=2)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698