Make a gcov package for coverage 67/208867/2 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.030732 accepted/tizen/5.5/unified/mobile/hotfix/20201027.065415 accepted/tizen/unified/20190705.110729 submit/tizen/20190702.011709 submit/tizen/20190704.043443 submit/tizen/20190705.002457 submit/tizen/20190705.002836 submit/tizen_5.5/20191031.000002 submit/tizen_5.5_mobile_hotfix/20201026.185102 tizen_5.5.m2_release
authorCheoleun Moon <chleun.moon@samsung.com>
Mon, 1 Jul 2019 04:40:16 +0000 (13:40 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Mon, 1 Jul 2019 06:31:23 +0000 (15:31 +0900)
Change-Id: I6f2e1bda68c7d08d9dfb700f2cbd7341be24bcb6
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
packaging/capi-network-asp.spec

index 904609b..48ac859 100755 (executable)
@@ -22,6 +22,9 @@ BuildRequires:  pkgconfig(libsoup-2.4)
 BuildRequires:  pkgconfig(gssdp-1.0)
 BuildRequires:  pkgconfig(gupnp-1.0)
 %endif
+%if 0%{?gcov:1}
+BuildRequires: lcov
+%endif
 
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
@@ -44,6 +47,14 @@ Summary:    ASP - ASP test binaries
 %description test
 Test Application for Application Service Platform(ASP)
 
+%if 0%{?gcov:1}
+%package gcov
+Summary:  Application Service Platform(ASP) library(gcov)
+Group:    Network/Testing
+%description gcov
+gcov objects for coverage test
+%endif
+
 %prep
 %setup -q
 chmod 644 %{SOURCE0}
@@ -55,12 +66,13 @@ export ARCH=i586
 %endif
 
 %build
-%if 0%{?sec_build_binary_debug_enable}
-export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
+%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
 
-
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 %cmake . \
 %if "%{file_transfer_test}" == "yes"
@@ -78,10 +90,20 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
         -DMAJORVER=${MAJORVER}
 make %{?jobs:-j%jobs}
 
+%if 0%{?gcov:1}
+mkdir -p gcov-obj
+find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
+%endif
+
 %install
 rm -rf %{buildroot}
 %make_install
 
+%if 0%{?gcov:1}
+mkdir -p %{buildroot}%{_datadir}/gcov/obj
+install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+%endif
+
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
@@ -102,3 +124,8 @@ rm -rf %{buildroot}
 %files test
 %manifest asp-test.manifest
 %attr(755,root,root) %{_bindir}/asp-test
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif