summaryrefslogtreecommitdiff
path: root/chromium/tools/code_coverage/coverage.py
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/tools/code_coverage/coverage.py')
-rwxr-xr-xchromium/tools/code_coverage/coverage.py31
1 files changed, 14 insertions, 17 deletions
diff --git a/chromium/tools/code_coverage/coverage.py b/chromium/tools/code_coverage/coverage.py
index a4b8f88c576..b367cf59498 100755
--- a/chromium/tools/code_coverage/coverage.py
+++ b/chromium/tools/code_coverage/coverage.py
@@ -82,12 +82,6 @@ import urllib2
sys.path.append(
os.path.join(
- os.path.dirname(__file__), os.path.pardir, os.path.pardir, 'tools',
- 'clang', 'scripts'))
-import update
-
-sys.path.append(
- os.path.join(
os.path.dirname(__file__), os.path.pardir, os.path.pardir,
'third_party'))
from collections import defaultdict
@@ -96,12 +90,15 @@ import coverage_utils
# Absolute path to the code coverage tools binary. These paths can be
# overwritten by user specified coverage tool paths.
-LLVM_BIN_DIR = os.path.join(update.LLVM_BUILD_DIR, 'bin')
+# Absolute path to the root of the checkout.
+SRC_ROOT_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)),
+ os.path.pardir, os.path.pardir)
+LLVM_BIN_DIR = os.path.join(
+ os.path.join(SRC_ROOT_PATH, 'third_party', 'llvm-build', 'Release+Asserts'),
+ 'bin')
LLVM_COV_PATH = os.path.join(LLVM_BIN_DIR, 'llvm-cov')
LLVM_PROFDATA_PATH = os.path.join(LLVM_BIN_DIR, 'llvm-profdata')
-# Absolute path to the root of the checkout.
-SRC_ROOT_PATH = None
# Build directory, the value is parsed from command line arguments.
BUILD_DIR = None
@@ -157,7 +154,8 @@ def _ConfigureLLVMCoverageTools(args):
LLVM_COV_PATH = os.path.join(llvm_bin_dir, 'llvm-cov')
LLVM_PROFDATA_PATH = os.path.join(llvm_bin_dir, 'llvm-profdata')
else:
- update.UpdatePackage('coverage_tools', coverage_utils.GetHostPlatform())
+ subprocess.check_call(
+ ['tools/clang/scripts/update.py', '--package', 'coverage_tools'])
if coverage_utils.GetHostPlatform() == 'win':
LLVM_COV_PATH += '.exe'
@@ -948,19 +946,18 @@ def _ParseCommandArguments():
def Main():
"""Execute tool commands."""
+
+ # Change directory to source root to aid in relative paths calculations.
+ os.chdir(SRC_ROOT_PATH)
+
# Setup coverage binaries even when script is called with empty params. This
# is used by coverage bot for initial setup.
if len(sys.argv) == 1:
- update.UpdatePackage('coverage_tools', coverage_utils.GetHostPlatform())
+ subprocess.check_call(
+ ['tools/clang/scripts/update.py', '--package', 'coverage_tools'])
print(__doc__)
return
- # Change directory to source root to aid in relative paths calculations.
- global SRC_ROOT_PATH
- SRC_ROOT_PATH = coverage_utils.GetFullPath(
- os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir))
- os.chdir(SRC_ROOT_PATH)
-
args = _ParseCommandArguments()
coverage_utils.ConfigureLogging(verbose=args.verbose, log_file=args.log_file)
_ConfigureLLVMCoverageTools(args)