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.
%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}
-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
%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
%{modes_ro_dir}/rule/*
%{modes_test_dir}/*.xml
%license LICENSE.APLv2
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/*
+%endif