diff --git a/Scripts/prepare-coverage-reports.sh b/Scripts/prepare-coverage-reports.sh index ef0d2b90..79967f88 100755 --- a/Scripts/prepare-coverage-reports.sh +++ b/Scripts/prepare-coverage-reports.sh @@ -2,17 +2,14 @@ set -e function exportlcov() { - build_type=$1 - executable_name=$2 + executable_name=$1 - executable=$(find "${directory}" -type f -name $executable_name) - profile=$(find "${directory}" -type f -name 'Coverage.profdata') + executable=$(find .build/*/*/$executable_name.xctest/Contents/*/$executable_name -type f) + profile=$(find .build -type f -name 'default.profdata') output_file_name="$executable_name.lcov" can_proceed=true - if [[ $build_type == watchOS* ]]; then - echo "\tAborting creation of $output_file_name – watchOS not supported." - elif [[ -z $profile ]]; then + if [[ -z $profile ]]; then echo "\tAborting creation of $output_file_name – no profile found." elif [[ -z $executable ]]; then echo "\tAborting creation of $output_file_name – no executable found." @@ -26,9 +23,4 @@ function exportlcov() { fi } -for directory in $(git rev-parse --show-toplevel)/.build/derivedData/*/; do - build_type=$(basename $directory) - echo "Finding coverage information for $build_type" - - exportlcov $build_type 'SafeDITests' -done +exportlcov 'SafeDIPackageTests'