spec: make a gcov package for measuring coverage easier 27/209427/1 accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20191031.020128 accepted/tizen/5.5/unified/mobile/hotfix/20201027.075937 accepted/tizen/5.5/unified/wearable/hotfix/20201027.111007 accepted/tizen/unified/20190711.062834 submit/tizen/20190710.050854 submit/tizen_5.5/20191031.000005 submit/tizen_5.5_mobile_hotfix/20201026.185105 submit/tizen_5.5_wearable_hotfix/20201026.184305 tizen_5.5.m2_release
authorJongmin Lee <jm105.lee@samsung.com>
Mon, 8 Jul 2019 00:38:04 +0000 (09:38 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Mon, 8 Jul 2019 00:38:04 +0000 (09:38 +0900)
Change-Id: I0654bb0eec387278703ee3d685341b2ffc5324fc

packaging/ui-viewmgr.spec

index 4ea5027a9627f953a87e4fd4bfcf6fe2e85b8076..739a4f0f2671f8ceb5dc97d8a77f19fe91adb094 100644 (file)
@@ -15,6 +15,9 @@ BuildRequires:  efl-extension-devel
 BuildRequires:  cmake
 BuildRequires:  edje-bin
 BuildRequires:  gettext-tools
+%if 0%{?gcov:1}
+BuildRequires:  lcov
+%endif
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 
@@ -37,10 +40,24 @@ Requires:   capi-base-common-devel
 %description devel
 UI VIEW MANAGER library providing View management functionality(devel)
 
+%if 0%{?gcov:1}
+%package gcov
+Summary:    UI VIEW MANAGER library (gcov)
+Group:      Graphics & UI Framework/Testing
+%description gcov
+UI VIEW MANAGER library gcov objects
+%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 "%{?target_language}" == "c++"
     %cmake . -DTARGET_LANGUAGE="c++"
@@ -50,10 +67,20 @@ UI VIEW MANAGER library providing View management functionality(devel)
 
 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
 
 %postun -p /sbin/ldconfig
@@ -82,3 +109,8 @@ rm -rf %{buildroot}
 %{_includedir}/ui-viewmgr/efl/mobile/c/*.h
 %{_libdir}/*.so
 %{_libdir}/pkgconfig/ui-viewmgr.pc
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif