aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/combine-coverage.sh
blob: 1ce37737982511a822af9fa30163089d0e52c6e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
set -eou pipefail

source "$(dirname "${BASH_SOURCE[0]}")/lib/log.sh"
source "$(dirname "${BASH_SOURCE[0]}")/lib/test.sh"

usage() {
  echo "Usage: $0 [OUTPUT_FILE]"
  echo ""
  echo "Combine coverage reports from multiple test suites"
  echo ""
  echo "Arguments:"
  echo "  OUTPUT_FILE   Output file for combined coverage (default: coverage.combined.out)"
  echo ""
  echo "Examples:"
  echo "  $0                           # Creates coverage.combined.out"
  echo "  $0 coverage.total.out        # Creates coverage.total.out"
}

main() {
  local output_file="${1:-coverage.combined.out}"
  if [[ "$output_file" == "-h" || "$output_file" == "--help" ]]; then
    usage
    exit 0
  fi

  log_header "Combining Coverage Reports"
  test_combine_coverage "$output_file"
  test_show_coverage_summary "$output_file"
}

main "$@"