-
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathprepare-coverage-reports.sh
More file actions
executable file
·34 lines (28 loc) · 1.04 KB
/
prepare-coverage-reports.sh
File metadata and controls
executable file
·34 lines (28 loc) · 1.04 KB
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
33
34
#!/bin/zsh -l
set -e
function exportlcov() {
build_type=$1
executable_name=$2
executable=$(find "${directory}" -type f -name $executable_name)
profile=$(find "${directory}" -type f -name 'Coverage.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
echo "\tAborting creation of $output_file_name – no profile found."
elif [[ -z $executable ]]; then
echo "\tAborting creation of $output_file_name – no executable found."
else
output_dir=".build/artifacts/$build_type"
mkdir -p $output_dir
output_file="$output_dir/$output_file_name"
echo "\tExporting $output_file"
xcrun llvm-cov export -format="lcov" $executable -instr-profile $profile >$output_file
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 'AsyncQueueTests'
done