summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSukhyungKang <shine.kang@samsung.com>2023-09-27 11:13:46 +0900
committerSukhyungKang <shine.kang@samsung.com>2023-11-13 09:36:06 +0900
commitc220db4df0bb89d9a6ace05dbd86b71aae099f76 (patch)
treed8a395f024bdaba7aeb9aef9a3a461a1a7294f6b
parent364c4996ebbd7a73dc33281616c45ea3d3180278 (diff)
downloadnotification-c220db4df0bb89d9a6ace05dbd86b71aae099f76.tar.gz
notification-c220db4df0bb89d9a6ace05dbd86b71aae099f76.tar.bz2
notification-c220db4df0bb89d9a6ace05dbd86b71aae099f76.zip
move notification ex unittest to notification unittest
Change-Id: I55d49671d5255a350396df228d7b85fa47dd8933 Signed-off-by: SukhyungKang <shine.kang@samsung.com>
-rw-r--r--CMakeLists.txt3
-rw-r--r--packaging/notification.spec20
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/noti_ex_unittest/CMakeLists.txt50
-rw-r--r--tests/noti_ex_unittest/src/test_main.cc37
-rw-r--r--tests/noti_unittest/CMakeLists.txt7
-rw-r--r--tests/noti_unittest/src/test_noti_ex_abstract_item.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_abstract_item.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_app_control_action.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_app_control_action.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_button_item.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_button_item.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_chat_message_item.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_chat_message_item.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_checkbox_item.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_checkbox_item.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_entry_item.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_entry_item.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_event_info.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_event_info.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_group_item.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_group_item.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_icon_item.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_icon_item.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_image_item.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_image_item.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_input_selector_item.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_input_selector_item.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_progress_item.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_progress_item.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_shared_file.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_shared_file.cc)4
-rw-r--r--tests/noti_unittest/src/test_noti_ex_text_item.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_text_item.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_time_item.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_time_item.cc)0
-rw-r--r--tests/noti_unittest/src/test_noti_ex_visibility_action.cc (renamed from tests/noti_ex_unittest/src/test_noti_ex_visibility_action.cc)0
22 files changed, 9 insertions, 113 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0c0fea1..c07856c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,9 +5,6 @@ ADD_SUBDIRECTORY(notification-ex)
ADD_SUBDIRECTORY(tests)
ENABLE_TESTING()
-SET(NOTIFICATION_EX_UNIT_TESTS notification-ex-unittests)
-ADD_TEST(NAME ${NOTIFICATION_EX_UNIT_TESTS} COMMAND ${NOTIFICATION_EX_UNIT_TESTS})
-ADD_DEPENDENCIES(${NOTIFICATION_EX_UNIT_TESTS} notification-ex)
SET(NOTIFICATION_UNIT_TESTS notification-unittests)
ADD_TEST(NAME ${NOTIFICATION_UNIT_TESTS} COMMAND ${NOTIFICATION_UNIT_TESTS})
diff --git a/packaging/notification.spec b/packaging/notification.spec
index f1ad08d..6edb49a 100644
--- a/packaging/notification.spec
+++ b/packaging/notification.spec
@@ -121,10 +121,6 @@ mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}
install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}/
sed -i -e 's/<NAME>/notification/g' %{buildroot}%{_bindir}/tizen-unittests/%{name}/run-unittest.sh
-mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}-ex
-install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}-ex/
-sed -i -e 's/<NAME>/notification-ex/g' %{buildroot}%{_bindir}/tizen-unittests/%{name}-ex/run-unittest.sh
-
mkdir -p %{buildroot}%{upgrade_script_path}
cp -f scripts/505.notification_upgrade.sh %{buildroot}%{upgrade_script_path}
@@ -210,20 +206,6 @@ Header & package configuration files to support development of the notification.
%attr(0644,root,root) %{_libdir}/libnotification-ex.so
#################################################
-# notification-ex-unittests
-#################################################
-%package -n notification-ex-unittests
-Summary: GTest for notification-ex
-Group: Development/Libraries
-
-%description -n notification-ex-unittests
-GTest for notification-ex
-
-%files -n notification-ex-unittests
-%{_bindir}/notification-ex-unittests
-%{_bindir}/tizen-unittests/%{name}/run-unittest.sh
-
-#################################################
# notification-unittests
#################################################
%package -n notification-unittests
@@ -235,7 +217,7 @@ GTest for notification
%files -n notification-unittests
%{_bindir}/notification-unittests
-%{_bindir}/tizen-unittests/%{name}-ex/run-unittest.sh
+%{_bindir}/tizen-unittests/%{name}/run-unittest.sh
%if 0%{?gcov:1}
%files gcov
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 5e5460b..00bcdf9 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,2 +1 @@
ADD_SUBDIRECTORY(noti_unittest)
-ADD_SUBDIRECTORY(noti_ex_unittest)
diff --git a/tests/noti_ex_unittest/CMakeLists.txt b/tests/noti_ex_unittest/CMakeLists.txt
deleted file mode 100644
index 5ff9faa..0000000
--- a/tests/noti_ex_unittest/CMakeLists.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-PROJECT(notification-ex-unittests CXX)
-
-INCLUDE(FindPkgConfig)
-PKG_CHECK_MODULES(notification-ex-unittests REQUIRED
- dlog
- gmock
- capi-appfw-app-control
- glib-2.0
- gio-2.0
- gio-unix-2.0
- aul
- security-manager
- libtzplatform-config
-)
-
-FOREACH(flag ${notification-ex-unittests_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall")
-
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
-SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
-SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_SOURCE_DIR}/
- ${CMAKE_SOURCE_DIR}/notification-ex/
- ${CMAKE_SOURCE_DIR}/notification-ex/api
- ${CMAKE_CURRENT_SOURCE_DIR}/../
- ${CMAKE_CURRENT_SOURCE_DIR}/../mock
-)
-
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCES)
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../mock MOCK_SOURCES)
-AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/notification-ex NOTIFICATION_EX_SOURCES)
-ADD_EXECUTABLE(${PROJECT_NAME}
- ${SOURCES}
- ${NOTIFICATION_EX_SOURCES}
- ${MOCK_SOURCES}
-)
-
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${notification-ex-unittests_LDFLAGS}
- ${pkgs_LDFLAGS}
- ${pkgs_LIBRARIES}
- gmock
- notification-ex
-)
-
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin/)
diff --git a/tests/noti_ex_unittest/src/test_main.cc b/tests/noti_ex_unittest/src/test_main.cc
deleted file mode 100644
index ad7ec6c..0000000
--- a/tests/noti_ex_unittest/src/test_main.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-
-int main(int argc, char** argv) {
- int ret = -1;
-
- try {
- testing::InitGoogleTest(&argc, argv);
- } catch(...) {
- std::cout << "Exception occurred" << std::endl;
- }
-
- try {
- ret = RUN_ALL_TESTS();
- } catch (const ::testing::internal::GoogleTestFailureException& e) {
- ret = -1;
- std::cout << "GoogleTestFailureException was thrown:" << e.what() << std::endl;
- }
-
- return ret;
-}
diff --git a/tests/noti_unittest/CMakeLists.txt b/tests/noti_unittest/CMakeLists.txt
index 79b786f..81a955c 100644
--- a/tests/noti_unittest/CMakeLists.txt
+++ b/tests/noti_unittest/CMakeLists.txt
@@ -27,22 +27,26 @@ SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
SET(INIT-SRCS ${CMAKE_SOURCE_DIR}/notification/src/notification_init.c)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/notification-ex/)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/notification-ex/api)
+
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/notification/src)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/notification/include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../mock)
-
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCES)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../mock MOCK_SOURCES)
AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/notification/src NOTIFICATION_SOURCES)
+AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/notification-ex NOTIFICATION_EX_SOURCES)
LIST(REMOVE_ITEM NOTIFICATION_SOURCES ${INIT-SRCS})
ADD_EXECUTABLE(${PROJECT_NAME}
${SOURCES}
${NOTIFICATION_SOURCES}
+ ${NOTIFICATION_EX_SOURCES}
${MOCK_SOURCES}
)
@@ -52,6 +56,7 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${notification-unittests_LDFLAGS}
${pkgs_LIBRARIES}
gmock
notification
+ notification-ex
)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin/)
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_abstract_item.cc b/tests/noti_unittest/src/test_noti_ex_abstract_item.cc
index 3d1549a..3d1549a 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_abstract_item.cc
+++ b/tests/noti_unittest/src/test_noti_ex_abstract_item.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_app_control_action.cc b/tests/noti_unittest/src/test_noti_ex_app_control_action.cc
index 70f53e1..70f53e1 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_app_control_action.cc
+++ b/tests/noti_unittest/src/test_noti_ex_app_control_action.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_button_item.cc b/tests/noti_unittest/src/test_noti_ex_button_item.cc
index 5ef0c11..5ef0c11 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_button_item.cc
+++ b/tests/noti_unittest/src/test_noti_ex_button_item.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_chat_message_item.cc b/tests/noti_unittest/src/test_noti_ex_chat_message_item.cc
index aa0f9fb..aa0f9fb 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_chat_message_item.cc
+++ b/tests/noti_unittest/src/test_noti_ex_chat_message_item.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_checkbox_item.cc b/tests/noti_unittest/src/test_noti_ex_checkbox_item.cc
index e27f192..e27f192 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_checkbox_item.cc
+++ b/tests/noti_unittest/src/test_noti_ex_checkbox_item.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_entry_item.cc b/tests/noti_unittest/src/test_noti_ex_entry_item.cc
index 6234c44..6234c44 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_entry_item.cc
+++ b/tests/noti_unittest/src/test_noti_ex_entry_item.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_event_info.cc b/tests/noti_unittest/src/test_noti_ex_event_info.cc
index d117d19..d117d19 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_event_info.cc
+++ b/tests/noti_unittest/src/test_noti_ex_event_info.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_group_item.cc b/tests/noti_unittest/src/test_noti_ex_group_item.cc
index e00ae1f..e00ae1f 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_group_item.cc
+++ b/tests/noti_unittest/src/test_noti_ex_group_item.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_icon_item.cc b/tests/noti_unittest/src/test_noti_ex_icon_item.cc
index 0ca4010..0ca4010 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_icon_item.cc
+++ b/tests/noti_unittest/src/test_noti_ex_icon_item.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_image_item.cc b/tests/noti_unittest/src/test_noti_ex_image_item.cc
index 0aeb77e..0aeb77e 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_image_item.cc
+++ b/tests/noti_unittest/src/test_noti_ex_image_item.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_input_selector_item.cc b/tests/noti_unittest/src/test_noti_ex_input_selector_item.cc
index e8b2669..e8b2669 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_input_selector_item.cc
+++ b/tests/noti_unittest/src/test_noti_ex_input_selector_item.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_progress_item.cc b/tests/noti_unittest/src/test_noti_ex_progress_item.cc
index 0328ef3..0328ef3 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_progress_item.cc
+++ b/tests/noti_unittest/src/test_noti_ex_progress_item.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_shared_file.cc b/tests/noti_unittest/src/test_noti_ex_shared_file.cc
index 2fe9684..5bb98aa 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_shared_file.cc
+++ b/tests/noti_unittest/src/test_noti_ex_shared_file.cc
@@ -93,7 +93,7 @@ class SharedFileTest : public TestFixture {
virtual void SetUp() {
item = make_shared<ImageItem>(id, image_path);
shared_file = new SharedFile();
- item->SetSenderAppId("notification-ex-unittests");
+ item->SetSenderAppId("notification-unittests");
}
virtual void TearDown() {
@@ -112,7 +112,7 @@ TEST_F(SharedFileTest, GetDataPath) {
.WillRepeatedly(Invoke(__fake_tzplatform_getenv));
ASSERT_EQ(shared_file->GetDataPath(item->GetSenderAppId(), SharedFileTest::image_path),
- "/opt/usr/home/owner/apps_rw/notification-ex-unittests/data/.notification_ex/image.png");
+ "/opt/usr/home/owner/apps_rw/notification-unittests/data/.notification_ex/image.png");
}
TEST_F(SharedFileTest, SetPrivateSharing) {
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_text_item.cc b/tests/noti_unittest/src/test_noti_ex_text_item.cc
index 744a230..744a230 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_text_item.cc
+++ b/tests/noti_unittest/src/test_noti_ex_text_item.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_time_item.cc b/tests/noti_unittest/src/test_noti_ex_time_item.cc
index 94edabe..94edabe 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_time_item.cc
+++ b/tests/noti_unittest/src/test_noti_ex_time_item.cc
diff --git a/tests/noti_ex_unittest/src/test_noti_ex_visibility_action.cc b/tests/noti_unittest/src/test_noti_ex_visibility_action.cc
index d56e26d..d56e26d 100644
--- a/tests/noti_ex_unittest/src/test_noti_ex_visibility_action.cc
+++ b/tests/noti_unittest/src/test_noti_ex_visibility_action.cc