diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2022-06-09 09:41:01 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2022-06-09 09:41:01 +0900 |
commit | 3a05784b7e8d34555b631ec3ca2fc9d67d609fd2 (patch) | |
tree | 18f3f34a805a4525089818fa14b58f95645e3a59 | |
parent | add328b06e622f936b82dd6ea637150d39465b9e (diff) | |
download | libslp-db-util-3a05784b7e8d34555b631ec3ca2fc9d67d609fd2.tar.gz libslp-db-util-3a05784b7e8d34555b631ec3ca2fc9d67d609fd2.tar.bz2 libslp-db-util-3a05784b7e8d34555b631ec3ca2fc9d67d609fd2.zip |
feat: Create unittests packagetizen_8.0_m2_releasetizen_7.0_m2_releasesubmit/tizen/20220617.014556submit/tizen/20220614.074332submit/tizen/20220609.004957accepted/tizen/unified/20220620.131739accepted/tizen/unified/20220620.030039accepted/tizen/8.0/unified/20231005.093043accepted/tizen/7.0/unified/hotfix/20221116.105025accepted/tizen/7.0/unified/20221110.063651tizen_8.0tizen_7.0_hotfixtizen_7.0accepted/tizen_8.0_unifiedaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unified
- Create unittests package
Change-Id: I8e6b90951393778f4630457210523d85e0ea089a
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | packaging/libslp-db-util.spec | 42 |
2 files changed, 40 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f12f9e1..20c79b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,4 @@ INSTALL(FILES ${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) FILE(GLOB HEADERS include/*.h) INSTALL(FILES ${HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}) -IF(BUILD_GCOV) - ADD_SUBDIRECTORY(tests) -ENDIF() +ADD_SUBDIRECTORY(tests) diff --git a/packaging/libslp-db-util.spec b/packaging/libslp-db-util.spec index a5273ac..8953422 100644 --- a/packaging/libslp-db-util.spec +++ b/packaging/libslp-db-util.spec @@ -12,11 +12,10 @@ BuildRequires: pkgconfig(glib-2.0) 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 @@ -31,11 +30,15 @@ Devel package for libslp-db-util (devel) %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 @@ -63,6 +66,35 @@ mkdir -p "$gcno_obj_dir" 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 @@ -91,3 +123,7 @@ genhtml %{name}.info -o out --legend --show-details %files gcov %{_datadir}/gcov/* %endif + +%files unittests +%{_bindir}/db-util-gtest +%{_bindir}/tizen-unittests/%{name}/run-unittest.sh |