Brian Silverman | 5f6f276 | 2022-08-13 19:30:05 -0700 | [diff] [blame^] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -euo pipefail |
| 4 | |
| 5 | if [[ -n "${VERBOSE_COVERAGE:-}" ]]; then |
| 6 | set -x |
| 7 | fi |
| 8 | |
| 9 | readonly profdata_file=$COVERAGE_DIR/coverage.profdata |
| 10 | |
| 11 | "$RUNFILES_DIR/$TEST_WORKSPACE/$RUST_LLVM_PROFDATA" \ |
| 12 | merge \ |
| 13 | --sparse "$COVERAGE_DIR"/*.profraw \ |
| 14 | -output "$profdata_file" |
| 15 | |
| 16 | "$RUNFILES_DIR/$TEST_WORKSPACE/$RUST_LLVM_COV" \ |
| 17 | export \ |
| 18 | -format=lcov \ |
| 19 | -instr-profile "$profdata_file" \ |
| 20 | -ignore-filename-regex='.*external/.+' \ |
| 21 | -ignore-filename-regex='/tmp/.+' \ |
| 22 | -path-equivalence=.,"$ROOT" \ |
| 23 | "$RUNFILES_DIR/$TEST_WORKSPACE/$TEST_BINARY" \ |
| 24 | @"$COVERAGE_MANIFEST" \ |
| 25 | | sed 's#/proc/self/cwd/##' > "$COVERAGE_OUTPUT_FILE" |