Make a gcov package for coverage 32/208832/1 accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5_mobile_hotfix tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20191031.031519 accepted/tizen/5.5/unified/mobile/hotfix/20201027.065909 accepted/tizen/5.5/unified/wearable/hotfix/20201027.121753 accepted/tizen/unified/20190705.110732 submit/tizen/20190702.011709 submit/tizen/20190704.043443 submit/tizen/20190705.002912 submit/tizen_5.5/20191031.000002 submit/tizen_5.5_mobile_hotfix/20201026.185102 submit/tizen_5.5_wearable_hotfix/20201026.184302 tizen_5.5.m2_release
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 1 Jul 2019 01:45:33 +0000 (10:45 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 1 Jul 2019 01:45:38 +0000 (10:45 +0900)
Change-Id: I9632d148b5d3a09cf649ad6083935e5f0d1810a9

packaging/capi-web-url-download.spec

index 0787b11..6f151a9 100755 (executable)
@@ -1,4 +1,3 @@
-
 Name:  capi-web-url-download
 Summary:       CAPI for content download with web url
 Version:       1.2.11
@@ -13,6 +12,9 @@ BuildRequires: pkgconfig(capi-appfw-application)
 BuildRequires: pkgconfig(download-provider-interface)
 BuildRequires: pkgconfig(capi-system-info)
 BuildRequires: cmake
+%if 0%{?gcov:1}
+BuildRequires: lcov
+%endif
 
 %description
 CAPI for the content download
@@ -25,20 +27,41 @@ Requires:   %{name} = %{version}-%{release}
 %description devel
 CAPI for content downloading with web url (developement files)
 
+%if 0%{?gcov:1}
+%package gcov
+Summary:  Download library(gcov)
+Group:    Network/Testing
+%description gcov
+gcov objects for coverage test
+%endif
+
 %prep
 %setup -q
 
 %build
-export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
-export FFLAGS="$FFLAGS -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
+
 %cmake .
 
 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
 
@@ -59,3 +82,8 @@ rm -rf %{buildroot}
 %{_includedir}/web/download_product.h
 %{_includedir}/web/download_private.h
 %{_includedir}/web/download_doc.h
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif