Chromium Code Reviews| Index: tools/llvm_coverage_run.py |
| diff --git a/tools/llvm_coverage_run.py b/tools/llvm_coverage_run.py |
| index 676e670fcf991698c2212b4e4b208c74ad161723..070f11809096e8358e9a012b6aa298450085cac8 100755 |
| --- a/tools/llvm_coverage_run.py |
| +++ b/tools/llvm_coverage_run.py |
| @@ -17,9 +17,10 @@ import sys |
| BUILDTYPE = 'Coverage' |
| -OUT_DIR = os.path.realpath(os.path.join('out', BUILDTYPE)) |
| +DEFAULT_OUT_DIR = os.path.realpath(os.path.join('out', BUILDTYPE)) |
| PROFILE_DATA = 'default.profraw' |
| PROFILE_DATA_MERGED = 'prof_merged' |
| +SKIA_OUT = 'SKIA_OUT' |
| def _fix_filename(filename): |
| @@ -67,13 +68,20 @@ def _filter_results(results): |
| return filtered |
| +def _get_out_dir(): |
| + """Determine the location for compiled binaries.""" |
| + if os.environ.get(SKIA_OUT): |
|
mtklein
2015/07/15 14:30:46
I think we can be pithier and just as clear:
ret
borenet
2015/07/15 14:42:02
Done.
|
| + return os.path.join(os.environ[SKIA_OUT], BUILDTYPE) |
| + return DEFAULT_OUT_DIR |
| + |
| + |
| def run_coverage(cmd): |
| """Run the given command and return per-file coverage data. |
| Assumes that the binary has been built using llvm_coverage_build and that |
| LLVM 3.6 or newer is installed. |
| """ |
| - binary_path = os.path.join(OUT_DIR, cmd[0]) |
| + binary_path = os.path.join(_get_out_dir(), cmd[0]) |
| subprocess.call([binary_path] + cmd[1:]) |
| try: |
| subprocess.check_call( |