move notification ex unittest to notification unittest 76/299376/2
authorSukhyungKang <shine.kang@samsung.com>
Wed, 27 Sep 2023 02:13:46 +0000 (11:13 +0900)
committerSukhyungKang <shine.kang@samsung.com>
Wed, 27 Sep 2023 02:15:46 +0000 (11:15 +0900)
Change-Id: I55d49671d5255a350396df228d7b85fa47dd8933
Signed-off-by: SukhyungKang <shine.kang@samsung.com>
22 files changed:
CMakeLists.txt
packaging/notification.spec
tests/CMakeLists.txt
tests/noti_ex_unittest/CMakeLists.txt [deleted file]
tests/noti_ex_unittest/src/test_main.cc [deleted file]
tests/noti_unittest/CMakeLists.txt
tests/noti_unittest/src/test_noti_ex_abstract_item.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_abstract_item.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_app_control_action.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_app_control_action.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_button_item.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_button_item.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_chat_message_item.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_chat_message_item.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_checkbox_item.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_checkbox_item.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_entry_item.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_entry_item.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_event_info.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_event_info.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_group_item.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_group_item.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_icon_item.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_icon_item.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_image_item.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_image_item.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_input_selector_item.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_input_selector_item.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_progress_item.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_progress_item.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_shared_file.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_shared_file.cc with 97% similarity]
tests/noti_unittest/src/test_noti_ex_text_item.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_text_item.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_time_item.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_time_item.cc with 100% similarity]
tests/noti_unittest/src/test_noti_ex_visibility_action.cc [moved from tests/noti_ex_unittest/src/test_noti_ex_visibility_action.cc with 100% similarity]

index 0c0fea1..c07856c 100644 (file)
@@ -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})
index f1ad08d..6edb49a 100644 (file)
@@ -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
index 5e5460b..00bcdf9 100644 (file)
@@ -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 (file)
index 5ff9faa..0000000
+++ /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 (file)
index ad7ec6c..0000000
+++ /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;
-}
index 79b786f..81a955c 100644 (file)
@@ -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/)
@@ -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) {