FILE(GLOB HEADERS include/*.h)
INSTALL(FILES ${HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME})
-IF(BUILD_GCOV)
- ADD_SUBDIRECTORY(tests)
-ENDIF()
+ADD_SUBDIRECTORY(tests)
BuildRequires: pkgconfig(icu-i18n)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(vconf)
+BuildRequires: gtest-devel
%if 0%{?gcov:1}
-BuildRequires: gtest-devel
BuildRequires: lcov
-BuildRequires: tar
%endif
%description
%if 0%{?gcov:1}
%package gcov
Summary: DB Utility(gcov)
-Group: Application Framework/Database
%description gcov
libslp-db-util gcov objects
%endif
+%package unittests
+Summary: %{name} unittests binary
+%description unittests
+unittests binary
+
%prep
%setup -q
cp %{SOURCE1001} ./%{name}.manifest
find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';'
%endif
+cat << EOF > run-unittest.sh
+#!/bin/sh
+setup() {
+ echo "setup start"
+}
+
+test_main() {
+ echo "test_main start"
+ /usr/bin/db-util-gtest
+}
+
+teardown() {
+ echo "teardown start"
+}
+
+main() {
+ setup
+ test_main
+ teardown
+}
+
+main "\$*"
+EOF
+
+mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}
+install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}/
+install -m 0755 ./tests/db-util-gtest %{buildroot}%{_bindir}
+
+
%check
%if 0%{?gcov:1}
pushd tests
%files gcov
%{_datadir}/gcov/*
%endif
+
+%files unittests
+%{_bindir}/db-util-gtest
+%{_bindir}/tizen-unittests/%{name}/run-unittest.sh