From 752ca4759fe47ab522b3cb77d8bebfdf7c76509b Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Tue, 2 Jul 2019 08:29:04 +0900 Subject: [PATCH] Add for line coverage Change-Id: Ief38a15eb8a0d5ce606b11fc9e5c22353ff2aaa1 Signed-off-by: Minje Ahn --- packaging/capi-media-metadata-editor.spec | 39 ++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/packaging/capi-media-metadata-editor.spec b/packaging/capi-media-metadata-editor.spec index a7eed50..d3625a7 100755 --- a/packaging/capi-media-metadata-editor.spec +++ b/packaging/capi-media-metadata-editor.spec @@ -12,6 +12,10 @@ BuildRequires: pkgconfig(taglib) BuildRequires: pkgconfig(aul) Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig +%if 0%{?gcov:1} +BuildRequires: lcov +BuildRequires: zip +%endif %description A media metadata editor library in Tizen Native API. @@ -24,6 +28,15 @@ Requires: %{name} = %{version}-%{release} %description devel A media metadata editor library in Tizen Native API. (Development files included) +%if 0%{?gcov:1} +%package gcov +Summary: Line Coverage of Metadata Editor library in Tizen C API +Group: Development/Multimedia + +%description gcov +Collection of files related to Line Coverage. It is teseted as gcov for a metadata editor library in Tizen native API +%endif + %prep %setup -q @@ -44,10 +57,29 @@ 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 + +%check +ctest --output-on-failure %{?_smp_mflags} +%if 0%{?gcov:1} +lcov -c --ignore-errors graph --no-external -q -d . -o metadata-editor.info +genhtml metadata-editor.info -o metadata-editor.out +zip -r metadata-editor.zip metadata-editor.out metadata-editor.info +install -m 0644 metadata-editor.zip %{buildroot}%{_datadir}/gcov/ +%endif + %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -58,4 +90,9 @@ rm -rf %{buildroot} %files devel %{_includedir}/metadata-editor/*.h -%{_libdir}/pkgconfig/capi-media-metadata-editor.pc +%{_libdir}/pkgconfig/capi-media-metadata-editor.pci + +%if 0%{?gcov:1} +%files gcov +%{_datadir}/gcov/obj/* +%endif -- 2.7.4