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

Side by Side Diff: build/android/pylib/instrumentation/instrumentation_test_instance.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 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import collections 5 import collections
6 import copy 6 import copy
7 import logging 7 import logging
8 import os 8 import os
9 import pickle 9 import pickle
10 import re 10 import re
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 Returns: 95 Returns:
96 A list containing an instance of InstrumentationTestResult for each test 96 A list containing an instance of InstrumentationTestResult for each test
97 parsed. 97 parsed.
98 """ 98 """
99 99
100 results = [] 100 results = []
101 101
102 current_result = None 102 current_result = None
103 103
104 test_class = None
105 test_method = None
104 for status_code, bundle in statuses: 106 for status_code, bundle in statuses:
105 test_class = bundle.get('class', '') 107 test_class = bundle.get('class', '') or test_class
jbudorick 2015/12/11 21:04:30 nit if this logic sticks around: just do test_c
Peter Wen 2015/12/11 22:07:21 Acknowledged.
106 test_method = bundle.get('test', '') 108 test_method = bundle.get('test', '') or test_method
jbudorick 2015/12/11 21:04:30 nit: same
Peter Wen 2015/12/11 22:07:21 Acknowledged.
107 if test_class and test_method: 109 if test_class and test_method:
108 test_name = '%s#%s' % (test_class, test_method) 110 test_name = '%s#%s' % (test_class, test_method)
109 else: 111 else:
110 continue 112 continue
111 113
112 if status_code == instrumentation_parser.STATUS_CODE_START: 114 if status_code == instrumentation_parser.STATUS_CODE_START:
113 if current_result: 115 if current_result:
114 results.append(current_result) 116 results.append(current_result)
115 current_result = test_result.InstrumentationTestResult( 117 current_result = test_result.InstrumentationTestResult(
116 test_name, base_test_result.ResultType.UNKNOWN, start_ms, duration_ms) 118 test_name, base_test_result.ResultType.UNKNOWN, start_ms, duration_ms)
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 def GenerateTestResults( 631 def GenerateTestResults(
630 result_code, result_bundle, statuses, start_ms, duration_ms): 632 result_code, result_bundle, statuses, start_ms, duration_ms):
631 return GenerateTestResults(result_code, result_bundle, statuses, 633 return GenerateTestResults(result_code, result_bundle, statuses,
632 start_ms, duration_ms) 634 start_ms, duration_ms)
633 635
634 #override 636 #override
635 def TearDown(self): 637 def TearDown(self):
636 if self._isolate_delegate: 638 if self._isolate_delegate:
637 self._isolate_delegate.Clear() 639 self._isolate_delegate.Clear()
638 640
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698