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

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

Issue 11649008: Reorganize Android's test scripts into packages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « build/android/pylib/gtest/__init__.py ('k') | build/android/pylib/gtest/single_test_runner.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Collect debug info for a test.""" 5 """Collect debug info for a test."""
6 6
7 import datetime 7 import datetime
8 import logging 8 import logging
9 import os 9 import os
10 import re 10 import re
11 import shutil 11 import shutil
12 import string 12 import string
13 import subprocess 13 import subprocess
14 import tempfile 14 import tempfile
15 15
16 import cmd_helper 16 from pylib import cmd_helper
17 17
18 18
19 TOMBSTONE_DIR = '/data/tombstones/' 19 TOMBSTONE_DIR = '/data/tombstones/'
20 20
21 21
22 class GTestDebugInfo(object): 22 class GTestDebugInfo(object):
23 """A helper class to collect related debug information for a gtest. 23 """A helper class to collect related debug information for a gtest.
24 24
25 Debug info is collected in two steps: 25 Debug info is collected in two steps:
26 - first, object(s) of this class (one per device), accumulate logs 26 - first, object(s) of this class (one per device), accumulate logs
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 os.path.splitext(log_basename)[0] + '.zip') 187 os.path.splitext(log_basename)[0] + '.zip')
188 logging.info('Zipping debug dumps into %s ...', log_zip_file) 188 logging.info('Zipping debug dumps into %s ...', log_zip_file)
189 # Add new dumps into the zip file. The zip may exist already if previous 189 # Add new dumps into the zip file. The zip may exist already if previous
190 # gtest also dumps the debug information. It's OK since we clean up the old 190 # gtest also dumps the debug information. It's OK since we clean up the old
191 # dumps in each build step. 191 # dumps in each build step.
192 log_src_dir = os.path.join(tempfile.gettempdir(), 'gtest_debug_info') 192 log_src_dir = os.path.join(tempfile.gettempdir(), 'gtest_debug_info')
193 cmd_helper.RunCmd(['zip', '-q', '-r', log_zip_file, log_src_dir]) 193 cmd_helper.RunCmd(['zip', '-q', '-r', log_zip_file, log_src_dir])
194 assert os.path.exists(log_zip_file) 194 assert os.path.exists(log_zip_file)
195 assert os.path.exists(log_src_dir) 195 assert os.path.exists(log_src_dir)
196 shutil.rmtree(log_src_dir) 196 shutil.rmtree(log_src_dir)
OLDNEW
« no previous file with comments | « build/android/pylib/gtest/__init__.py ('k') | build/android/pylib/gtest/single_test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698