summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2019-07-02 14:29:24 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2019-07-02 14:42:26 +0900
commitd1fd260f4e1c746a428539cc6707454cf6a82530 (patch)
tree73fcf338eea278bbbb21e4e9bb89f615ce8d4500 /packaging
parentd1e836a38e1f2686cd4bf2942932c0247eaaa770 (diff)
downloadcamera-d1fd260f4e1c746a428539cc6707454cf6a82530.tar.gz
camera-d1fd260f4e1c746a428539cc6707454cf6a82530.tar.bz2
camera-d1fd260f4e1c746a428539cc6707454cf6a82530.zip
Make a gcov package for measuring coverage easier
[Version] 0.4.25-1 [Issue Type] Update Change-Id: I71ad9cd77f1ce1622013591406e8983a04d33cd9 Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
Diffstat (limited to 'packaging')
-rw-r--r--packaging/capi-media-camera.spec28
1 files changed, 27 insertions, 1 deletions
diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec
index 54283d3..4c05fb7 100644
--- a/packaging/capi-media-camera.spec
+++ b/packaging/capi-media-camera.spec
@@ -1,7 +1,7 @@
Name: capi-media-camera
Summary: A Camera API
Version: 0.4.25
-Release: 0
+Release: 1
Group: Multimedia/API
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
@@ -45,6 +45,15 @@ Requires: %{name} = %{version}-%{release}
%description tool
Tizen Native camera API testsuite.
+%if 0%{?gcov:1}
+%package gcov
+Summary: Line Coverage of Camera library in Tizen Native API
+Group: Development/Multimedia
+
+%description gcov
+Collection of files related to Line Coverage. It is teseted as gcov for a camera library in Tizen native API
+%endif
+
%prep
%setup -q
@@ -54,16 +63,28 @@ Tizen Native camera API testsuite.
%if 0%{?sec_build_binary_debug_enable}
export CFLAGS+=" -DTIZEN_DEBUG_ENABLE"
%endif
+%if 0%{?gcov:1}
+export CFLAGS+=" -fprofile-arcs -ftest-coverage"
+export LDFLAGS+=" -lgcov"
+%endif
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -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
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
%post -p /sbin/ldconfig
@@ -87,3 +108,8 @@ rm -rf %{buildroot}
%license LICENSE.APLv2
%{_bindir}/*
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif
+