Adding: Tizen Coverage Automation 15/218215/1 accepted/tizen/unified/20191121.154813 submit/tizen/20191121.062155
authorDewal Agarwal <d1.agarwal@samsung.com>
Wed, 20 Nov 2019 09:46:56 +0000 (15:16 +0530)
committerDewal Agarwal <d1.agarwal@samsung.com>
Wed, 20 Nov 2019 09:46:56 +0000 (15:16 +0530)
Change-Id: I4aca26e4e4185c2be43a1a0c78b88757d4859f7a
Signed-off-by: Dewal Agarwal <d1.agarwal@samsung.com>
packaging/capi-context.spec

index ec97118..038740d 100644 (file)
@@ -33,6 +33,13 @@ Tizen Context Framework Native API
 %build
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 
+%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 CXXFLAGS+=" -Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-parameter"
 export CXXFLAGS+=" -Wformat=2 -Wno-empty-body -fomit-frame-pointer -fno-optimize-sibling-calls"
 export CXXFLAGS+=" -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow"
@@ -40,10 +47,19 @@ export CXXFLAGS+=" -Wnon-virtual-dtor -std=c++0x"
 
 %cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version}
 make %{?_smp_mflags}
+%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
+
 # Backward compatibility
 ln -s %{name}.pc %{buildroot}/%{_libdir}/pkgconfig/context.pc
 ln -s lib%{name}.so.%{version} %{buildroot}/%{_libdir}/libcontext.so.0
@@ -84,3 +100,15 @@ Tizen Context Framework Testsuite
 %manifest testsuite/capi-context-test.manifest
 %{_bindir}/context-test
 %license LICENSE
+
+%if 0%{?gcov:1}
+%package gcov
+Summary:    Tizen Context Framework Native API (gcov)
+Group:      Service Framework/Testing
+
+%description gcov
+gcov objects for coverage test
+
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif