#!/bin/sh -l PATH=$PATH BIN_PATH="$(swift build --show-bin-path)" XCTEST_PATH="$(find ${BIN_PATH} -name '*.xctest')" COV_BIN=$XCTEST_PATH INSTR_PROFILE=.build/debug/codecov/default.profdata IGNORE_FILENAME_REGEX=".build|Tests" if [[ "$OSTYPE" == "darwin"* ]]; then f="$(basename $XCTEST_PATH .xctest)" COV_BIN="${COV_BIN}/Contents/MacOS/$f" PATH="/usr/local/opt/llvm/bin:$PATH"​ fi llvm-cov report \ "${COV_BIN}" \ -instr-profile=$INSTR_PROFILE \ -ignore-filename-regex=$IGNORE_FILENAME_REGEX \ -use-color llvm-cov export \ "${COV_BIN}" \ -instr-profile=$INSTR_PROFILE \ -ignore-filename-regex=$IGNORE_FILENAME_REGEX \ -format="lcov"