Adding: Tizen Coverage Automation 41/218241/1
authorAbhimanyu Swami <abhimanyu1.s@samsung.com>
Wed, 20 Nov 2019 13:53:55 +0000 (19:23 +0530)
committerAbhimanyu Swami <abhimanyu1.s@samsung.com>
Wed, 20 Nov 2019 13:53:55 +0000 (19:23 +0530)
Change-Id: I8de4816621e9b00d5d5ae38647b093c7a0320c57
Signed-off-by: Abhimanyu Swami <abhimanyu1.s@samsung.com>
packaging/capi-maps-service.spec

index 590ee00493e2e2a3ae165f01af99cd3606ba1b41..04a642b4153f6deaf239cbf26d6369c581e54477 100644 (file)
@@ -6,8 +6,6 @@ Group:      Location/API
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 
-BuildRequires:  cmake
-
 # Maps API dependencies
 BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(gmodule-2.0)
@@ -31,6 +29,12 @@ Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 Provides: capi-maps-service-plugin-devel
 
+BuildRequires:  cmake
+
+%if 0%{?gcov:1}
+BuildRequires:  lcov
+%endif
+
 %ifarch %{arm}
 %define ARCH arm
 %else
@@ -40,10 +44,27 @@ Provides: capi-maps-service-plugin-devel
 %description
 This provides the Tizen Map Service API to access and handle the map data.
 
+#################################################
+# gcov
+#################################################
+%if 0%{?gcov:1}
+%package gcov
+Summary:    Account library (gcov)
+Group:      Service Framework/Testing
+%description gcov
+gcov objects for coverage test
+%endif
+
 %prep
 %setup -q
 
 %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="$CFLAGS -DTIZEN_ENGINEER_MODE"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
@@ -52,11 +73,20 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} \
        -DLIBDIR=%{_libdir} -DTIZEN_VER=0x030000
 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
 mkdir -p %{_libdir}/maps/plugins
 # privilege mapping for Tizen 3.x
@@ -142,3 +172,7 @@ Test
 %defattr(-,root,root,-)
 %{_bindir}/%{name}-test
 
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif