diff options
author | saerome.kim <saerome.kim@samsung.com> | 2018-07-30 15:47:07 +0900 |
---|---|---|
committer | saerome kim <saerome.kim@samsung.com> | 2018-07-30 06:57:23 +0000 |
commit | e8634c6d7913e22dd0f73f52b4a0750990562053 (patch) | |
tree | c47d7bbfa85f83a961370a3f71e410437948d299 | |
parent | d5394bd03bdb7685a6fe5af46fb049148e17ab6b (diff) | |
download | smartcard-accepted/tizen_4.0_unified.tar.gz smartcard-accepted/tizen_4.0_unified.tar.bz2 smartcard-accepted/tizen_4.0_unified.zip |
Added a gcov flag to meaure line & function coverage.submit/tizen_4.0/20180731.064939accepted/tizen/4.0/unified/20180803.172356accepted/tizen_4.0_unified
Change-Id: I8511631d17474ed54331d926d935555df13e1fa7
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
(cherry picked from commit 6f53bf7c466fc7e34927f051b30864611a1c89f2)
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r--[-rwxr-xr-x] | packaging/capi-network-smartcard.spec | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f22c146..afabe92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,9 +32,14 @@ FOREACH(flag ${${fw_name}_CFLAGS}) SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror") +IF(BUILD_GCOV) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -fprofile-arcs -ftest-coverage") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -fPIC -Wall -Werror -fprofile-arcs -ftest-coverage") +ELSE(BUILD_GCOV) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -fPIC -Wall -Werror") +ENDIF(BUILD_GCOV) SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -fPIC -Wall -Werror") SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") diff --git a/packaging/capi-network-smartcard.spec b/packaging/capi-network-smartcard.spec index e03cb07..6ad4f1c 100755..100644 --- a/packaging/capi-network-smartcard.spec +++ b/packaging/capi-network-smartcard.spec @@ -29,10 +29,14 @@ Requires: %{name} = %{version}-%{release} %setup -q %build +%if 0%{?gcov:1} +export LDFLAGS+=" -lgcov" +%endif + MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} \ - -DMAJORVER=${MAJORVER} -DCMAKE_LIB_DIR=%{_libdir} \ + -DMAJORVER=${MAJORVER} -DCMAKE_LIB_DIR=%{_libdir} -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \ %ifarch %{arm} -DTIZEN_SMARTCARD_SUPPORT=1 %endif |