Add for line coverage 68/208968/1
authorMinje Ahn <minje.ahn@samsung.com>
Mon, 1 Jul 2019 23:10:46 +0000 (08:10 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Mon, 1 Jul 2019 23:10:46 +0000 (08:10 +0900)
Change-Id: Ie88b4e2f9129f60e0c7303d0b11d6f4767dc4c69
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
packaging/capi-content-media-content.spec

index d550bae4de6bc883396fd2b5055db99903d5a69f..753f5a6d53f0d9fe612a53e3db5f7cee6cac8bc1 100755 (executable)
@@ -17,6 +17,10 @@ BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(storage)
 BuildRequires:  pkgconfig(sqlite3)
+%if 0%{?gcov:1}
+BuildRequires: lcov
+BuildRequires: zip
+%endif
 
 %description
 A Media content library in Tizen Native API.
@@ -30,6 +34,15 @@ Requires: %{name} = %{version}-%{release}
 A Media content library in Tizen Native API. (Development file included)
 %devel_desc
 
+%if 0%{?gcov:1}
+%package gcov
+Summary: Line Coverage of Media Content library in Tizen C API
+Group: Development/Multimedia
+
+%description gcov
+Collection of files related to Line Coverage. It is teseted as gcov for a media content library in Tizen native API
+%endif
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
@@ -51,9 +64,28 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 
 %__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
+
+%check
+ctest --output-on-failure %{?_smp_mflags}
+%if 0%{?gcov:1}
+lcov -c --ignore-errors graph --no-external -q -d . -o media-content.info
+genhtml media-content.info -o media-content.out
+zip -r media-content.zip media-content.out media-content.info
+install -m 0644 media-content.zip %{buildroot}%{_datadir}/gcov/
+%endif
+
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
@@ -65,6 +97,11 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 #License
 %license LICENSE.APLv2.0
 
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif
+
 %files devel
 %manifest %{name}.manifest
 %{_includedir}/media-content/*.h