Adding: Tizen Coverage Automation 42/218842/1
authorAbhimanyu Swami <abhimanyu1.s@samsung.com>
Thu, 28 Nov 2019 12:47:02 +0000 (18:17 +0530)
committerAbhimanyu Swami <abhimanyu1.s@samsung.com>
Thu, 28 Nov 2019 12:47:02 +0000 (18:17 +0530)
Change-Id: I0c900fa3e98333b8cfe2b2c186d09985391f6815
Signed-off-by: Abhimanyu Swami <abhimanyu1.s@samsung.com>
packaging/capi-messaging-email.spec

index 611bf6e06b52781ba2ace320504dbe4be9b8483a..b18f3bf4edd7243108302d520ed42aab5019df7a 100644 (file)
@@ -26,10 +26,23 @@ Email library in Tizen Native API.
 Summary:  Email library in Tizen Native API (Development)
 Requires: %{name} = %{version}-%{release}
 
+%if 0%{?gcov:1}
+BuildRequires:  lcov
+%endif
+
 %description devel
 %devel_desc
 
-
+#################################################
+# gcov
+#################################################
+%if 0%{?gcov:1}
+%package gcov
+Summary:    Email library (gcov)
+Group:      Service Framework/Testing
+%description gcov
+gcov objects for coverage test
+%endif
 
 %prep
 %setup -q
@@ -37,19 +50,40 @@ 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
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 %cmake . -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
 %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
 
 %postun -p /sbin/ldconfig
 
 
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif
+
 %files
 %manifest %{name}.manifest
 %license LICENSE