summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormk5004.lee <mk5004.lee@samsung.com>2019-07-10 05:51:44 (GMT)
committermk5004.lee <mk5004.lee@samsung.com>2019-07-10 08:04:09 (GMT)
commit6fe3e30a7da255d92ea859cc426d26ee3f8c5ebb (patch)
tree910357f3b79e974b0c6062650d74b165b6f0218b
parent8aa0af3d3d39986bebc88e6b0026ba4f23fda076 (diff)
downloadbadge-6fe3e30a7da255d92ea859cc426d26ee3f8c5ebb.zip
badge-6fe3e30a7da255d92ea859cc426d26ee3f8c5ebb.tar.gz
badge-6fe3e30a7da255d92ea859cc426d26ee3f8c5ebb.tar.bz2
Make a gcov package for measuring coverage easierrefs/changes/04/209704/4
Change-Id: Iea7e015b8b0278fc1315c1a70e14f53b337c36bf Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
-rw-r--r--packaging/badge.spec42
1 files changed, 38 insertions, 4 deletions
diff --git a/packaging/badge.spec b/packaging/badge.spec
index 218838e..2c4c4cc 100644
--- a/packaging/badge.spec
+++ b/packaging/badge.spec
@@ -22,9 +22,6 @@ requires(postun): /sbin/ldconfig
%description
Client/Server library for updating badge information
-%prep
-%setup -q
-
%package devel
Summary: Badge library (devel)
Group: Development/Libraries
@@ -41,8 +38,27 @@ Requires: %{name} = %{version}-%{release}
%description service-devel
Development files needed to build badge service
+%if 0%{?gcov:1}
+%package gcov
+Summary: Badge library (gcov)
+Group: System/API
+
+%description gcov
+gcov objects of a Badge library
+%endif
+
+%prep
+%setup -q
+
%build
-export LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--as-needed"
+%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 LDFLAGS+=" -Wl,--rpath=%{_prefix}/lib -Wl,--as-needed"
LDFLAGS="$LDFLAGS"
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . \
@@ -50,9 +66,20 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-DFULLVER=%{version}
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
@@ -89,3 +116,10 @@ fi
%{_includedir}/badge/badge_ipc.h
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/libbadge.so
+
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif
+# End of a file