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})
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}
%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
%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
ADD_SUBDIRECTORY(noti_unittest)
-ADD_SUBDIRECTORY(noti_ex_unittest)
+++ /dev/null
-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/)
+++ /dev/null
-/*
- * 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;
-}
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}
)
${pkgs_LIBRARIES}
gmock
notification
+ notification-ex
)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin/)
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() {
.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) {