This is an automated email from the ASF dual-hosted git repository. haonan pushed a commit to branch code_coverage_v3 in repository https://gitbox.apache.org/repos/asf/tsfile.git
commit 52d3a0fbf8e0a7c32c4f852e021444c54970b399 Author: HTHou <[email protected]> AuthorDate: Thu Aug 1 22:32:19 2024 +0800 update --- .github/workflows/code-coverage.yml | 3 ++- code-coverage/copy-code-coverage-sources.sh | 20 ++++++++++---------- cpp/src/CMakeLists.txt | 1 + 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index f1a4f116..48cf5d9c 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -3,6 +3,7 @@ on: push: branches: - develop + - code_coverage_v3 paths-ignore: - 'docs/**' pull_request: @@ -27,7 +28,7 @@ jobs: - name: Generate code coverage reports run: | sudo apt-get install lcov - ./mvnw -B -P with-java,with-cpp,with-code-coverage clean verify + ./mvnw -B -P with-cpp,with-code-coverage clean verify lcov --capture --directory cpp/target/build/test --output-file cpp/target/build/test/coverage.info lcov --remove cpp/target/build/test/coverage.info '*/tsfile/cpp/test/*' --output-file cpp/target/build/test/coverage_filtered.info genhtml cpp/target/build/test/coverage_filtered.info --output-directory cpp/target/build/test/coverage_report diff --git a/code-coverage/copy-code-coverage-sources.sh b/code-coverage/copy-code-coverage-sources.sh index 19c24fd1..7c6361fe 100755 --- a/code-coverage/copy-code-coverage-sources.sh +++ b/code-coverage/copy-code-coverage-sources.sh @@ -18,14 +18,14 @@ # under the License. # -for file in ../java/*/target/*.exec -do - cp $file ./target/ -done - -for file in ../java/*/target/classes -do - echo "copy from" ${file} - cp -r $file ./target/ -done +#for file in ../java/*/target/*.exec +#do +# cp $file ./target/ +#done +# +#for file in ../java/*/target/classes +#do +# echo "copy from" ${file} +# cp -r $file ./target/ +#done diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt index ec07d19a..7346d8b1 100644 --- a/cpp/src/CMakeLists.txt +++ b/cpp/src/CMakeLists.txt @@ -30,6 +30,7 @@ add_subdirectory(writer) add_library(tsfile SHARED) if (${COV_ENABLED}) message("Enable code cov...") + add_compile_options(-fprofile-arcs -ftest-coverage) target_link_libraries(tsfile common_obj compress_obj cwrapper_obj file_obj read_obj write_obj -lgcov) else() message("Disable code cov...")
