summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2019-07-10 23:46:34 (GMT)
committerHwankyu Jhun <h.jhun@samsung.com>2019-07-10 23:46:56 (GMT)
commitce7d18a00f9d0d7b9eccc2abf5e43a69e5d6862b (patch)
tree4ccbc6410eb4d60524a89a97a66edd2445e1e449
parent7159bea64c2f38c21d662552928f4c296b5cfe5f (diff)
downloadminicontrol-ce7d18a00f9d0d7b9eccc2abf5e43a69e5d6862b.zip
minicontrol-ce7d18a00f9d0d7b9eccc2abf5e43a69e5d6862b.tar.gz
minicontrol-ce7d18a00f9d0d7b9eccc2abf5e43a69e5d6862b.tar.bz2
Make a gcov package for measuring coverage easierrefs/changes/67/209767/1
Change-Id: I22c2d078a3ab0da2f0469c10099924c156d21dbc Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--packaging/minicontrol.spec35
1 files changed, 33 insertions, 2 deletions
diff --git a/packaging/minicontrol.spec b/packaging/minicontrol.spec
index d2390a7..d8bf43c 100644
--- a/packaging/minicontrol.spec
+++ b/packaging/minicontrol.spec
@@ -25,14 +25,30 @@ Minicontrol is a small control panel on notification panel or lock screen. This
%package devel
Summary: Minicontrol library (devel)
Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
+Requires: %{name} = %{version}
%description devel
Minicontrol library (devel).
+%if 0%{?gcov:1}
+%package gcov
+Summary: Minicontrol Library(gcov)
+Group: Application Framework/Other
+
+%description gcov
+gcov objects of Minicontrol Library
+%endif
+
%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+=" -fPIC "
-export LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--as-needed"
+export LDFLAGS+=" -Wl,--rpath=%{_prefix}/lib -Wl,--as-needed"
LDFLAGS="$LDFLAGS"
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
@@ -43,9 +59,19 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%endif
make %{?jobs:-j%jobs}
+%if 0%{?gcov:1}
+mkdir -p gcov-obj
+find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
+%endif
+
%install
%make_install
+%if 0%{?gcov:1}
+mkdir -p %{buildroot}%{_datadir}/gcov/obj
+install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+%endif
+
%post
/sbin/ldconfig
@@ -68,3 +94,8 @@ make %{?jobs:-j%jobs}
%{_libdir}/libminicontrol-provider.so
%{_libdir}/libminicontrol-viewer.so
%{_libdir}/libminicontrol-monitor.so
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif