diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-08-20 15:25:22 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-11-02 12:27:53 +0000 |
commit | 7b2433fd6fefe7642268da3aa270bbc86e81a7b8 (patch) | |
tree | d3d6f6abd001be52375d55743bcbe2cf85a74cd9 /tests | |
parent | 824429627f383a5cc81d734999da9b39e17b49bd (diff) |
qmakeify all over again
Change-Id: I96996ae306b30996375518ad7586110fff9dadb5
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'tests')
25 files changed, 232 insertions, 0 deletions
diff --git a/tests/mirserver/Clipboard/Clipboard.pro b/tests/mirserver/Clipboard/Clipboard.pro new file mode 100644 index 0000000..2d74ef1 --- /dev/null +++ b/tests/mirserver/Clipboard/Clipboard.pro @@ -0,0 +1,7 @@ +TARGET = clipboard_test + +include (../../testcommon.pri) + +QT += dbus gui-private + +SOURCES += clipboard_test.cpp diff --git a/tests/mirserver/QtEventFeeder/QtEventFeeder.pro b/tests/mirserver/QtEventFeeder/QtEventFeeder.pro new file mode 100644 index 0000000..2ad9bbf --- /dev/null +++ b/tests/mirserver/QtEventFeeder/QtEventFeeder.pro @@ -0,0 +1,7 @@ +TARGET = qteventfeeder_test + +include (../../testcommon.pri) + +QT += gui-private + +SOURCES += qteventfeeder_test.cpp diff --git a/tests/mirserver/Screen/Screen.pro b/tests/mirserver/Screen/Screen.pro new file mode 100644 index 0000000..c7cadfe --- /dev/null +++ b/tests/mirserver/Screen/Screen.pro @@ -0,0 +1,7 @@ +TARGET = screen_test + +include (../../testcommon.pri) + +QT += gui-private + +SOURCES += screen_test.cpp diff --git a/tests/mirserver/mirserver.pro b/tests/mirserver/mirserver.pro new file mode 100644 index 0000000..a6b3937 --- /dev/null +++ b/tests/mirserver/mirserver.pro @@ -0,0 +1,5 @@ +TEMPLATE = subdirs + +SUBDIRS += Clipboard \ + QtEventFeeder \ + Screen diff --git a/tests/modules/Application/Application.pro b/tests/modules/Application/Application.pro new file mode 100644 index 0000000..e8290b5 --- /dev/null +++ b/tests/modules/Application/Application.pro @@ -0,0 +1,9 @@ +TARGET = application_test + +include (../../testcommon.pri) + +PKGCONFIG += process-cpp + +CONFIG += exceptions + +SOURCES += application_test.cpp diff --git a/tests/modules/ApplicationManager/ApplicationManager.pro b/tests/modules/ApplicationManager/ApplicationManager.pro new file mode 100644 index 0000000..686b96d --- /dev/null +++ b/tests/modules/ApplicationManager/ApplicationManager.pro @@ -0,0 +1,9 @@ +TARGET = application_manager_test + +include (../../testcommon.pri) + +PKGCONFIG += process-cpp + +CONFIG += exceptions + +SOURCES += application_manager_test.cpp diff --git a/tests/modules/DesktopFileReader/DesktopFileReader.pro b/tests/modules/DesktopFileReader/DesktopFileReader.pro new file mode 100644 index 0000000..3bc4093 --- /dev/null +++ b/tests/modules/DesktopFileReader/DesktopFileReader.pro @@ -0,0 +1,7 @@ +TARGET = desktopfilereader_test + +include (../../testcommon.pri) + +DEFINES += TEST_SOURCE_DIR=\\\"$$PWD\\\" + +SOURCES += desktopfilereader_test.cpp diff --git a/tests/modules/General/General.pro b/tests/modules/General/General.pro new file mode 100644 index 0000000..851b7b6 --- /dev/null +++ b/tests/modules/General/General.pro @@ -0,0 +1,5 @@ +TARGET = objectlistmodel_test + +include (../../testcommon.pri) + +SOURCES += objectlistmodel_test.cpp diff --git a/tests/modules/MirSurfaceItem/MirSurfaceItem.pro b/tests/modules/MirSurfaceItem/MirSurfaceItem.pro new file mode 100644 index 0000000..9cd5f86 --- /dev/null +++ b/tests/modules/MirSurfaceItem/MirSurfaceItem.pro @@ -0,0 +1,5 @@ +TARGET = mirsurfaceitem_test + +include (../../testcommon.pri) + +SOURCES += mirsurfaceitem_test.cpp diff --git a/tests/modules/SessionManager/SessionManager.pro b/tests/modules/SessionManager/SessionManager.pro new file mode 100644 index 0000000..4ae2910 --- /dev/null +++ b/tests/modules/SessionManager/SessionManager.pro @@ -0,0 +1,9 @@ +TARGET = session_manager_test + +include (../../testcommon.pri) + +PKGCONFIG += process-cpp +CONFIG += exceptions + +SOURCES += session_test.cpp \ + session_manager_test.cpp diff --git a/tests/modules/SharedWakelock/SharedWakelock.pro b/tests/modules/SharedWakelock/SharedWakelock.pro new file mode 100644 index 0000000..85f422a --- /dev/null +++ b/tests/modules/SharedWakelock/SharedWakelock.pro @@ -0,0 +1,18 @@ +TARGET = sharedwakelock_test + +CONFIG += gtest_own_main + +include (../../testcommon.pri) + +QT += testlib dbus + +##################################################################################### +### libqtdbustest/libqtdbusmock are external packages that depend on Qt5Core. This +### will create a circular dependency when qtmirserver is built as part of Qt. +### Therefore this autotest is not included in the default build. +##################################################################################### + +PKGCONFIG += libqtdbusmock-1 libqtdbustest-1 + + +SOURCES += sharedwakelock_test.cpp diff --git a/tests/modules/TaskController/TaskController.pro b/tests/modules/TaskController/TaskController.pro new file mode 100644 index 0000000..fbd6da8 --- /dev/null +++ b/tests/modules/TaskController/TaskController.pro @@ -0,0 +1,8 @@ +TARGET = taskcontroller_test + +include (../../testcommon.pri) + +PKGCONFIG += process-cpp +CONFIG += exceptions + +SOURCES += taskcontroller_test.cpp diff --git a/tests/modules/common/common.pri b/tests/modules/common/common.pri new file mode 100644 index 0000000..2b6fc67 --- /dev/null +++ b/tests/modules/common/common.pri @@ -0,0 +1,9 @@ +SOURCES += $$PWD/qtmir_test.cpp + +HEADERS += \ + $$PWD/fake_mirsurfaceitem.h \ + $$PWD/fake_session.h + +INCLUDEPATH += $$PWD + +QT += quick dbus testlib diff --git a/tests/modules/modules.pro b/tests/modules/modules.pro new file mode 100644 index 0000000..e2e7b48 --- /dev/null +++ b/tests/modules/modules.pro @@ -0,0 +1,9 @@ +TEMPLATE = subdirs + +SUBDIRS += Application \ + ApplicationManager \ + DesktopFileReader \ + General \ + MirSurfaceItem \ + SessionManager \ + TaskController diff --git a/tests/testcommon.pri b/tests/testcommon.pri new file mode 100644 index 0000000..2b8ed16 --- /dev/null +++ b/tests/testcommon.pri @@ -0,0 +1,11 @@ +include (testlibs/testlibs.pri) + +SOURCES += $$PWD/testlibs/testmain.cpp + +CONFIG += testcase +CONFIG += c++11 + +# if there is a common directory above the test, include it +exists ($$OUT_PWD/../common/common.pri) { + include ($$OUT_PWD/../common/common.pri) +} diff --git a/tests/testlibs/gmock/gmock.pri b/tests/testlibs/gmock/gmock.pri new file mode 100644 index 0000000..741f4ff --- /dev/null +++ b/tests/testlibs/gmock/gmock.pri @@ -0,0 +1,5 @@ +GMOCK_INCLUDE_DIR = /usr/include/gmock + +INCLUDEPATH += $$GMOCK_INCLUDE_DIR + +LIBS += $$PWD/libgmock.a diff --git a/tests/testlibs/gmock/gmock.pro b/tests/testlibs/gmock/gmock.pro new file mode 100644 index 0000000..c56197b --- /dev/null +++ b/tests/testlibs/gmock/gmock.pro @@ -0,0 +1,20 @@ +TARGET = gmock +TEMPLATE = lib +CONFIG += static + +CONFIG -= qt + +GMOCK_SRC_DIR = /usr/src/gmock +GMOCK_INCLUDE_DIR = /usr/include/gmock + +SOURCES = $$GMOCK_SRC_DIR/src/gmock-all.cc + + + + +INCLUDEPATH += $$GMOCK_INCLUDE_DIR + +### gcc docs claim that quoted includes should come from local directory, +### but that does not seem to work :/ +QMAKE_CXXFLAGS += -iquote $$GMOCK_SRC_DIR + diff --git a/tests/testlibs/gtest/gtest.pri b/tests/testlibs/gtest/gtest.pri new file mode 100644 index 0000000..4572389 --- /dev/null +++ b/tests/testlibs/gtest/gtest.pri @@ -0,0 +1,5 @@ +GTEST_INCLUDE_DIR = /usr/include/gtest + +INCLUDEPATH += $$GTEST_INCLUDE_DIR + +LIBS += $$PWD/libgtest.a diff --git a/tests/testlibs/gtest/gtest.pro b/tests/testlibs/gtest/gtest.pro new file mode 100644 index 0000000..702d927 --- /dev/null +++ b/tests/testlibs/gtest/gtest.pro @@ -0,0 +1,20 @@ +TARGET = gtest +TEMPLATE = lib +CONFIG += static + +CONFIG -= qt + +GTEST_SRC_DIR = /usr/src/gtest +GTEST_INCLUDE_DIR = /usr/include/gtest + +SOURCES = $$GTEST_SRC_DIR/src/gtest-all.cc + + + + +INCLUDEPATH += $$GTEST_INCLUDE_DIR + +### gcc docs claim that quoted includes should come from local directory, +### but that does not seem to work :/ +QMAKE_CXXFLAGS += -iquote $$GTEST_SRC_DIR + diff --git a/tests/testlibs/mirtestlib/mirtestlib.pri b/tests/testlibs/mirtestlib/mirtestlib.pri new file mode 100644 index 0000000..fb5c510 --- /dev/null +++ b/tests/testlibs/mirtestlib/mirtestlib.pri @@ -0,0 +1,9 @@ +CONFIG += link_pkgconfig +PKGCONFIG += mirclient mirserver + +INCLUDEPATH += $$PWD/../../../src/platforms/mirserver/ +INCLUDEPATH += $$PWD/../../../src/common +INCLUDEPATH += $$PWD/../../../src/modules/ +INCLUDEPATH += $$PWD/../../../src/modules/Unity/Application + +LIBS += $$PWD/libmirtestlib.a diff --git a/tests/testlibs/mirtestlib/mirtestlib.pro b/tests/testlibs/mirtestlib/mirtestlib.pro new file mode 100644 index 0000000..bf9b569 --- /dev/null +++ b/tests/testlibs/mirtestlib/mirtestlib.pro @@ -0,0 +1,8 @@ +TARGET = mirtestlib +CONFIG += c++11 + +TEMPLATE = lib +CONFIG += static +DEFINES = QT_MIR_NO_TRACEPOINTS + +include (../../../src/modules/Unity/Application/Application.pri) diff --git a/tests/testlibs/testlibs.pri b/tests/testlibs/testlibs.pri new file mode 100644 index 0000000..5002c28 --- /dev/null +++ b/tests/testlibs/testlibs.pri @@ -0,0 +1,3 @@ +include (gmock/gmock.pri) +include (gtest/gtest.pri) +include (mirtestlib/mirtestlib.pri) diff --git a/tests/testlibs/testlibs.pro b/tests/testlibs/testlibs.pro new file mode 100644 index 0000000..9ef668b --- /dev/null +++ b/tests/testlibs/testlibs.pro @@ -0,0 +1,6 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + gmock \ + gtest \ + mirtestlib diff --git a/tests/testlibs/testmain.cpp b/tests/testlibs/testmain.cpp new file mode 100644 index 0000000..3f77fc0 --- /dev/null +++ b/tests/testlibs/testmain.cpp @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2015 Canonical, Ltd. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License version 3, as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <gtest/gtest.h> + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/tests/tests.pro b/tests/tests.pro new file mode 100644 index 0000000..d83ec5d --- /dev/null +++ b/tests/tests.pro @@ -0,0 +1,9 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + mirserver \ + modules \ + testlibs + +modules.depends = testlibs +mirserver.depends = testlibs |