Skip to content

Commit

Permalink
[Code Coverage] Add a tool to check test coverage of a patch
Browse files Browse the repository at this point in the history
  • Loading branch information
xgupta committed Nov 27, 2023
1 parent 23c47eb commit 511b2bb
Show file tree
Hide file tree
Showing 2 changed files with 766 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/patch-based-code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: LLVM Code Coverage

on:
push:
branches:
- test-format

jobs:
code-coverage:
name: Generate Code Coverage Report
runs-on: self-hosted

steps:
- name: Checkout LLVM Repository
uses: actions/checkout@v1

- name: Install LLVM project build dependency
run: |
sudo apt-get install llvm
sudo apt-get install clang
sudo apt-get install lld
sudo apt-get install cmake
sudo apt-get install ninja-build
sudo apt-get install -y python3.11
pip install argparse unidiff
- name: Build LLVM project
run: |
mkdir build
cd build
cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_LINKER=lld -DCMAKE_C_COMPILER=/usr/local/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/bin/clang++ -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_BUILD_TESTS=ON
ninja
- name: Run the patch-based code coverage tool
run: |
cp llvm/utils/git-check-coverage .
python3 git-check-coverage -b build bin/clang-format clang/test
- name: Archive code coverage artifacts
uses: actions/upload-artifact@v2
with:
name: code-coverage-results
path: build/patch_coverage.log

Loading

0 comments on commit 511b2bb

Please sign in to comment.