Skip to content

Commit 58bce46

Browse files
committed
Enhance unit test workflow to include code coverage analysis
1 parent 89b4043 commit 58bce46

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,14 @@ jobs:
366366
367367
- name: Build and run unit tests
368368
run: |
369-
mkdir build && cd build
370-
cmake .. -DWAMR_BUILD_TARGET=${{ matrix.build_target }}
371-
cmake --build . --config Release --parallel 4
372-
ctest
369+
rm -rf build
370+
cmake -S . -B build -DWAMR_BUILD_TARGET=${{ matrix.build_target }} -DCOLLECT_CODE_COVERAGE=1
371+
cmake --build build --config Release --parallel 4
372+
ctest --test-dir build --output-on-failure
373+
374+
lcov --capture --directory build --output-file coverage.all.info
375+
lcov --extract coverage.all.info "*/core/iwasm/*" "*/core/shared/*" --output-file coverage.info
376+
lcov --summary coverage.info
373377
working-directory: tests/unit
374378

375379
build_regression_tests:

0 commit comments

Comments
 (0)