From 4f74d6e303c58326fe75ee75e1c92cf9263f800d Mon Sep 17 00:00:00 2001 From: christian mueller Date: Thu, 22 Dec 2011 17:27:16 +0100 Subject: * rework of buildsystem * now everything depends on a toplevel CMakefile * cleanup of makefiles and compiler options --- AudioManagerDaemon/test/CMakeLists.txt | 5 ++++- AudioManagerDaemon/test/controlInterface/CMakeLists.txt | 11 ++--------- .../test/controlInterface/controlInterfaceTest.cpp | 5 +++-- .../test/controlInterface/controlInterfaceTest.h | 2 ++ AudioManagerDaemon/test/database/CMakeLists.txt | 10 +--------- AudioManagerDaemon/test/routingInterface/CMakeLists.txt | 9 +-------- AudioManagerDaemon/test/sockethandler/CMakeLists.txt | 2 +- AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp | 8 ++++---- AudioManagerDaemon/test/sockethandler/sockethandlerTest.h | 4 ++-- 9 files changed, 20 insertions(+), 36 deletions(-) (limited to 'AudioManagerDaemon/test') diff --git a/AudioManagerDaemon/test/CMakeLists.txt b/AudioManagerDaemon/test/CMakeLists.txt index 3ee415a..7f8c054 100644 --- a/AudioManagerDaemon/test/CMakeLists.txt +++ b/AudioManagerDaemon/test/CMakeLists.txt @@ -12,7 +12,10 @@ cmake_minimum_required(VERSION 2.6) +set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH}) +FIND_PACKAGE(GTest REQUIRED) + add_subdirectory (database) add_subdirectory (routingInterface) add_subdirectory (controlInterface) -#add_subdirectory (sockethandler) \ No newline at end of file +#add_subdirectory (sockethandler) diff --git a/AudioManagerDaemon/test/controlInterface/CMakeLists.txt b/AudioManagerDaemon/test/controlInterface/CMakeLists.txt index 8ac7cd1..6e0acad 100644 --- a/AudioManagerDaemon/test/controlInterface/CMakeLists.txt +++ b/AudioManagerDaemon/test/controlInterface/CMakeLists.txt @@ -25,16 +25,8 @@ cmake_minimum_required(VERSION 2.6) PROJECT(controlInterfacetest) -#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager") -set(STD_INCLUDE_DIRS "/usr/include") -set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../../../dbusInterfaces) -set(AUDIO_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../includes) -set(DBUS_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../../dbusIncludes) -set(INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../include) -set(EXECUTABLE_OUTPUT_PATH ../../../../test/) - FIND_PACKAGE(PkgConfig) pkg_check_modules(SQLITE REQUIRED sqlite3) pkg_check_modules(DLT REQUIRED automotive-dlt) @@ -48,6 +40,7 @@ INCLUDE_DIRECTORIES( ${STD_INCLUDE_DIRS} ${DLT_INCLUDE_DIRS} ${DBUS_INCLUDE_DIR} + ${GTEST_INCLUDE_DIR} ${INCLUDES_FOLDER} ) @@ -70,7 +63,7 @@ TARGET_LINK_LIBRARIES(controlInterfaceTest ${DLT_LIBRARIES} ${DBUS_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} - gtest + ${GTEST_LIBRARIES} gmock ) diff --git a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp index c59ac06..2efcc64 100644 --- a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp +++ b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp @@ -34,7 +34,8 @@ using namespace testing; DLT_DECLARE_CONTEXT(DLT_CONTEXT) controlInterfaceTest::controlInterfaceTest() - :plistCommandPluginDirs(), + :pDBusWrapper((DBusWrapper*)1), //to get rid of assert + plistCommandPluginDirs(), plistRoutingPluginDirs(), pDatabaseHandler(std::string(":memory:")), pRoutingSender(plistRoutingPluginDirs), @@ -47,7 +48,7 @@ controlInterfaceTest::controlInterfaceTest() pControlInterfaceBackdoor(), pDatabaseObserver(&pCommandSender,&pRoutingSender), pControlReceiver(&pDatabaseHandler,&pRoutingSender,&pCommandSender), - pRoutingReceiver(&pDatabaseHandler,&pRoutingSender,&pControlSender) + pRoutingReceiver(&pDatabaseHandler,&pRoutingSender,&pControlSender,pDBusWrapper) { pDatabaseHandler.registerObserver(&pDatabaseObserver); pControlInterfaceBackdoor.replaceController(&pControlSender,&pMockControlInterface); diff --git a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h index a3a2a50..5b1bd99 100644 --- a/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h +++ b/AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h @@ -27,6 +27,7 @@ #include #include +#include #include #include "MockInterfaces.h" #include "DatabaseHandler.h" @@ -47,6 +48,7 @@ class controlInterfaceTest : public ::testing::Test{ public: controlInterfaceTest(); ~controlInterfaceTest(); + DBusWrapper* pDBusWrapper; std::vector plistCommandPluginDirs; std::vector plistRoutingPluginDirs; DatabaseHandler pDatabaseHandler; diff --git a/AudioManagerDaemon/test/database/CMakeLists.txt b/AudioManagerDaemon/test/database/CMakeLists.txt index 59c40e8..1f368aa 100644 --- a/AudioManagerDaemon/test/database/CMakeLists.txt +++ b/AudioManagerDaemon/test/database/CMakeLists.txt @@ -25,16 +25,8 @@ cmake_minimum_required(VERSION 2.6) PROJECT(datbaseTest) -#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager") -set(STD_INCLUDE_DIRS "/usr/include") -set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../../../dbusInterfaces) -set(AUDIO_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../includes) -set(DBUS_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../../dbusIncludes) -set(INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../include) -set(EXECUTABLE_OUTPUT_PATH ../../../../test/) - FIND_PACKAGE(PkgConfig) pkg_check_modules(SQLITE REQUIRED sqlite3) pkg_check_modules(DLT REQUIRED automotive-dlt) @@ -68,6 +60,6 @@ TARGET_LINK_LIBRARIES( databasetest ${DLT_LIBRARIES} ${DBUS_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} - gtest + ${GTEST_LIBRARIES} gmock ) \ No newline at end of file diff --git a/AudioManagerDaemon/test/routingInterface/CMakeLists.txt b/AudioManagerDaemon/test/routingInterface/CMakeLists.txt index 654c726..292065b 100644 --- a/AudioManagerDaemon/test/routingInterface/CMakeLists.txt +++ b/AudioManagerDaemon/test/routingInterface/CMakeLists.txt @@ -28,13 +28,6 @@ PROJECT(routingInterfaceTest) #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager") -set(STD_INCLUDE_DIRS "/usr/include") -set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../../../dbusInterfaces) -set(AUDIO_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../includes) -set(DBUS_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../../dbusIncludes) -set(INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../include) -set(EXECUTABLE_OUTPUT_PATH ../../../../test/) - FIND_PACKAGE(PkgConfig) pkg_check_modules(SQLITE REQUIRED sqlite3) pkg_check_modules(DLT REQUIRED automotive-dlt) @@ -68,7 +61,7 @@ TARGET_LINK_LIBRARIES(routinginterfacetest ${DLT_LIBRARIES} ${DBUS_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} - gtest + ${GTEST_LIBRARIES} gmock ) diff --git a/AudioManagerDaemon/test/sockethandler/CMakeLists.txt b/AudioManagerDaemon/test/sockethandler/CMakeLists.txt index a7dd63d..787b120 100644 --- a/AudioManagerDaemon/test/sockethandler/CMakeLists.txt +++ b/AudioManagerDaemon/test/sockethandler/CMakeLists.txt @@ -33,7 +33,7 @@ set(DBUS_FOLDER ${CMAKE_SOURCE_DIR}/../../../dbusInterfaces) set(AUDIO_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../includes) set(DBUS_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../../../dbusIncludes) set(INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/../../include) -set(EXECUTABLE_OUTPUT_PATH ../../../../test/) + FIND_PACKAGE(PkgConfig) pkg_check_modules(DLT REQUIRED automotive-dlt) diff --git a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp index c9c17cb..bb72324 100644 --- a/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp +++ b/AudioManagerDaemon/test/sockethandler/sockethandlerTest.cpp @@ -25,13 +25,13 @@ sockethandlerTest::~sockethandlerTest() { } -void fdCallBack::connectSocket(int fd, const short events,void * userData) +void fdCallBack::connectSocket(int fd, const int16_t events,void * userData) { std::cout<<"Socket connection received and open"< pSocketDataCallback; TSpecificPollCallback pSocketConnectionCallback; private: -- cgit v1.2.1