summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel d'Andrada <daniel.dandrada@canonical.com>2014-12-09 11:36:21 -0200
committerDaniel d'Andrada <daniel.dandrada@canonical.com>2014-12-09 11:36:21 -0200
commit0200224bdf454f2f1f65e5a1b403b54e217d5f3a (patch)
tree5e15a17bea9024ba86e3c18deecb36cb54bf9bcc /tests
parent45f076a7e3812bd14a629c2fdaa39df8baf26fa9 (diff)
parentb03de6db39f68ade9353e2103d0e95edb635676b (diff)
Merge trunk
[ CI Train Bot ] * Resync trunk * Resync trunk * Resync trunk * Resync trunk * Resync trunk [ Ricardo Salveti de Araujo ] * qteventfeeder: adding bt and wired headset multimedia keys (LP: #1398427) [ Gerry Boland ] * Port qmake->cmake to enable sbuild usage for crosscompiling. * Fix build with Qt5.4 (LP: #1394884) [ MichaƂ Sawicz ] * Port qmake->cmake to enable sbuild usage for crosscompiling. [ Robert Carr ] * Port qmake->cmake to enable sbuild usage for crosscompiling. [ Alberto Aguirre ] * Select mirclient backend for platform-api instead of mirserver.
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt4
-rw-r--r--tests/google-mock.pri24
-rw-r--r--tests/mirserver/CMakeLists.txt3
-rw-r--r--tests/mirserver/Clipboard/CMakeLists.txt23
-rw-r--r--tests/mirserver/Clipboard/Clipboard.pro16
-rw-r--r--tests/mirserver/QtEventFeeder/CMakeLists.txt23
-rw-r--r--tests/mirserver/QtEventFeeder/QtEventFeeder.pro16
-rw-r--r--tests/mirserver/Screen/CMakeLists.txt24
-rw-r--r--tests/mirserver/Screen/Screen.pro16
-rw-r--r--tests/mirserver/mirserver.pro2
-rw-r--r--tests/modules/ApplicationManager/ApplicationManager.pro16
-rw-r--r--tests/modules/ApplicationManager/CMakeLists.txt28
-rw-r--r--tests/modules/ApplicationManager/application_manager_test.cpp8
-rw-r--r--tests/modules/CMakeLists.txt6
-rw-r--r--tests/modules/DesktopFileReader/CMakeLists.txt28
-rw-r--r--tests/modules/DesktopFileReader/DesktopFileReader.pro15
-rw-r--r--tests/modules/DesktopFileReader/desktopfilereader_test.cpp8
-rw-r--r--tests/modules/General/CMakeLists.txt30
-rw-r--r--tests/modules/General/General.pro15
-rw-r--r--tests/modules/MirSurfaceItem/CMakeLists.txt27
-rw-r--r--tests/modules/MirSurfaceItem/MirSurfaceItem.pro13
-rw-r--r--tests/modules/SessionManager/CMakeLists.txt29
-rw-r--r--tests/modules/SessionManager/SessionManager.pro17
-rw-r--r--tests/modules/TaskController/CMakeLists.txt25
-rw-r--r--tests/modules/TaskController/TaskController.pro7
-rw-r--r--tests/modules/common/common.pri27
-rw-r--r--tests/modules/common/mock_proc_info.h2
-rw-r--r--tests/modules/modules.pro2
-rw-r--r--tests/test-includes.pri15
-rw-r--r--tests/tests.pro2
30 files changed, 259 insertions, 212 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 0000000..02fcb7a
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,4 @@
+find_package(GMock)
+
+add_subdirectory(mirserver)
+add_subdirectory(modules)
diff --git a/tests/google-mock.pri b/tests/google-mock.pri
deleted file mode 100644
index 097abad..0000000
--- a/tests/google-mock.pri
+++ /dev/null
@@ -1,24 +0,0 @@
-GMOCK_SOURCES = /usr/src/gmock/src/gmock-all.cc \
- /usr/src/gmock/src/gmock_main.cc \
- /usr/src/gtest/src/gtest-all.cc
-
-QMAKE_EXTRA_COMPILERS += gmock_compiler
-gmock_compiler.input = GMOCK_SOURCES
-gmock_compiler.output = $${OUT_PWD}/${QMAKE_FILE_BASE}.o
-gmock_compiler.commands = g++ \
- -I/usr/src/gtest \
- -I/usr/src/gmock \
- -c ${QMAKE_FILE_IN} \
- -o ${QMAKE_FILE_OUT}
-gmock_compiler.CONFIG = no_link
-
-QMAKE_EXTRA_COMPILERS += gmock_linker
-gmock_linker.depends = $${OUT_PWD}/gmock-all.o \
- $${OUT_PWD}/gmock_main.o \
- $${OUT_PWD}/gtest-all.o
-gmock_linker.input = GMOCK_SOURCES
-gmock_linker.output = $${OUT_PWD}/libgmock.a
-gmock_linker.commands = ar -rv ${QMAKE_FILE_OUT} $${OUT_PWD}/gmock-all.o $${OUT_PWD}/gmock_main.o $${OUT_PWD}/gtest-all.o
-gmock_linker.CONFIG = combine explicit_dependencies no_link target_predeps
-
-LIBS += $${OUT_PWD}/libgmock.a
diff --git a/tests/mirserver/CMakeLists.txt b/tests/mirserver/CMakeLists.txt
new file mode 100644
index 0000000..4dfeb11
--- /dev/null
+++ b/tests/mirserver/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_subdirectory(QtEventFeeder)
+add_subdirectory(Clipboard)
+add_subdirectory(Screen)
diff --git a/tests/mirserver/Clipboard/CMakeLists.txt b/tests/mirserver/Clipboard/CMakeLists.txt
new file mode 100644
index 0000000..aea39a1
--- /dev/null
+++ b/tests/mirserver/Clipboard/CMakeLists.txt
@@ -0,0 +1,23 @@
+set(
+ CLIPBOARD_TEST_SOURCES
+ clipboard_test.cpp
+ ${CMAKE_SOURCE_DIR}/src/common/debughelpers.cpp
+)
+
+include_directories(
+ ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
+ ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
+ ${MIRSERVER_INCLUDE_DIRS}
+)
+
+add_executable(ClipboardTest ${CLIPBOARD_TEST_SOURCES})
+
+target_link_libraries(
+ ClipboardTest
+ qpa-mirserver
+
+ ${GTEST_BOTH_LIBRARIES}
+ ${GMOCK_LIBRARIES}
+)
+
+add_test(Clipboard, ClipboardTest)
diff --git a/tests/mirserver/Clipboard/Clipboard.pro b/tests/mirserver/Clipboard/Clipboard.pro
deleted file mode 100644
index 815017f..0000000
--- a/tests/mirserver/Clipboard/Clipboard.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-include(../../test-includes.pri)
-
-TARGET = ClipboardTest
-
-QT += gui-private
-
-INCLUDEPATH += \
- ../../../src/platforms/mirserver \
- ../../../src/common
-
-SOURCES += \
- clipboard_test.cpp \
- ../../../src/common/debughelpers.cpp
-
-LIBS += -Wl,-rpath,$${OUT_PWD}/../../../src/platforms/mirserver \
- -L../../../src/platforms/mirserver -lqpa-mirserver
diff --git a/tests/mirserver/QtEventFeeder/CMakeLists.txt b/tests/mirserver/QtEventFeeder/CMakeLists.txt
new file mode 100644
index 0000000..2239ae7
--- /dev/null
+++ b/tests/mirserver/QtEventFeeder/CMakeLists.txt
@@ -0,0 +1,23 @@
+set(
+ EVENT_FEEDER_TEST_SOURCES
+ qteventfeeder_test.cpp
+ ${CMAKE_SOURCE_DIR}/src/common/debughelpers.cpp
+)
+
+include_directories(
+ ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
+ ${CMAKE_SOURCE_DIR}/src/common
+ ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
+ ${MIRSERVER_INCLUDE_DIRS}
+)
+
+add_executable(QtEventFeederTest ${EVENT_FEEDER_TEST_SOURCES})
+
+target_link_libraries(
+ QtEventFeederTest
+ qpa-mirserver
+ ${GTEST_BOTH_LIBRARIES}
+ ${GMOCK_LIBRARIES}
+)
+
+add_test(QtEventFeeder, QtEventFeederTest)
diff --git a/tests/mirserver/QtEventFeeder/QtEventFeeder.pro b/tests/mirserver/QtEventFeeder/QtEventFeeder.pro
deleted file mode 100644
index 303311d..0000000
--- a/tests/mirserver/QtEventFeeder/QtEventFeeder.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-include(../../test-includes.pri)
-
-TARGET = QtEventFeederTest
-
-QT += gui-private
-
-INCLUDEPATH += \
- ../../../src/platforms/mirserver \
- ../../../src/common
-
-SOURCES += \
- qteventfeeder_test.cpp \
- ../../../src/common/debughelpers.cpp
-
-LIBS += -Wl,-rpath,$${OUT_PWD}/../../../src/platforms/mirserver \
- -L../../../src/platforms/mirserver -lqpa-mirserver
diff --git a/tests/mirserver/Screen/CMakeLists.txt b/tests/mirserver/Screen/CMakeLists.txt
new file mode 100644
index 0000000..a278fcd
--- /dev/null
+++ b/tests/mirserver/Screen/CMakeLists.txt
@@ -0,0 +1,24 @@
+set(
+ SCREEN_TEST_SOURCES
+ screen_test.cpp
+ ${CMAKE_SOURCE_DIR}/src/common/debughelpers.cpp
+)
+
+include_directories(
+ ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
+ ${CMAKE_SOURCE_DIR}/src/common
+ ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
+ ${MIRSERVER_INCLUDE_DIRS}
+)
+
+add_executable(ScreenTest ${SCREEN_TEST_SOURCES})
+
+target_link_libraries(
+ ScreenTest
+ qpa-mirserver
+
+ ${GTEST_BOTH_LIBRARIES}
+ ${GMOCK_LIBRARIES}
+)
+
+add_test(Screen, ScreenTest)
diff --git a/tests/mirserver/Screen/Screen.pro b/tests/mirserver/Screen/Screen.pro
deleted file mode 100644
index f791043..0000000
--- a/tests/mirserver/Screen/Screen.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-include(../../test-includes.pri)
-
-TARGET = ScreenTest
-
-QT += gui-private
-
-INCLUDEPATH += \
- ../../../src/platforms/mirserver \
- ../../../src/common
-
-SOURCES += \
- screen_test.cpp \
- ../../../src/common/debughelpers.cpp
-
-LIBS += -Wl,-rpath,$${OUT_PWD}/../../../src/platforms/mirserver \
- -L../../../src/platforms/mirserver -lqpa-mirserver
diff --git a/tests/mirserver/mirserver.pro b/tests/mirserver/mirserver.pro
deleted file mode 100644
index 689f37e..0000000
--- a/tests/mirserver/mirserver.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = QtEventFeeder Clipboard Screen
diff --git a/tests/modules/ApplicationManager/ApplicationManager.pro b/tests/modules/ApplicationManager/ApplicationManager.pro
deleted file mode 100644
index c299599..0000000
--- a/tests/modules/ApplicationManager/ApplicationManager.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-include(../../test-includes.pri)
-include(../common/common.pri)
-
-TARGET = application_manager_test
-
-INCLUDEPATH += \
- ../../../src/platforms/mirserver \
- ../../../src/modules/Unity/Application
-
-SOURCES += \
- application_manager_test.cpp
-
-# need to link in the QPA plugin too for access to MirServerConfiguration
-LIBS += -Wl,-rpath,$${PWD}/../../../src/platforms/mirserver \
- -L../../../src/platforms/mirserver -lqpa-mirserver
-
diff --git a/tests/modules/ApplicationManager/CMakeLists.txt b/tests/modules/ApplicationManager/CMakeLists.txt
new file mode 100644
index 0000000..6590576
--- /dev/null
+++ b/tests/modules/ApplicationManager/CMakeLists.txt
@@ -0,0 +1,28 @@
+set(
+ APPLICATION_MANAGER_TEST_SOURCES
+ application_manager_test.cpp
+ ${CMAKE_SOURCE_DIR}/src/common/debughelpers.cpp
+)
+
+include_directories(
+ ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
+ ${CMAKE_SOURCE_DIR}/src/modules
+ ${CMAKE_SOURCE_DIR}/tests/modules/common
+ ${MIRSERVER_INCLUDE_DIRS}
+)
+
+add_executable(applicationmanager_test ${APPLICATION_MANAGER_TEST_SOURCES})
+
+target_link_libraries(
+ applicationmanager_test
+
+ qpa-mirserver
+ unityapplicationplugin
+
+ Qt5::Test
+
+ ${GTEST_BOTH_LIBRARIES}
+ ${GMOCK_LIBRARIES}
+)
+
+add_test(ApplicationManager applicationmanager_test)
diff --git a/tests/modules/ApplicationManager/application_manager_test.cpp b/tests/modules/ApplicationManager/application_manager_test.cpp
index 9836868..51df790 100644
--- a/tests/modules/ApplicationManager/application_manager_test.cpp
+++ b/tests/modules/ApplicationManager/application_manager_test.cpp
@@ -19,7 +19,7 @@
#include <condition_variable>
#include <QSignalSpy>
-#include <applicationscreenshotprovider.h>
+#include <Unity/Application/applicationscreenshotprovider.h>
#include "mock_surface.h"
#include "qtmir_test.h"
@@ -158,7 +158,7 @@ TEST_F(ApplicationManagerTests,bug_case_1240400_second_dialer_app_fails_to_autho
applicationManager.authorizeSession(secondProcId, authed);
applicationManager.onProcessStarting(dialer_app_id);
- EXPECT_EQ(false,authed);
+ EXPECT_FALSE(authed);
EXPECT_EQ(app,applicationManager.findApplication(dialer_app_id));
}
@@ -481,7 +481,7 @@ TEST_F(ApplicationManagerTests,suspended_suspends_focused_app_and_marks_it_unfoc
applicationManager.setSuspended(true);
EXPECT_EQ(Application::Suspended, the_app->state());
- EXPECT_EQ(false, the_app->focused());
+ EXPECT_FALSE(the_app->focused());
applicationManager.setSuspended(false);
@@ -522,7 +522,7 @@ TEST_F(ApplicationManagerTests,suspended_suspends_starting_app_when_it_gets_read
// And given that the AppManager is suspended now, this should go to suspended too
EXPECT_EQ(Application::Suspended, the_app->state());
- EXPECT_EQ(false, the_app->focused());
+ EXPECT_FALSE(the_app->focused());
applicationManager.setSuspended(false);
diff --git a/tests/modules/CMakeLists.txt b/tests/modules/CMakeLists.txt
new file mode 100644
index 0000000..5c4cc4e
--- /dev/null
+++ b/tests/modules/CMakeLists.txt
@@ -0,0 +1,6 @@
+add_subdirectory(ApplicationManager)
+add_subdirectory(General)
+add_subdirectory(MirSurfaceItem)
+add_subdirectory(SessionManager)
+add_subdirectory(TaskController)
+add_subdirectory(DesktopFileReader)
diff --git a/tests/modules/DesktopFileReader/CMakeLists.txt b/tests/modules/DesktopFileReader/CMakeLists.txt
new file mode 100644
index 0000000..e23fda3
--- /dev/null
+++ b/tests/modules/DesktopFileReader/CMakeLists.txt
@@ -0,0 +1,28 @@
+add_definitions(-DTEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
+
+set(
+ DESKTOP_FILE_READER_TEST_SOURCES
+ desktopfilereader_test.cpp
+)
+
+include_directories(
+ ${CMAKE_SOURCE_DIR}/src/modules
+ ${CMAKE_SOURCE_DIR}/tests/modules/common
+ ${MIRSERVER_INCLUDE_DIRS}
+)
+
+add_executable(desktop_file_reader_test ${DESKTOP_FILE_READER_TEST_SOURCES})
+
+target_link_libraries(
+ desktop_file_reader_test
+
+ qpa-mirserver
+ unityapplicationplugin
+
+ Qt5::Gui
+
+ ${GTEST_BOTH_LIBRARIES}
+ ${GMOCK_LIBRARIES}
+)
+
+add_test(DesktopFileReader desktop_file_reader_test)
diff --git a/tests/modules/DesktopFileReader/DesktopFileReader.pro b/tests/modules/DesktopFileReader/DesktopFileReader.pro
deleted file mode 100644
index bbe9883..0000000
--- a/tests/modules/DesktopFileReader/DesktopFileReader.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-include(../../test-includes.pri)
-include(../common/common.pri)
-
-TARGET = desktopfilereader_test
-
-SOURCES += \
- desktopfilereader_test.cpp
-
-OTHER_FILES += \
- calculator.desktop
-
-# Copy to build directory
-for(FILE, OTHER_FILES){
- QMAKE_POST_LINK += $$quote(cp $${PWD}/$${FILE} $${OUT_PWD}$$escape_expand(\\n\\t))
-}
diff --git a/tests/modules/DesktopFileReader/desktopfilereader_test.cpp b/tests/modules/DesktopFileReader/desktopfilereader_test.cpp
index 3e36c59..96b59e1 100644
--- a/tests/modules/DesktopFileReader/desktopfilereader_test.cpp
+++ b/tests/modules/DesktopFileReader/desktopfilereader_test.cpp
@@ -41,7 +41,7 @@ TEST(DesktopFileReader, testReadsDesktopFile)
using namespace ::testing;
setLocale("C");
- QFileInfo fileInfo(QDir::currentPath() + "/calculator.desktop");
+ QFileInfo fileInfo(QString(TEST_SOURCE_DIR) + "/calculator.desktop");
DesktopFileReader::Factory readerFactory;
DesktopFileReader *reader = readerFactory.createInstance("calculator", fileInfo);
@@ -66,7 +66,7 @@ TEST(DesktopFileReader, testReadsLocalizedDesktopFile)
using namespace ::testing;
setLocale("de");
- QFileInfo fileInfo(QDir::currentPath() + "/calculator.desktop");
+ QFileInfo fileInfo(QString(TEST_SOURCE_DIR) + "/calculator.desktop");
DesktopFileReader::Factory readerFactory;
DesktopFileReader *reader = readerFactory.createInstance("calculator", fileInfo);
@@ -91,7 +91,7 @@ TEST(DesktopFileReader, testMissingDesktopFile)
using namespace ::testing;
setLocale("C");
- QFileInfo fileInfo(QDir::currentPath() + "/missing.desktop");
+ QFileInfo fileInfo(QString(TEST_SOURCE_DIR) + "/missing.desktop");
DesktopFileReader::Factory readerFactory;
DesktopFileReader *reader = readerFactory.createInstance("calculator", fileInfo);
@@ -116,7 +116,7 @@ TEST(DesktopFileReader, testUTF8Characters)
using namespace ::testing;
setLocale("zh_CN");
- QFileInfo fileInfo(QDir::currentPath() + "/calculator.desktop");
+ QFileInfo fileInfo(QString(TEST_SOURCE_DIR) + "/calculator.desktop");
DesktopFileReader::Factory readerFactory;
DesktopFileReader *reader = readerFactory.createInstance("calculator", fileInfo);
diff --git a/tests/modules/General/CMakeLists.txt b/tests/modules/General/CMakeLists.txt
new file mode 100644
index 0000000..a9aa3b3
--- /dev/null
+++ b/tests/modules/General/CMakeLists.txt
@@ -0,0 +1,30 @@
+set(
+ GENERAL_TEST_SOURCES
+ objectlistmodel_test.cpp
+ ${CMAKE_SOURCE_DIR}/src/common/debughelpers.cpp
+)
+
+include_directories(
+ ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
+ ${CMAKE_SOURCE_DIR}/src/common
+ ${CMAKE_SOURCE_DIR}/src/modules
+ ${CMAKE_SOURCE_DIR}/tests/modules/common
+ ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
+ ${MIRSERVER_INCLUDE_DIRS}
+)
+
+add_executable(general_test ${GENERAL_TEST_SOURCES})
+
+target_link_libraries(
+ general_test
+
+ qpa-mirserver
+ unityapplicationplugin
+
+ Qt5::Gui
+
+ ${GTEST_BOTH_LIBRARIES}
+ ${GMOCK_LIBRARIES}
+)
+
+add_test(General general_test)
diff --git a/tests/modules/General/General.pro b/tests/modules/General/General.pro
deleted file mode 100644
index 8bf2d2f..0000000
--- a/tests/modules/General/General.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-include(../../test-includes.pri)
-include(../common/common.pri)
-
-TARGET = general_tests
-
-INCLUDEPATH += \
- ../../../src/platforms/mirserver
-
-SOURCES += \
- objectlistmodel_test.cpp \
-
-# need to link in the QPA plugin too for access to MirServerConfiguration
-LIBS += -Wl,-rpath,$${PWD}/../../../src/platforms/mirserver \
- -L../../../src/platforms/mirserver -lqpa-mirserver
-
diff --git a/tests/modules/MirSurfaceItem/CMakeLists.txt b/tests/modules/MirSurfaceItem/CMakeLists.txt
new file mode 100644
index 0000000..36d16a8
--- /dev/null
+++ b/tests/modules/MirSurfaceItem/CMakeLists.txt
@@ -0,0 +1,27 @@
+set(
+ MIR_SURFACE_ITEM_TEST_SOURCES
+ mirsurfaceitem_test.cpp
+ ${CMAKE_SOURCE_DIR}/src/common/debughelpers.cpp
+)
+
+include_directories(
+ ${CMAKE_SOURCE_DIR}/src/modules/Unity/Application
+ ${CMAKE_SOURCE_DIR}/tests/modules/common
+ ${MIRSERVER_INCLUDE_DIRS}
+)
+
+add_executable(mirsurfaceitem_test ${MIR_SURFACE_ITEM_TEST_SOURCES})
+
+target_link_libraries(
+ mirsurfaceitem_test
+
+ qpa-mirserver
+ unityapplicationplugin
+
+ Qt5::Test
+
+ ${GTEST_BOTH_LIBRARIES}
+ ${GMOCK_LIBRARIES}
+)
+
+add_test(MirSurfaceItem mirsurfaceitem_test)
diff --git a/tests/modules/MirSurfaceItem/MirSurfaceItem.pro b/tests/modules/MirSurfaceItem/MirSurfaceItem.pro
deleted file mode 100644
index bf84cf9..0000000
--- a/tests/modules/MirSurfaceItem/MirSurfaceItem.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-include(../../test-includes.pri)
-include(../common/common.pri)
-
-TARGET = mirsurfaceitem_test
-
-QT += testlib
-
-INCLUDEPATH += \
- ../../../src/platforms/mirserver \
- ../../../src/modules/Unity/Application
-
-SOURCES += \
- mirsurfaceitem_test.cpp
diff --git a/tests/modules/SessionManager/CMakeLists.txt b/tests/modules/SessionManager/CMakeLists.txt
new file mode 100644
index 0000000..a4e25d2
--- /dev/null
+++ b/tests/modules/SessionManager/CMakeLists.txt
@@ -0,0 +1,29 @@
+set(
+ SESSION_MANAGER_TEST_SOURCES
+ session_manager_test.cpp
+ session_test.cpp
+ ${CMAKE_SOURCE_DIR}/src/common/debughelpers.cpp
+)
+
+include_directories(
+ ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
+ ${CMAKE_SOURCE_DIR}/src/modules
+ ${CMAKE_SOURCE_DIR}/tests/modules/common
+ ${MIRSERVER_INCLUDE_DIRS}
+)
+
+add_executable(sessionmanager_test ${SESSION_MANAGER_TEST_SOURCES})
+
+target_link_libraries(
+ sessionmanager_test
+
+ qpa-mirserver
+ unityapplicationplugin
+
+ Qt5::Test
+
+ ${GTEST_BOTH_LIBRARIES}
+ ${GMOCK_LIBRARIES}
+)
+
+add_test(SessionManager, sessionmanager_test)
diff --git a/tests/modules/SessionManager/SessionManager.pro b/tests/modules/SessionManager/SessionManager.pro
deleted file mode 100644
index b295384..0000000
--- a/tests/modules/SessionManager/SessionManager.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-include(../../test-includes.pri)
-include(../common/common.pri)
-
-TARGET = session_manager_test
-
-INCLUDEPATH += \
- ../../../src/platforms/mirserver \
- ../../../src/modules/Unity/Application
-
-SOURCES += \
- session_manager_test.cpp \
- session_test.cpp
-
-# need to link in the QPA plugin too for access to MirServerConfiguration
-LIBS += -Wl,-rpath,$${PWD}/../../../src/platforms/mirserver \
- -L../../../src/platforms/mirserver -lqpa-mirserver
-
diff --git a/tests/modules/TaskController/CMakeLists.txt b/tests/modules/TaskController/CMakeLists.txt
new file mode 100644
index 0000000..e6785ab
--- /dev/null
+++ b/tests/modules/TaskController/CMakeLists.txt
@@ -0,0 +1,25 @@
+set(
+ TASK_CONTROLLER_TEST_SOURCES
+ taskcontroller_test.cpp
+ ${CMAKE_SOURCE_DIR}/src/common/debughelpers.cpp
+)
+
+include_directories(
+ ${CMAKE_SOURCE_DIR}/src/modules
+ ${CMAKE_SOURCE_DIR}/tests/modules/common
+ ${MIRSERVER_INCLUDE_DIRS}
+)
+
+add_executable(taskcontroller_test ${TASK_CONTROLLER_TEST_SOURCES})
+
+target_link_libraries(
+ taskcontroller_test
+
+ qpa-mirserver
+ unityapplicationplugin
+
+ ${GTEST_BOTH_LIBRARIES}
+ ${GMOCK_LIBRARIES}
+)
+
+add_test(TaskController, taskcontroller_test)
diff --git a/tests/modules/TaskController/TaskController.pro b/tests/modules/TaskController/TaskController.pro
deleted file mode 100644
index 5bea125..0000000
--- a/tests/modules/TaskController/TaskController.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-include(../../test-includes.pri)
-include(../common/common.pri)
-
-TARGET = taskcontroller_test
-
-SOURCES += \
- taskcontroller_test.cpp
diff --git a/tests/modules/common/common.pri b/tests/modules/common/common.pri
deleted file mode 100644
index 3afaecc..0000000
--- a/tests/modules/common/common.pri
+++ /dev/null
@@ -1,27 +0,0 @@
-CONFIG += no_keywords # keywords clash with ProcessC++
-PKGCONFIG += ubuntu-app-launch-2 process-cpp
-
-QT += quick
-
-HEADERS += ../common/mock_application_controller.h \
- ../common/mock_desktop_file_reader.h \
- ../common/mock_focus_controller.h \
- ../common/mock_mir_session.h \
- ../common/mock_proc_info.h \
- ../common/mock_prompt_session.h \
- ../common/mock_prompt_session_manager.h \
- ../common/mock_renderable.h \
- ../common/mock_session.h \
- ../common/mock_surface.h \
- ../common/qtmir_test.h \
- ../common/stub_input_channel.h \
- ../common/stub_scene_surface.h
-
-INCLUDEPATH += ../../../src/modules \
- ../common
-
-LIBS += \
- -Wl,-rpath,$${OUT_PWD}/../../../src/modules/Unity/Application \
- -L$${OUT_PWD}/../../../src/modules/Unity/Application -lunityapplicationplugin \
- -Wl,-rpath,$${OUT_PWD}/../../../src/platforms/mirserver \
- -L$${OUT_PWD}/../../../src/platforms/mirserver
diff --git a/tests/modules/common/mock_proc_info.h b/tests/modules/common/mock_proc_info.h
index 540fa94..de1a69a 100644
--- a/tests/modules/common/mock_proc_info.h
+++ b/tests/modules/common/mock_proc_info.h
@@ -34,4 +34,4 @@ struct MockProcInfo : public qtmir::ProcInfo
};
}
-#endif // MOCK_OOM_CONTROLLER_H
+#endif // MOCK_PROC_INFO_H
diff --git a/tests/modules/modules.pro b/tests/modules/modules.pro
deleted file mode 100644
index d16732c..0000000
--- a/tests/modules/modules.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = ApplicationManager General MirSurfaceItem SessionManager TaskController DesktopFileReader
diff --git a/tests/test-includes.pri b/tests/test-includes.pri
deleted file mode 100644
index 76c36af..0000000
--- a/tests/test-includes.pri
+++ /dev/null
@@ -1,15 +0,0 @@
-TEMPLATE = app
-
-# CONFIG += testcase adds a 'make check' which is great. But by default it also
-# adds a 'make install' that installs the test cases, which we do not want.
-# Can configure it not to do that with 'no_testcase_installs'
-CONFIG += testcase no_testcase_installs
-
-QMAKE_CXXFLAGS = -std=c++11
-
-QT += testlib
-
-CONFIG += link_pkgconfig
-PKGCONFIG += mirserver
-
-include(google-mock.pri)
diff --git a/tests/tests.pro b/tests/tests.pro
deleted file mode 100644
index b7ee0dd..0000000
--- a/tests/tests.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = modules mirserver