Add the test coverage build option in spec file 69/178269/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 9 May 2018 05:58:28 +0000 (14:58 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 9 May 2018 05:58:28 +0000 (14:58 +0900)
Change-Id: I7c619899d456848ddfdc198967433d729961e7d8
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
packaging/capi-network-bluetooth.spec

index 672efcd..c899cfc 100644 (file)
@@ -47,6 +47,12 @@ This package is C-API test application.
 cp %{SOURCE1001} %{SOURCE1002} .
 
 %build
+%if 0%{?gcov:1}
+export CFLAGS+=" -fprofile-arcs -ftest-coverage"
+export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
+export FFLAGS+=" -fprofile-arcs -ftest-coverage"
+export LDFLAGS+=" -lgcov"
+%endif
 
 #export CFLAGS="$CFLAGS -DTIZEN_FEATURE_AUDIO_HF_DISABLE -DTIZEN_FEATURE_OTP_SUPPORT"
 #export CXXFLAGS="$CXXFLAGS -DTIZEN_FEATURE_AUDIO_HF_DISABLE -DTIZEN_FEATURE_OTP_SUPPORT"
@@ -73,7 +79,7 @@ export FFLAGS+=" -DARCH64"
 %cmake
 
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
 
 make %{?jobs:-j%jobs}