From fa61bbdf101a5fb4aa528606d9b74af03d7dcf30 Mon Sep 17 00:00:00 2001 From: Abhimanyu Swami Date: Fri, 22 Nov 2019 15:49:52 +0530 Subject: [PATCH] Adding: Tizen Coverage Automation Change-Id: I06308f89512d2420e2536b5c3a1392f4653708cc Signed-off-by: Abhimanyu Swami --- packaging/oauth2.spec | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/packaging/oauth2.spec b/packaging/oauth2.spec index 779158b..8fb76f6 100644 --- a/packaging/oauth2.spec +++ b/packaging/oauth2.spec @@ -27,6 +27,10 @@ BuildRequires: pkgconfig(capi-system-info) Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig +%if 0%{?gcov:1} +BuildRequires: lcov +%endif + %description Tizen oauth 2.0 Framework @@ -37,10 +41,28 @@ Requires: %{name} = %{version}-%{release} %description devel Development files for %{name} +################################################# +# gcov +################################################# +%if 0%{?gcov:1} +%package gcov +Summary: Oauth Framework (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 + %if 0%{?sec_build_binary_debug_enable} export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE" export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE" @@ -73,11 +95,19 @@ cmake . \ 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 mkdir -p %{buildroot}%{_libdir} rm -rf %{buildroot}%{_libdir}/oauth2 @@ -97,3 +127,9 @@ rm -rf %{buildroot}%{_libdir}/oauth2 %{_libdir}/*.so %{_includedir}/*.h %{_libdir}/pkgconfig/oauth2.pc + +%if 0%{?gcov:1} +%files gcov +%{_datadir}/gcov/obj/* +%endif + -- 2.7.4