From: Jongmin Lee Date: Mon, 8 Jul 2019 00:27:37 +0000 (+0900) Subject: spec: make a gcov package for measuring coverage easier X-Git-Tag: accepted/tizen/unified/20190711.062823~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F25%2F209425%2F2;p=platform%2Fupstream%2Fefl.git spec: make a gcov package for measuring coverage easier Change-Id: I33d8e9574ccedd200cdee2b1142e82c18e6033de --- diff --git a/packaging/efl.spec b/packaging/efl.spec index 9cd34f1..314cc65 100644 --- a/packaging/efl.spec +++ b/packaging/efl.spec @@ -80,6 +80,10 @@ BuildRequires: pkgconfig(xkbcommon) BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(ttrace) +%if 0%{?gcov:1} +BuildRequires: lcov +%endif + #eldbus BuildRequires: pkgconfig(dbus-1) @@ -1194,6 +1198,16 @@ Development files for efl-wl ##%%description -n elput-devel ##%Development files for elput + +%if 0%{?gcov:1} +%package gcov +Summary: Enlightenment Foundation Libraries (gcov) +Group: Graphics & UI Framework/Testing +%description gcov +Enlightenment Foundation Libraris gcov objects +%endif + + %prep echo "%{_buildsystem}" %setup -q @@ -1215,6 +1229,13 @@ CFLAGS+=" -DLIBDIR=\\\"%{_libdir}\\\"" %restore_fcommon %endif +%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 XDG_RUNTIME_DIR="/tmp/" export DESTDIR=%{buildroot} @@ -1233,6 +1254,11 @@ ninja \ -v \ all +%if 0%{?gcov:1} +mkdir -p gcov-obj +find . -name '*.gcno' -exec cp '{}' gcov-obj ';' +%endif + %install export DESTDIR=%{buildroot} ninja \ @@ -1246,6 +1272,11 @@ rm %{buildroot}%{_libdir}/libelementary_t.* mkdir -p %{buildroot}%{_tmpfilesdir} install -m 0644 %SOURCE100 %{buildroot}%{_tmpfilesdir}/efl.conf +%if 0%{?gcov:1} +mkdir -p %{buildroot}%{_datadir}/gcov/obj +install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj +%endif + %find_lang %{name} %post -n eina -p /sbin/ldconfig @@ -2100,3 +2131,7 @@ ldconfig -l %{_libdir}/libelementary.so.1.22.99 %license COPYING %defattr(-,root,root,-) +%if 0%{?gcov:1} +%files gcov +%{_datadir}/gcov/obj/* +%endif