From: Youngjae Shin Date: Thu, 12 Mar 2020 08:33:05 +0000 (+0900) Subject: revise spec file for analyzing coverage X-Git-Tag: submit/tizen/20200319.043412~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7149b6e790830b0a13fcefd2a55f649044535748;p=platform%2Fcore%2Fsystem%2Fmodes.git revise spec file for analyzing coverage --- diff --git a/packaging/modes.spec b/packaging/modes.spec index 3ee23a7..a055c3a 100644 --- a/packaging/modes.spec +++ b/packaging/modes.spec @@ -20,6 +20,9 @@ BuildRequires: pkgconfig(gmock) BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(cynara-creds-gdbus) BuildRequires: pkgconfig(cynara-session) +%if 0%{?gcov:1} +BuildRequires: lcov +%endif %description The modes(Mode Supervisor) manages configurations which is described at a mode. @@ -58,6 +61,15 @@ Group: System/Testing %description unittests The %{name}-unittests pacakge contains programs for checking quality the %{name}. +%if 0%{?gcov:1} +%package gcov +Summary: Coverage Data of %{name} +Group: System/Testing + +%description gcov +The %{name}-gcov pacakge contains gcov objects +%endif + %define _dbus_interface org.tizen.%{name}.dbus %define modes_plugin_dir %{_libdir}/modes-plugins %define modes_ro_dir %{_datadir}/%{name} @@ -95,6 +107,11 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -DSTDOUT_LOG=%{?stdlog:1}%{!?stdlog:0} make %{?_smp_mflags} +%if 0%{?gcov:1} +mkdir -p gcov-obj +#find . -name '*.gcno' -exec cp '{}' gcov-obj ';' +%endif + %install %make_install install -d -m 755 %{buildroot}%{modes_ro_dir}/mode @@ -108,11 +125,22 @@ install -m 0755 unittest/modes-gtest-run.sh %{buildroot}%{modes_test_dir}/ %install_service multi-user.target.wants %{name}.path +%if 0%{?gcov:1} +mkdir -p %{buildroot}%{_datadir}/gcov/obj +#install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj +%endif + %check xmllint --noout --schema schema/tizen_mode.xsd example/mode/tizen_*_mode.xml xmllint --noout --schema schema/tizen_action_rule.xsd plugin/tizen_test_rule.xml xmllint --noout --schema schema/tizen_action_rule.xsd example/rule/tizen_*_rule.xml bash ./unittest/modes-gtest-run.sh %{buildroot}%{modes_ro_dir} %{buildroot}%{modes_test_dir} Building +%if 0%{?gcov:1} +lcov -c --ignore-errors graph --no-external -d . -o %{name}.info +genhtml ./%{name}.info -o ./out --legend --show-details +install -m 0644 %{name}.info %{buildroot}%{_datadir}/gcov/ +%endif + %post /sbin/ldconfig @@ -174,3 +202,8 @@ systemctl try-restart %{name}.service %{modes_ro_dir}/rule/* %{modes_test_dir}/*.xml %license LICENSE.APLv2 + +%if 0%{?gcov:1} +%files gcov +%{_datadir}/gcov/* +%endif