Skip to content

Commit

Permalink
Make prepare-coverage-reports.sh work with 'swift test'
Browse files Browse the repository at this point in the history
  • Loading branch information
dfed committed Nov 26, 2023
1 parent d2e2bf5 commit a9fa405
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions Scripts/prepare-coverage-reports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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'

0 comments on commit a9fa405

Please sign in to comment.