From: Ilho Kim Date: Thu, 21 Nov 2019 01:47:04 +0000 (+0900) Subject: Make a gcov package for measuring coverage easier X-Git-Tag: accepted/tizen/unified/20191128.161958~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F55%2F218255%2F4;p=platform%2Fcore%2Fsystem%2Fbuxton2.git Make a gcov package for measuring coverage easier Change-Id: Ieefb34aaa11c88067740fef5f96531676b9531be Signed-off-by: Ilho Kim --- diff --git a/packaging/buxton2.spec b/packaging/buxton2.spec index ff50d66..b7a5567 100644 --- a/packaging/buxton2.spec +++ b/packaging/buxton2.spec @@ -65,7 +65,7 @@ This package provides development files for Buxton. %package -n vconf-compat Summary: buxton wrapper for vconf APIs -Requires: %{name} = %{version}-%{release} +Requires: %{name} = %{version} Requires: /usr/bin/getopt Obsoletes: vconf-buxton Obsoletes: vconf @@ -80,7 +80,7 @@ Buxton wrapper library for providing vconf APIs %package -n vconf-compat-devel Summary: buxton wrapper for vconf APIs (devel) -Requires: vconf-compat = %{version}-%{release} +Requires: vconf-compat = %{version} Requires: vconf-internal-keys-devel BuildRequires: pkgconfig(vconf-internal-keys) Obsoletes: vconf-buxton-devel @@ -95,12 +95,28 @@ Provides: vconf-keys-devel %description -n vconf-compat-devel Buxton wrapper library for providing vconf APIs (devel) +%if 0%{?gcov:1} +%package gcov +Summary: buxton wrapper for vconf APIs (gcov) +Group: Application Framework/API + +%description gcov +gcov objects for a buxton2 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 + # for Address space layout randomization export CFLAGS="$CFLAGS -fPIE" export LDFLAGS="$LDFLAGS -pie" @@ -118,6 +134,11 @@ export LDFLAGS="$LDFLAGS -pie" %__make %{?_smp_mflags} +%if 0%{?gcov:1} +mkdir -p gcov-obj +find . -name '*.gcno' -exec cp '{}' gcov-obj ';' +%endif + %install %make_install @@ -146,6 +167,11 @@ ln -sf ../%{name}.socket %{buildroot}%{_unitdir}/sockets.target.wants/ mkdir -p %{buildroot}%{upgrade_script_path} cp -f scripts/290.buxton2_upgrade.sh %{buildroot}%{upgrade_script_path} +%if 0%{?gcov:1} +mkdir -p %{buildroot}%{_datadir}/gcov/obj +install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj +%endif + %post /sbin/ldconfig @@ -218,3 +244,7 @@ chsmack -a System %{dbdir}/* %{_libdir}/libvconf.so %{_libdir}/pkgconfig/vconf.pc +%if 0%{?gcov:1} +%files gcov +%{_datadir}/gcov/obj/* +%endif