From: mk5004.lee Date: Fri, 10 Jul 2020 05:36:09 +0000 (+0900) Subject: Apply gcov ON build X-Git-Tag: accepted/tizen/unified/20200713.094500~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F62%2F238262%2F2;p=platform%2Fcore%2Fapi%2Fnotification.git Apply gcov ON build Change-Id: Iec33ef377ddf51302db5fc53f18ea64aabf20741 Signed-off-by: mk5004.lee --- diff --git a/packaging/notification.spec b/packaging/notification.spec index e2f4b09..c385c48 100644 --- a/packaging/notification.spec +++ b/packaging/notification.spec @@ -24,6 +24,11 @@ BuildRequires: pkgconfig(libsmack) BuildRequires: pkgconfig(gmock) BuildRequires: pkgconfig(uuid) +%if 0%{?gcov:1} +BuildRequires: lcov +BuildRequires: zip +%endif + BuildRequires: cmake Requires(post): /sbin/ldconfig Requires(post): %{TZ_SYS_BIN}/sqlite3 @@ -75,6 +80,12 @@ find . -name '*.gcno' -exec cp '{}' gcov-obj ';' %check ctest --output-on-failure %{?_smp_mflags} +%if 0%{?gcov:1} +lcov -c --ignore-errors graph --no-external -q -d . -o notification-ex.info +genhtml notification-ex.info -o notification-ex.out +zip -r notification-ex.zip notification-ex.out +install -m 0644 notification-ex.zip %{buildroot}%{_datadir}/gcov/notification-ex.zip +%endif %install rm -rf %{buildroot} @@ -135,8 +146,6 @@ fi %{_libdir}/pkgconfig/notification.pc %{_libdir}/libnotification.so - - ################################################# # notification-ex ################################################# @@ -171,7 +180,6 @@ Header & package configuration files to support development of the notification. %{_libdir}/pkgconfig/notification-ex.pc %attr(0644,root,root) %{_libdir}/libnotification-ex.so - ################################################# # notification-ex_unittests ################################################# @@ -187,5 +195,5 @@ GTest for notification-ex %if 0%{?gcov:1} %files gcov -%{_datadir}/gcov/obj/* +%{_datadir}/gcov/* %endif diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index 93823e7..afbc3ba 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -22,15 +22,15 @@ SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") SET(CMAKE_CXX_FLAGS_RELEASE "-O2") INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR}/../notification-ex - ${CMAKE_CURRENT_SOURCE_DIR}/../notification-ex/api - ${CMAKE_CURRENT_SOURCE_DIR}/../mock - ${CMAKE_CURRENT_SOURCE_DIR}/../ + ${CMAKE_SOURCE_DIR}/notification-ex + ${CMAKE_SOURCE_DIR}/notification-ex/api + ${CMAKE_SOURCE_DIR}/mock + ${CMAKE_SOURCE_DIR}/ ) AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCES) -AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../mock MOCK_SOURCES) -AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../notification-ex NOTIFICATION_EX_SOURCES) +AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/mock MOCK_SOURCES) +AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/notification-ex NOTIFICATION_EX_SOURCES) ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES} ${NOTIFICATION_EX_SOURCES} diff --git a/unittest/src/test_main.cc b/unittest/src/test_main.cc index 4be05dc..ad7ec6c 100644 --- a/unittest/src/test_main.cc +++ b/unittest/src/test_main.cc @@ -17,9 +17,9 @@ #include #include -int main(int argc, char** argv){ +int main(int argc, char** argv) { int ret = -1; - setenv("GCOV_PREFIX", "/tmp/", 1); + try { testing::InitGoogleTest(&argc, argv); } catch(...) { diff --git a/unittest/src/test_abstract_item.cc b/unittest/src/test_noti_ex_abstract_item.cc similarity index 100% rename from unittest/src/test_abstract_item.cc rename to unittest/src/test_noti_ex_abstract_item.cc diff --git a/unittest/src/test_app_control_action.cc b/unittest/src/test_noti_ex_app_control_action.cc similarity index 100% rename from unittest/src/test_app_control_action.cc rename to unittest/src/test_noti_ex_app_control_action.cc diff --git a/unittest/src/test_button_item.cc b/unittest/src/test_noti_ex_button_item.cc similarity index 100% rename from unittest/src/test_button_item.cc rename to unittest/src/test_noti_ex_button_item.cc diff --git a/unittest/src/test_chat_message_item.cc b/unittest/src/test_noti_ex_chat_message_item.cc similarity index 100% rename from unittest/src/test_chat_message_item.cc rename to unittest/src/test_noti_ex_chat_message_item.cc diff --git a/unittest/src/test_checkbox_item.cc b/unittest/src/test_noti_ex_checkbox_item.cc similarity index 100% rename from unittest/src/test_checkbox_item.cc rename to unittest/src/test_noti_ex_checkbox_item.cc diff --git a/unittest/src/test_entry_item.cc b/unittest/src/test_noti_ex_entry_item.cc similarity index 100% rename from unittest/src/test_entry_item.cc rename to unittest/src/test_noti_ex_entry_item.cc diff --git a/unittest/src/test_event_info.cc b/unittest/src/test_noti_ex_event_info.cc similarity index 100% rename from unittest/src/test_event_info.cc rename to unittest/src/test_noti_ex_event_info.cc diff --git a/unittest/src/test_group_item.cc b/unittest/src/test_noti_ex_group_item.cc old mode 100755 new mode 100644 similarity index 100% rename from unittest/src/test_group_item.cc rename to unittest/src/test_noti_ex_group_item.cc diff --git a/unittest/src/test_icon_item.cc b/unittest/src/test_noti_ex_icon_item.cc similarity index 100% rename from unittest/src/test_icon_item.cc rename to unittest/src/test_noti_ex_icon_item.cc diff --git a/unittest/src/test_image_item.cc b/unittest/src/test_noti_ex_image_item.cc similarity index 100% rename from unittest/src/test_image_item.cc rename to unittest/src/test_noti_ex_image_item.cc diff --git a/unittest/src/test_input_selector_item.cc b/unittest/src/test_noti_ex_input_selector_item.cc similarity index 100% rename from unittest/src/test_input_selector_item.cc rename to unittest/src/test_noti_ex_input_selector_item.cc diff --git a/unittest/src/test_progress_item.cc b/unittest/src/test_noti_ex_progress_item.cc similarity index 100% rename from unittest/src/test_progress_item.cc rename to unittest/src/test_noti_ex_progress_item.cc diff --git a/unittest/src/test_shared_file.cc b/unittest/src/test_noti_ex_shared_file.cc old mode 100755 new mode 100644 similarity index 100% rename from unittest/src/test_shared_file.cc rename to unittest/src/test_noti_ex_shared_file.cc diff --git a/unittest/src/test_text_item.cc b/unittest/src/test_noti_ex_text_item.cc similarity index 100% rename from unittest/src/test_text_item.cc rename to unittest/src/test_noti_ex_text_item.cc diff --git a/unittest/src/test_time_item.cc b/unittest/src/test_noti_ex_time_item.cc similarity index 100% rename from unittest/src/test_time_item.cc rename to unittest/src/test_noti_ex_time_item.cc diff --git a/unittest/src/test_visibility_action.cc b/unittest/src/test_noti_ex_visibility_action.cc similarity index 100% rename from unittest/src/test_visibility_action.cc rename to unittest/src/test_noti_ex_visibility_action.cc