Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/coverage #1410

Closed
wants to merge 70 commits into from
Closed
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
6ed91dc
Try to use codecov.
Shylock-Hg Dec 2, 2019
a4a5a2c
Correct typo.
Shylock-Hg Dec 2, 2019
116cbbf
CI on push.
Shylock-Hg Dec 2, 2019
c4970c7
Add CODECOV_TOKEN.
Shylock-Hg Dec 2, 2019
9494709
Remove O0.
Shylock-Hg Dec 2, 2019
06273ab
Remove the cmake file warning.
Shylock-Hg Dec 4, 2019
6f975d7
Remvoe the endif warning.
Shylock-Hg Dec 6, 2019
b999acd
Merge branch 'feature/coverage' of github.com:shylock-hg/nebula into …
Shylock-Hg Dec 6, 2019
18bc6c7
Merge branch 'master' into feature/coverage
Shylock-Hg Dec 9, 2019
8c4b59f
Merge branch 'feature/coverage' of github.com:Shylock-Hg/nebula into …
Shylock-Hg Dec 9, 2019
c83669c
Merge branch 'master' into feature/coverage
Shylock-Hg Dec 9, 2019
766241a
Make coverage.
Shylock-Hg Dec 9, 2019
cc6d2b0
Remove the optimization option which conflicted with Release buiding.
Shylock-Hg Dec 9, 2019
a896867
Merge branch 'master' into feature/coverage
Shylock-Hg Dec 19, 2019
cf5f611
Merge branch 'master' into feature/coverage
Shylock-Hg Jan 1, 2020
96aac04
Remove debug info flag.
Shylock-Hg Jan 1, 2020
5ccf061
Merge branch 'master' into feature/coverage
Shylock-Hg Jan 1, 2020
c3597b1
Remove master building.
Shylock-Hg Jan 1, 2020
a91a538
Revert "Remove master building."
Shylock-Hg Jan 1, 2020
96c6421
Remove the useless conditional library.
Shylock-Hg Jan 1, 2020
a968be7
Not enable coverage by default.
Shylock-Hg Jan 2, 2020
3743193
Merge branch 'master' into feature/coverage
Shylock-Hg Jan 3, 2020
a66eb8c
Merge branch 'master' into feature/coverage
Shylock-Hg Jan 3, 2020
8ad2539
Merge branch 'master' into feature/coverage
Shylock-Hg Jan 3, 2020
b474c3b
Merge branch 'master' into feature/coverage
Shylock-Hg Jan 6, 2020
b6c07fc
Add the lack ON for cmake option.
Shylock-Hg Jan 6, 2020
5911290
Change build folder to `build`.
Shylock-Hg Jan 6, 2020
0b7620e
Only need once testing coverage reporting.
Shylock-Hg Jan 6, 2020
41f5987
Merge branch 'master' into feature/coverage
Shylock-Hg Jan 6, 2020
7f7b8e2
Avoid codevcov output.
Shylock-Hg Jan 6, 2020
f4e2af5
Exit non zero when report coverage failed.
Shylock-Hg Jan 7, 2020
c5f9c8b
Merge branch 'master' into feature/coverage
Shylock-Hg Jan 15, 2020
69dced3
Add Travis-CI for testing coverage.
Shylock-Hg Jan 15, 2020
24af48b
Echo CXX.
Shylock-Hg Jan 15, 2020
2ebf769
Export CC CXX.
Shylock-Hg Jan 15, 2020
f898c34
Echo CC CXX
Shylock-Hg Jan 15, 2020
648472c
Echo CXX
Shylock-Hg Jan 15, 2020
8523c9d
Install third-party manually.
Shylock-Hg Jan 15, 2020
ba245c5
Add ccache.
Shylock-Hg Jan 15, 2020
eaec997
Remove clang.
Shylock-Hg Jan 15, 2020
2644887
Add azure pipeline.
Shylock-Hg Jan 15, 2020
8477df2
Run in nebula-dev.
Shylock-Hg Jan 15, 2020
2496b1c
Cd work folder.
Shylock-Hg Jan 15, 2020
e24a991
Add the codecov_token.
Shylock-Hg Jan 15, 2020
0314194
Set timeout to 120m.
Shylock-Hg Jan 15, 2020
8ed3511
Set job timeout to zero.
Shylock-Hg Jan 16, 2020
5c83d23
Optimize travis-ci.
Shylock-Hg Jan 16, 2020
7d2862a
Disable werror in travsi-ci.
Shylock-Hg Jan 16, 2020
d7877e9
Build by clang.
Shylock-Hg Jan 16, 2020
1584874
Using 1804 image for building by clang.
Shylock-Hg Jan 16, 2020
4b08440
Not return error for coverage.
Shylock-Hg Jan 16, 2020
aec4e86
Double cpu thread compile.
Shylock-Hg Jan 16, 2020
6272244
Correct one typo.
Shylock-Hg Jan 16, 2020
c0d78b3
Correct one typo.
Shylock-Hg Jan 16, 2020
1af3533
Show the log of codecov reporting.
Shylock-Hg Jan 16, 2020
0ab3b33
Specify gcov.
Shylock-Hg Jan 16, 2020
15b4356
Specify gcov.
Shylock-Hg Jan 17, 2020
81f723e
Correct one typo.
Shylock-Hg Jan 17, 2020
f5af5a6
Using lcov.
Shylock-Hg Jan 17, 2020
47c46b8
Fix one typo.
Shylock-Hg Jan 17, 2020
220f150
Using apt-get.
Shylock-Hg Jan 19, 2020
b582f43
Using ninja.
Shylock-Hg Jan 19, 2020
8433784
Add sudo for install.
Shylock-Hg Jan 19, 2020
49f5939
Checkout to root.
Shylock-Hg Jan 19, 2020
f3316d8
Fix one typo.
Shylock-Hg Jan 19, 2020
7f2909c
Using centos7 image for building.
Shylock-Hg Jan 19, 2020
aa23ede
Using my build image.
Shylock-Hg Jan 19, 2020
0a89f22
Using make.
Shylock-Hg Jan 23, 2020
b9ea232
Try cirrus CI.
Shylock-Hg Jan 24, 2020
3104cb8
Create .git/hooks for cirrus CI.
Shylock-Hg Jan 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:${LIBRARY_PATH}
run: |
mkdir _build && cd _build
${NEBULA_DEP_BIN}/cmake -DCMAKE_C_COMPILER=${NEBULA_DEP_BIN}/gcc -DCMAKE_CXX_COMPILER=${NEBULA_DEP_BIN}/g++ -DCMAKE_BUILD_TYPE=Release ..
${NEBULA_DEP_BIN}/cmake -DCMAKE_C_COMPILER=${NEBULA_DEP_BIN}/gcc -DCMAKE_CXX_COMPILER=${NEBULA_DEP_BIN}/g++ -DCMAKE_BUILD_TYPE=Release -DENABLE_COVERAGE=ON ..
shell: bash
- name: make
env:
Expand All @@ -57,6 +57,14 @@ jobs:
cd _build
${NEBULA_DEP_BIN}/ctest --output-on-failure
shell: bash
- name: coverage
if: success()
run: |
cd _build
bash <(curl -s https://codecov.io/bash)
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build-clang:
name: build-clang
runs-on: ubuntu-latest
Expand Down
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ option(ENABLE_CCACHE "Whether to use ccache to speed up compiling" ON)
option(ENABLE_ASAN "Whether to turn AddressSanitizer ON or OFF" OFF)
option(ENABLE_TESTING "Whether to turn unit test ON or OFF" ON)
option(ENABLE_UBSAN "Whether to turn Undefined Behavior Sanitizer ON or OFF" OFF)
option(ENABLE_COVERAGE "Enable testing coverage reporting" OFF)
option(ENABLE_FUZZ_TEST "Whether to turn Fuzz Test ON or OFF" OFF)

message(STATUS "ENABLE_ASAN: ${ENABLE_ASAN}")
Expand All @@ -58,6 +59,17 @@ if (!CMAKE_CXX_COMPILER)
message(FATAL_ERROR "No C++ compiler found")
endif()

# Testing Coverage, refer to https://github.com/codecov/example-cpp11-cmake
# Code Coverage Configuration
if(ENABLE_TESTING AND ENABLE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# Add required flags (GCC & LLVM/Clang)
add_compile_options(
# -O0 # no optimization
# -g # generate debug info
--coverage # sets all required flags
)
endif()

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down Expand Up @@ -461,6 +473,7 @@ macro(nebula_link_libraries target)
dl
${GETTIME_LIB}
-pthread
--coverage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not always link against libgcov. And, append it to CMAKE_EXE_LINKER_FLAGS only if enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not always link against libgcov. And, append it to CMAKE_EXE_LINKER_FLAGS only if enabled.

The library will not add to executable if not symbol used (without --coverage option when compile sources in this case).

Copy link
Contributor

@dutor dutor Jan 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then make it explicit.

)
endmacro(nebula_link_libraries)

Expand Down