summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2019-07-10 05:19:01 (GMT)
committerHwankyu Jhun <h.jhun@samsung.com>2019-07-10 05:19:19 (GMT)
commit1286bf1280d57ab313dff3058450f37d5bb11d9f (patch)
treea0c3ae828f6b6522343261fc14432f91922f3f9f
parentd3ac826d68d7044fa065acb3d2979c7b6324fec9 (diff)
downloadui-gadget-1-1286bf1280d57ab313dff3058450f37d5bb11d9f.zip
ui-gadget-1-1286bf1280d57ab313dff3058450f37d5bb11d9f.tar.gz
ui-gadget-1-1286bf1280d57ab313dff3058450f37d5bb11d9f.tar.bz2
Make a gcov package for measuring coverage easierrefs/changes/99/209699/1
Change-Id: I1e1df0b4fcb75e90a01afe9f5e3ed807535c3f3f Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--packaging/ui-gadget-1.spec30
1 files changed, 30 insertions, 0 deletions
diff --git a/packaging/ui-gadget-1.spec b/packaging/ui-gadget-1.spec
index 00d241d..53b5b94 100644
--- a/packaging/ui-gadget-1.spec
+++ b/packaging/ui-gadget-1.spec
@@ -34,11 +34,27 @@ Requires: %{name} = %{version}-%{release}
%description devel
Development files for %{name}
+%if 0%{?gcov:1}
+%package gcov
+Summary: UI Gadget Library(gcov)
+Group: System/API
+
+%description gcov
+gcov objects of UI Gadget 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
+
export CFLAGS+=" -DEFL_BETA_API_SUPPORT "
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake -DFULLVER=%{version} \
@@ -48,10 +64,20 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
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
/sbin/ldconfig
ln -sf %{TZ_SYS_BIN}/ug-client %{TZ_SYS_BIN}/ug-launcher
@@ -75,3 +101,7 @@ ln -sf %{TZ_SYS_BIN}/ug-client %{TZ_SYS_BIN}/ug-launcher
%{_libdir}/libui-gadget-1.so
%{_libdir}/pkgconfig/%{name}.pc
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif