From 0f099fc6e1af749b0e11e007b92081d01cae6198 Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Tue, 2 Jul 2019 14:50:18 +0900 Subject: [PATCH] Make a gcov package for measuring coverage easier [Version] 0.3.17-1 [Issue Type] Update Change-Id: I8b4338a6b0db73ae774415fd8ca3af59eb7db1ca Signed-off-by: Jeongmo Yang --- packaging/capi-media-recorder.spec | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/packaging/capi-media-recorder.spec b/packaging/capi-media-recorder.spec index 115626f..aa277f9 100644 --- a/packaging/capi-media-recorder.spec +++ b/packaging/capi-media-recorder.spec @@ -1,7 +1,7 @@ Name: capi-media-recorder Summary: A Recorder API Version: 0.3.17 -Release: 0 +Release: 1 Group: Multimedia/API License: Apache-2.0 Source0: %{name}-%{version}.tar.gz @@ -46,21 +46,42 @@ Requires: %{name} = %{version}-%{release} %description tool Tizen Native recorder API testsuite. +%if 0%{?gcov:1} +%package gcov +Summary: Line Coverage of Recorder library in Tizen Native API +Group: Development/Multimedia + +%description gcov +Collection of files related to Line Coverage. It is teseted as gcov for a recorder library in Tizen native API +%endif + %prep %setup -q %build +%if 0%{?gcov:1} +export CFLAGS+=" -fprofile-arcs -ftest-coverage" +export LDFLAGS+=" -lgcov" +%endif MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -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 @@ -82,3 +103,9 @@ rm -rf %{buildroot} %manifest capi-media-recorder-tool.manifest %license LICENSE.APLv2 %{_bindir}/* + +%if 0%{?gcov:1} +%files gcov +%{_datadir}/gcov/obj/* +%endif + -- 2.7.4