summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2019-07-10 04:33:30 (GMT)
committerHwankyu Jhun <h.jhun@samsung.com>2019-07-10 04:33:30 (GMT)
commit6fb97ed94a1685b98f29dfb1e33331195c6c2db8 (patch)
treed54f9384c738af9458cd442e91a8621bb2a280f2
parente0930757b5393281397240b2c8949f6b65d93525 (diff)
downloadapplication-6fb97ed94a1685b98f29dfb1e33331195c6c2db8.zip
application-6fb97ed94a1685b98f29dfb1e33331195c6c2db8.tar.gz
application-6fb97ed94a1685b98f29dfb1e33331195c6c2db8.tar.bz2
Make a gcov package for measuring coverage easierrefs/changes/83/209683/1
Change-Id: I8ede5b1fdd0a5336c8c0e5f6e3415f6896a76a27 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--packaging/capi-appfw-application.spec32
1 files changed, 31 insertions, 1 deletions
diff --git a/packaging/capi-appfw-application.spec b/packaging/capi-appfw-application.spec
index e361d68..d22e5ee 100644
--- a/packaging/capi-appfw-application.spec
+++ b/packaging/capi-appfw-application.spec
@@ -30,25 +30,50 @@ An Application library in SLP C API package.
%package devel
Summary: An Application library in SLP C API (Development)
Group: System/API
-Requires: %{name} = %{version}-%{release}
+Requires: %{name} = %{version}
%description devel
An Application library in SLP C API (Development) package.
+%if 0%{?gcov:1}
+%package gcov
+Summary: An application library(gcov)
+Group: System/API
+
+%description gcov
+gcov objects of an application library
+%endif
%prep
%setup -q
cp %{SOURCE1001} .
%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
+
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . -DFULLVER=%{version} -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
@@ -65,3 +90,8 @@ rm -rf %{buildroot}
%{_includedir}/appfw/app_i18n.h
%{_libdir}/pkgconfig/capi-appfw-application.pc
%{_libdir}/libcapi-appfw-application.so
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif