Added a gcov flag to meaure line & function coverage. 93/185393/2 accepted/tizen_5.0_unified accepted/tizen/5.0/unified/20181102.013315 accepted/tizen/unified/20180827.160623 submit/tizen/20180827.065334 submit/tizen_5.0/20181101.000002
authorsaerome.kim <saerome.kim@samsung.com>
Mon, 30 Jul 2018 06:47:07 +0000 (15:47 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 30 Jul 2018 06:49:13 +0000 (15:49 +0900)
Change-Id: I8511631d17474ed54331d926d935555df13e1fa7
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
CMakeLists.txt
packaging/capi-network-smartcard.spec [changed mode: 0755->0644]

index f22c146..afabe92 100644 (file)
@@ -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}\"")
old mode 100755 (executable)
new mode 100644 (file)
index e03cb07..6ad4f1c
@@ -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