Skip to content

Commit b7c1a7e

Browse files
committed
Add fuzz tests to Coverage
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 6478c60 commit b7c1a7e

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

.github/workflows/coverage.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ jobs:
9999
name: exports-coverage-qemu-all
100100
path: coverage
101101

102+
- name: Download files exports-coverage-fuzztests
103+
uses: actions/download-artifact@v4
104+
with:
105+
name: exports-coverage-fuzztests
106+
path: coverage
107+
102108
- name: Compute coverage
103109
working-directory: ${{env.COVERAGE_DIR}}
104110
run: |

.github/workflows/fuzz_test.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@ on: [workflow_call]
77
permissions:
88
contents: read
99

10+
env:
11+
BUILD_DIR : "${{github.workspace}}/build"
12+
INSTL_DIR : "${{github.workspace}}/../install-dir"
13+
COVERAGE_DIR : "${{github.workspace}}/coverage"
14+
COVERAGE_NAME : "exports-coverage-fuzztests"
15+
1016
jobs:
1117
fuzz-test:
1218
name: Fuzz test
1319
strategy:
1420
fail-fast: false
1521
matrix:
1622
build_type: [Debug, Release]
17-
compiler: [{c: clang, cxx: clang++}]
23+
compiler: [{c: gcc, cxx: g++}]
1824

1925
runs-on: ubuntu-latest
2026

@@ -39,10 +45,27 @@ jobs:
3945
-DUMF_TESTS_FAIL_ON_SKIP=ON
4046
-DUMF_DEVELOPER_MODE=ON
4147
-DUMF_BUILD_FUZZTESTS=ON
48+
${{ matrix.build_type == 'Debug' && '-DUMF_USE_COVERAGE=ON' || '' }}
4249
4350
- name: Build
4451
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} --verbose -j$(nproc)
4552

4653
- name: Fuzz long test
4754
working-directory: ${{github.workspace}}/build
4855
run: ctest -C ${{matrix.build_type}} --output-on-failure --verbose -L "fuzz-long"
56+
57+
- name: Check coverage
58+
if: ${{ matrix.build_type == 'Debug' }}
59+
working-directory: ${{env.BUILD_DIR}}
60+
run: |
61+
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}
62+
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
63+
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
64+
mkdir -p ${{env.COVERAGE_DIR}}
65+
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
66+
67+
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
68+
if: ${{ matrix.build_type == 'Debug' }}
69+
with:
70+
name: ${{env.COVERAGE_NAME}}
71+
path: ${{env.COVERAGE_DIR}}

.github/workflows/pr_push.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ jobs:
110110
MultiNuma:
111111
needs: [Build]
112112
uses: ./.github/workflows/multi_numa.yml
113+
FuzzTest:
114+
needs: [Build]
115+
uses: ./.github/workflows/fuzz_test.yml
113116
Coverage:
114-
needs: [Build, DevDax, GPU, MultiNuma, Qemu]
117+
needs: [Build, DevDax, GPU, MultiNuma, Qemu, FuzzTest]
115118
uses: ./.github/workflows/coverage.yml

0 commit comments

Comments
 (0)