From 94d41db8f5fbd87fe2f45dba6ca108c9c335cc73 Mon Sep 17 00:00:00 2001 From: gavinhgchen Date: Tue, 7 Mar 2023 11:15:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlcov=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E5=87=86=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 6 ++++++ gen_lcov.sh | 2 +- include/cos_defines.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4663047..7b2c4eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ set(CMAKE_VERBOSE_MAKEFILE ON) option(BUILD_UNITTEST "Build unittest" OFF) option(BUILD_DEMO "Build demo" ON) option(BUILD_SHARED_LIB "Build shared library" OFF) +option(ENABLE_COVERAGE "Enable Coverage" OFF) if(APPLE) set(OS_TYPE "APPLE") @@ -71,6 +72,11 @@ else() set(SYSTEM_LIBS stdc++ pthread) endif() +if(ENABLE_COVERAGE) +# coverage option +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") +endif() + add_subdirectory(src) if(BUILD_UNITTEST) diff --git a/gen_lcov.sh b/gen_lcov.sh index a04a384..eff79ca 100755 --- a/gen_lcov.sh +++ b/gen_lcov.sh @@ -1,7 +1,7 @@ #!/bin/sh workspace=`pwd` -EXTRACT="${workspace}/*/op/* ${workspace}/*/util/* ${workspace}/*/request/* ${workspace}/*/response/* ${workspace}/include" +EXTRACT="${workspace}/src ${workspace}/include" # clear rm UTReport -rf rm UTResport.tar diff --git a/include/cos_defines.h b/include/cos_defines.h index 407f6d6..c1094e0 100644 --- a/include/cos_defines.h +++ b/include/cos_defines.h @@ -11,7 +11,7 @@ namespace qcloud_cos { -#define COS_CPP_SDK_VERSON "v5.5.9" +#define COS_CPP_SDK_VERSON "v5.5.10" /// 路径分隔符 const std::string kPathDelimiter = "/";