Add coverage exception macros
[platform/core/api/video-util.git] / packaging / capi-media-video-util.spec
old mode 100755 (executable)
new mode 100644 (file)
index 53359a7..a3a6974
@@ -1,6 +1,6 @@
 Name:       capi-media-video-util
 Summary:    A Video Utility library in Tizen Native API
-Version:    0.1.11
+Version:    0.1.14
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
@@ -18,7 +18,6 @@ BuildRequires:  gettext-devel
 %description
 A Video Utility library in Tizen Native API
 
-
 %package devel
 Summary:    A Video Utility library in Tizen Native API (Developement)
 Group:      TO_BE_FILLED
@@ -31,19 +30,43 @@ Requires:  pkgconfig(capi-base-common)
 %description devel
 A Video Utility library in Tizen Native API (Developement)
 
+%if 0%{?gcov:1}
+%package gcov
+Summary: Line Coverage of Video Utility library in Tizen C API
+Group: Development/Multimedia
+
+%description gcov
+Collection of files related to Line Coverage. It is tested as gcov for a video utility library in Tizen native API
+%endif
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
 
 %build
+%if 0%{?gcov:1}
+export CFLAGS+=" -DTIZEN_EXCLUDE_COVERAGE -fprofile-arcs -ftest-coverage"
+export CXXFLAGS+=" -DTIZEN_EXCLUDE_COVERAG -fprofile-arcs -ftest-coverage"
+export FFLAGS+=" -DTIZEN_EXCLUDE_COVERAGE -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
 mkdir -p %{buildroot}%{_bindir}
 cp test/video_util_test %{buildroot}%{_bindir}
+%if 0%{?gcov:1}
+mkdir -p %{buildroot}%{_datadir}/gcov/obj
+install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+%endif
 
 %post
 
@@ -61,3 +84,7 @@ cp test/video_util_test %{buildroot}%{_bindir}
 %{_libdir}/pkgconfig/*.pc
 %{_includedir}/media/*.h
 
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif