Skip to content

Commit

Permalink
update coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
MacOMNI committed Nov 12, 2024
1 parent ab66222 commit 9f27ae4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,19 @@ jobs:
run: make test-coverage
- name: Merge and generate coverage report
run: |
find . -type f -path "*.build/*" -name "*.o"
mkdir -p coverage
find . -name "*.profraw" -exec llvm-profdata merge -sparse {} -o coverage/coverage.profdata \;
find .build/debug -type f -name "*.xctest" -exec file {} \; | grep -i 'executable' | cut -d: -f1 | while read executable; do
if [ -f "$executable" ]; then
echo "Generating coverage for $executable"
llvm-cov export -format=lcov -instr-profile=coverage/coverage.profdata "$executable" >> coverage/coverage.lcov
fi
profdata_file="coverage/coverage.profdata"
echo "Merging .profraw files..."
llvm-profdata merge -sparse $(find . -name "*.profraw") -o "$profdata_file"
find . -type f -path "*.build/debug/*" -name "*.o" | while read object_file; do
if file "$object_file" | grep -iq 'ELF'; then
echo "Processing $object_file"
llvm-cov export -format=lcov -instr-profile=coverage/coverage.profdata "$object_file" >> coverage/coverage.lcov
fi
done
echo "Coverage report generated at coverage/coverage.lcov"

- name: List Coverage Files
run: |
echo "Checking coverage files..."
Expand Down

0 comments on commit 9f27ae4

Please sign in to comment.