diff --git a/tools/test/collect_cc_coverage.sh b/tools/test/collect_cc_coverage.sh index 00d824c1c0a3e6..c339659961abbf 100755 --- a/tools/test/collect_cc_coverage.sh +++ b/tools/test/collect_cc_coverage.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash # Copyright 2016 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,11 +31,16 @@ # - COVERAGE_GCOV_OPTIONS Additional options to pass to gcov. # - ROOT Location from where the code coverage collection # was invoked. +# - VERBOSE_COVERAGE Print debug info from the coverage scripts # # The script looks in $COVERAGE_DIR for the C++ metadata coverage files (either # gcda or profraw) and uses either lcov or gcov to get the coverage data. # The coverage data is placed in $COVERAGE_OUTPUT_FILE. +if [[ -n "$VERBOSE_COVERAGE" ]]; then + set -x +fi + # Checks if clang llvm coverage should be used instead of lcov. function uses_llvm() { if stat "${COVERAGE_DIR}"/*.profraw >/dev/null 2>&1; then diff --git a/tools/test/collect_coverage.sh b/tools/test/collect_coverage.sh index a5f69a0531a352..23d0198a21b727 100755 --- a/tools/test/collect_coverage.sh +++ b/tools/test/collect_coverage.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash # Copyright 2016 The Bazel Authors. All rights reserved. # @@ -21,10 +21,15 @@ # LCOV_MERGER - mandatory, location of the LcovMerger # COVERAGE_DIR - optional, location of the coverage temp directory # COVERAGE_OUTPUT_FILE - optional, location of the final lcov file +# VERBOSE_COVERAGE - optional, print debug info from the coverage scripts # # Script expects that it will be started in the execution root directory and # not in the test's runfiles directory. +if [[ -n "$VERBOSE_COVERAGE" ]]; then + set -x +fi + function resolve_links() { local name="$1"