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

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

Issue 132463007: Enable presubmit pylint in build/android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase vs tot and only disabling F0401 in specific spots Created 6 years, 10 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
« no previous file with comments | « build/android/pylib/gtest/test_package_apk.py ('k') | build/android/pylib/host_driven/setup.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 """Defines TestPackageExecutable to help run stand-alone executables.""" 5 """Defines TestPackageExecutable to help run stand-alone executables."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import shutil 9 import shutil
10 import sys 10 import sys
11 import tempfile 11 import tempfile
12 12
13 from pylib import cmd_helper 13 from pylib import cmd_helper
14 from pylib import constants 14 from pylib import constants
15 from pylib import pexpect 15 from pylib import pexpect
16 16 from pylib.gtest.test_package import TestPackage
17 from test_package import TestPackage
18 17
19 18
20 class TestPackageExecutable(TestPackage): 19 class TestPackageExecutable(TestPackage):
21 """A helper class for running stand-alone executables.""" 20 """A helper class for running stand-alone executables."""
22 21
23 _TEST_RUNNER_RET_VAL_FILE = 'gtest_retval' 22 _TEST_RUNNER_RET_VAL_FILE = 'gtest_retval'
24 23
25 def __init__(self, suite_name): 24 def __init__(self, suite_name):
26 """ 25 """
27 Args: 26 Args:
(...skipping 18 matching lines...) Expand all
46 ret_code_file.name) 45 ret_code_file.name)
47 raise ValueError 46 raise ValueError
48 ret_code = file(ret_code_file.name).read() 47 ret_code = file(ret_code_file.name).read()
49 ret = int(ret_code) 48 ret = int(ret_code)
50 except ValueError: 49 except ValueError:
51 logging.critical('Error reading gtest ret val file %s [%s]', 50 logging.critical('Error reading gtest ret val file %s [%s]',
52 ret_code_file.name, ret_code) 51 ret_code_file.name, ret_code)
53 ret = 1 52 ret = 1
54 return ret 53 return ret
55 54
56 def _AddNativeCoverageExports(self, adb): 55 @staticmethod
56 def _AddNativeCoverageExports(adb):
57 # export GCOV_PREFIX set the path for native coverage results 57 # export GCOV_PREFIX set the path for native coverage results
58 # export GCOV_PREFIX_STRIP indicates how many initial directory 58 # export GCOV_PREFIX_STRIP indicates how many initial directory
59 # names to strip off the hardwired absolute paths. 59 # names to strip off the hardwired absolute paths.
60 # This value is calculated in buildbot.sh and 60 # This value is calculated in buildbot.sh and
61 # depends on where the tree is built. 61 # depends on where the tree is built.
62 # Ex: /usr/local/google/code/chrome will become 62 # Ex: /usr/local/google/code/chrome will become
63 # /code/chrome if GCOV_PREFIX_STRIP=3 63 # /code/chrome if GCOV_PREFIX_STRIP=3
64 try: 64 try:
65 depth = os.environ['NATIVE_COVERAGE_DEPTH_STRIP'] 65 depth = os.environ['NATIVE_COVERAGE_DEPTH_STRIP']
66 except KeyError: 66 except KeyError:
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 'new one (%s).' % target_name) 138 'new one (%s).' % target_name)
139 # Whenever we generate a stripped binary, copy to the symbols dir. If we 139 # Whenever we generate a stripped binary, copy to the symbols dir. If we
140 # aren't stripping a new binary, assume it's there. 140 # aren't stripping a new binary, assume it's there.
141 if not os.path.exists(self._symbols_dir): 141 if not os.path.exists(self._symbols_dir):
142 os.makedirs(self._symbols_dir) 142 os.makedirs(self._symbols_dir)
143 shutil.copy(self.suite_path, self._symbols_dir) 143 shutil.copy(self.suite_path, self._symbols_dir)
144 strip = os.environ['STRIP'] 144 strip = os.environ['STRIP']
145 cmd_helper.RunCmd([strip, self.suite_path, '-o', target_name]) 145 cmd_helper.RunCmd([strip, self.suite_path, '-o', target_name])
146 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name 146 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name
147 adb.PushIfNeeded(target_name, test_binary) 147 adb.PushIfNeeded(target_name, test_binary)
OLDNEW
« no previous file with comments | « build/android/pylib/gtest/test_package_apk.py ('k') | build/android/pylib/host_driven/setup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698