Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,45 @@ | ||
#!/bin/zsh -l | ||
set -e | ||
|
||
mkdir -p .build/artifacts | ||
|
||
root=$(git rev-parse --show-toplevel) | ||
|
||
function exportlcov() { | ||
build_type=$1 | ||
executable=$2 | ||
profile=$3 | ||
|
||
can_proceed=true | ||
if ! test -f $executable; then | ||
echo "\tCould not find executable for $build_type" | ||
can_proceed=false | ||
fi | ||
|
||
if ! test -f $profile; then | ||
echo "\tCould not find profile for $build_type" | ||
can_proceed=false | ||
fi | ||
|
||
if $can_proceed; then | ||
output_dir=".build/artifacts/$build_type" | ||
mkdir -p $output_dir | ||
|
||
output_file="$output_dir/$(basename $executable).lcov" | ||
echo "\tExporting $output_file" | ||
xcrun llvm-cov export -format="lcov" $executable -instr-profile $profile > $output_file | ||
else | ||
echo "\tAborting creation of lcov file for $build_type" | ||
fi | ||
} | ||
|
||
for directory in $root/.build/derivedData/*/; do | ||
build_type=$(basename $directory) | ||
echo "Finding coverage information for $build_type" | ||
|
||
profile=$(find "${directory}" -type f -name 'Coverage.profdata') | ||
|
||
cache_advance_tests_executable=$(find "${directory}" -type f -name 'CacheAdvanceTests') | ||
echo "Found executable $cache_advance_tests_executable" | ||
cache_advance_tests_profile=$(find "${directory}" -type f -name 'Coverage.profdata') | ||
echo "Found profile $cache_advance_tests_profile" | ||
exho "Exporting CacheAdvance_$build_type.lcov" | ||
xcrun llvm-cov export -format="lcov" $cache_advance_tests_executable -instr-profile $cache_advance_tests_profile > .build/artifacts/CacheAdvance_$build_type.lcov | ||
exportlcov $build_type $cache_advance_tests_executable $profile | ||
|
||
cad_cache_advance_tests_executable=$(find "${directory}" -type f -name 'CADCacheAdvanceTests') | ||
echo "Found executable $cad_cache_advance_tests_executable" | ||
cad_cache_advance_tests_profile=$(find "${directory}" -type f -name 'Coverage.profdata') | ||
echo "Found profile $cad_cache_advance_tests_executable" | ||
exho "Exporting CADCacheAdvance_$build_type.lcov" | ||
xcrun llvm-cov export -format="lcov" $cache_advance_tests_executable -instr-profile $cache_advance_tests_profile > .build/artifacts/CADCacheAdvance_$build_type.lcov | ||
exportlcov $build_type $cad_cache_advance_tests_executable $profile | ||
done |