Skip to content

Commit

Permalink
add code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisChu committed Sep 22, 2021
1 parent 32ff73f commit 59ce518
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
-DCMAKE_C_COMPILER=$TOOLSET_CLANG_DIR/bin/gcc \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_TESTING=on \
-DENABLE_COVERAGE=on \
-B build
echo "::set-output name=j::10"
echo "::set-output name=t::10"
Expand Down Expand Up @@ -144,6 +145,11 @@ jobs:
make RM_DIR=false down
working-directory: tests/
timeout-minutes: 2
- name: coverage
if: ${{ matrix.compiler == 'gcc-9.2' && matrix.os == 'ubuntu2004' }}
run: |
~/.local/bin/fastcov -d build -l -o fastcov.info -p --exclude /usr/include --exclude=scanner.lex --exclude=/opt/vesoft/*
bash <(curl -s https://codecov.io/bash) -Z -f fastcov.info
- name: Sanitizer
if: ${{ always() }}
run: |
Expand Down
2 changes: 2 additions & 0 deletions cmake/nebula/GeneralCompilerConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ if(ENABLE_TESTING AND ENABLE_COVERAGE)
add_compile_options(--coverage)
add_compile_options(-g)
add_compile_options(-O0)
nebula_add_exe_linker_flag(-coverage)
nebula_add_exe_linker_flag(-lgcov)
endif()

# TODO(doodle) Add option suggest-override for gnu
Expand Down
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ pytest-yapf3==0.5.1
filelock==3.0.12
ply==3.10
pyyaml==5.4
fastcov==1.13

0 comments on commit 59ce518

Please sign in to comment.