summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormk5004.lee <mk5004.lee@samsung.com>2020-07-10 14:36:09 +0900
committermk5004.lee <mk5004.lee@samsung.com>2020-07-10 15:00:42 +0900
commitaaa5d3ad1aafe72d2ee3d8d64ff8dc0a3fdc441e (patch)
treeab2483087c7e12cbd5714818615dfd43e3fbc5cb
parentcbe7ad85c594bb4cf8d0286e8a3a4a090c552b60 (diff)
downloadnotification-aaa5d3ad1aafe72d2ee3d8d64ff8dc0a3fdc441e.tar.gz
notification-aaa5d3ad1aafe72d2ee3d8d64ff8dc0a3fdc441e.tar.bz2
notification-aaa5d3ad1aafe72d2ee3d8d64ff8dc0a3fdc441e.zip
Apply gcov ON build
Change-Id: Iec33ef377ddf51302db5fc53f18ea64aabf20741 Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
-rw-r--r--packaging/notification.spec16
-rw-r--r--unittest/CMakeLists.txt12
-rw-r--r--unittest/src/test_main.cc4
-rw-r--r--unittest/src/test_noti_ex_abstract_item.cc (renamed from unittest/src/test_abstract_item.cc)0
-rw-r--r--unittest/src/test_noti_ex_app_control_action.cc (renamed from unittest/src/test_app_control_action.cc)0
-rw-r--r--unittest/src/test_noti_ex_button_item.cc (renamed from unittest/src/test_button_item.cc)0
-rw-r--r--unittest/src/test_noti_ex_chat_message_item.cc (renamed from unittest/src/test_chat_message_item.cc)0
-rw-r--r--unittest/src/test_noti_ex_checkbox_item.cc (renamed from unittest/src/test_checkbox_item.cc)0
-rw-r--r--unittest/src/test_noti_ex_entry_item.cc (renamed from unittest/src/test_entry_item.cc)0
-rw-r--r--unittest/src/test_noti_ex_event_info.cc (renamed from unittest/src/test_event_info.cc)0
-rw-r--r--[-rwxr-xr-x]unittest/src/test_noti_ex_group_item.cc (renamed from unittest/src/test_group_item.cc)0
-rw-r--r--unittest/src/test_noti_ex_icon_item.cc (renamed from unittest/src/test_icon_item.cc)0
-rw-r--r--unittest/src/test_noti_ex_image_item.cc (renamed from unittest/src/test_image_item.cc)0
-rw-r--r--unittest/src/test_noti_ex_input_selector_item.cc (renamed from unittest/src/test_input_selector_item.cc)0
-rw-r--r--unittest/src/test_noti_ex_progress_item.cc (renamed from unittest/src/test_progress_item.cc)0
-rw-r--r--[-rwxr-xr-x]unittest/src/test_noti_ex_shared_file.cc (renamed from unittest/src/test_shared_file.cc)0
-rw-r--r--unittest/src/test_noti_ex_text_item.cc (renamed from unittest/src/test_text_item.cc)0
-rw-r--r--unittest/src/test_noti_ex_time_item.cc (renamed from unittest/src/test_time_item.cc)0
-rw-r--r--unittest/src/test_noti_ex_visibility_action.cc (renamed from unittest/src/test_visibility_action.cc)0
19 files changed, 20 insertions, 12 deletions
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 <gtest/gtest.h>
#include <gmock/gmock.h>
-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
index ef3650e..ef3650e 100644
--- a/unittest/src/test_abstract_item.cc
+++ b/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
index 7b49c60..7b49c60 100644
--- a/unittest/src/test_app_control_action.cc
+++ b/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
index dc14b30..dc14b30 100644
--- a/unittest/src/test_button_item.cc
+++ b/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
index cde985a..cde985a 100644
--- a/unittest/src/test_chat_message_item.cc
+++ b/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
index eba55a7..eba55a7 100644
--- a/unittest/src/test_checkbox_item.cc
+++ b/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
index 76b0006..76b0006 100644
--- a/unittest/src/test_entry_item.cc
+++ b/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
index e478c44..e478c44 100644
--- a/unittest/src/test_event_info.cc
+++ b/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
index 8cf8c79..8cf8c79 100755..100644
--- a/unittest/src/test_group_item.cc
+++ b/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
index 98ff517..98ff517 100644
--- a/unittest/src/test_icon_item.cc
+++ b/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
index 66c6786..66c6786 100644
--- a/unittest/src/test_image_item.cc
+++ b/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
index 862cfc5..862cfc5 100644
--- a/unittest/src/test_input_selector_item.cc
+++ b/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
index 3b34c82..3b34c82 100644
--- a/unittest/src/test_progress_item.cc
+++ b/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
index 1a09b7d..1a09b7d 100755..100644
--- a/unittest/src/test_shared_file.cc
+++ b/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
index 1921567..1921567 100644
--- a/unittest/src/test_text_item.cc
+++ b/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
index 96e8e74..96e8e74 100644
--- a/unittest/src/test_time_item.cc
+++ b/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
index e231b36..e231b36 100644
--- a/unittest/src/test_visibility_action.cc
+++ b/unittest/src/test_noti_ex_visibility_action.cc