diff --git a/debian/applauncherd-tests.install b/debian/applauncherd-tests.install index df05579..6a717e1 100644 --- a/debian/applauncherd-tests.install +++ b/debian/applauncherd-tests.install @@ -4,7 +4,7 @@ usr/share/applauncherd-tests/ut_boosterfactory usr/share/applauncherd-tests/ut_daemon usr/share/applauncherd-tests/ut_connection usr/share/applauncherd-tests/ut_dbooster +usr/share/applauncherd-tests/ut_ebooster usr/share/applauncherd-tests/ut_mbooster usr/share/applauncherd-tests/ut_qtbooster usr/share/applauncherd-tests/ut_socketmanager - diff --git a/src/ebooster/CMakeLists.txt b/src/ebooster/CMakeLists.txt index 2a38fce..e95d802 100644 --- a/src/ebooster/CMakeLists.txt +++ b/src/ebooster/CMakeLists.txt @@ -12,11 +12,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") # Set sources set(SRC ebooster.cpp pluginfactory.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp ${LAUNCHER}/connection.cpp ${LAUNCHER}/logger.cpp -${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp -${COMMON}/eventhandler.cpp) - -set(MOC_HDRS ${COMMON}/eventhandler.h) -qt4_wrap_cpp(MOC_SRC ${MOC_HDRS}) +${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp) # Set libraries to be linked. link_libraries(${MEEGOTOUCH_LIBRARIES} ${LIBDL} ${QT_QTCORE_LIBRARY}) diff --git a/src/ebooster/ebooster.h b/src/ebooster/ebooster.h index a2bf3d0..f120f08 100644 --- a/src/ebooster/ebooster.h +++ b/src/ebooster/ebooster.h @@ -21,13 +21,10 @@ #define EBOOSTER_H #include "booster.h" -#include "eventhandler.h" #include using std::tr1::shared_ptr; -#include - /*! \class EBooster \brief EBooster is a "booster" that only exec()'s the given binary. @@ -94,15 +91,6 @@ private: //! wait for socket connection void accept(); -private slots: - - //! Qt signal handler for SIGHUP. - void handleSigHup(); - - //! Qt signal handler for theme change - void notifyThemeChange(); - - #ifdef UNIT_TEST friend class Ut_EBooster; #endif diff --git a/tests/Common/unittests/CMakeLists.txt b/tests/Common/unittests/CMakeLists.txt index 191e5f6..af6d808 100644 --- a/tests/Common/unittests/CMakeLists.txt +++ b/tests/Common/unittests/CMakeLists.txt @@ -3,6 +3,7 @@ add_subdirectory(ut_boosterfactory) add_subdirectory(ut_connection) add_subdirectory(ut_daemon) add_subdirectory(ut_dbooster) +add_subdirectory(ut_ebooster) add_subdirectory(ut_mbooster) add_subdirectory(ut_qtbooster) add_subdirectory(ut_socketmanager) diff --git a/tests/Common/unittests/tests.xml b/tests/Common/unittests/tests.xml index 044c8ea..f5ee568 100644 --- a/tests/Common/unittests/tests.xml +++ b/tests/Common/unittests/tests.xml @@ -46,6 +46,10 @@ /usr/share/applauncherd-tests/ut_qtbooster + + su - user -c 'source /tmp/session_bus_address.user && DISPLAY=:0 /usr/share/applauncherd-tests/ut_ebooster' + + true true diff --git a/tests/Common/unittests/ut_ebooster/CMakeLists.txt b/tests/Common/unittests/ut_ebooster/CMakeLists.txt new file mode 100644 index 0000000..f6353ea --- /dev/null +++ b/tests/Common/unittests/ut_ebooster/CMakeLists.txt @@ -0,0 +1,32 @@ +set(LAUNCHER ${CMAKE_HOME_DIRECTORY}/src/launcherlib) +set(EBOOSTER ${CMAKE_HOME_DIRECTORY}/src/ebooster) +set(COMMON "${CMAKE_HOME_DIRECTORY}/src/common") + +# Set sources +set(SRC ut_ebooster.cpp ${LAUNCHER}/appdata.cpp ${LAUNCHER}/booster.cpp +${LAUNCHER}/connection.cpp +${LAUNCHER}/logger.cpp ${EBOOSTER}/ebooster.cpp +${LAUNCHER}/singleinstance.cpp ${LAUNCHER}/socketmanager.cpp) + +# Set moc headers +set(MOC_HDRS ut_ebooster.h) + +# Run moc +qt4_wrap_cpp(MOC_SRC ${MOC_HDRS}) + +# Enable test library +set(QT_USE_QTTEST TRUE) + +# Set include paths +include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/src/common ${LAUNCHER} ${EBOOSTER}) + +link_libraries(${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ${MEEGOTOUCH_LIBRARIES} ${LIBCREDS}) + +# Enable Qt (may not be needed, because already defined on higher level) +include(${QT_USE_FILE}) + +add_executable(ut_ebooster ${SRC} ${MOC_SRC} ) + +# Install +install(PROGRAMS ut_ebooster DESTINATION /usr/share/applauncherd-tests/) + diff --git a/tests/Common/unittests/ut_ebooster/ut_ebooster.cpp b/tests/Common/unittests/ut_ebooster/ut_ebooster.cpp new file mode 100644 index 0000000..da4cf87 --- /dev/null +++ b/tests/Common/unittests/ut_ebooster/ut_ebooster.cpp @@ -0,0 +1,53 @@ +/*************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of applauncherd +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation +** and appearing in the file LICENSE.LGPL included in the packaging +** of this file. +** +****************************************************************************/ + +#include "ut_ebooster.h" +#include "ebooster.h" + +Ut_EBooster::Ut_EBooster() : + m_subject(new EBooster) +{} + +Ut_EBooster::~Ut_EBooster() +{} + +void Ut_EBooster::initTestCase() +{} + +void Ut_EBooster::cleanupTestCase() +{} + +void Ut_EBooster::testSocketName() +{ + QVERIFY(EBooster::socketName() == EBooster::m_socketId); + QVERIFY(m_subject->socketId() == EBooster::m_socketId); +} + +void Ut_EBooster::testType() +{ + QVERIFY(EBooster::type() == 'e'); + QVERIFY(m_subject->boosterType() == 'e'); +} + +void Ut_EBooster::testPreload() +{ + QVERIFY(m_subject->preload()); +} + +QTEST_APPLESS_MAIN(Ut_EBooster); diff --git a/tests/Common/unittests/ut_ebooster/ut_ebooster.h b/tests/Common/unittests/ut_ebooster/ut_ebooster.h new file mode 100644 index 0000000..bab8071 --- /dev/null +++ b/tests/Common/unittests/ut_ebooster/ut_ebooster.h @@ -0,0 +1,51 @@ +/*************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of applauncherd +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation +** and appearing in the file LICENSE.LGPL included in the packaging +** of this file. +** +****************************************************************************/ + +#ifndef UT_EBOOSTER_H +#define UT_EBOOSTER_H + +#include +#include + +#include + +#define UNIT_TEST + +class EBooster; + +class Ut_EBooster : public QObject +{ + Q_OBJECT + +public: + Ut_EBooster(); + virtual ~Ut_EBooster(); + +private Q_SLOTS: + void initTestCase(); + void cleanupTestCase(); + void testSocketName(); + void testType(); + void testPreload(); + +private: + std::tr1::shared_ptr m_subject; +}; + +#endif // UT_EBOOSTER_H