From a0c48081516f8fd6adae16c57a4f851bb139e36d Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 20 Feb 2017 16:52:00 +0100 Subject: Normalize the component package structure --- tests/CMakeLists.txt | 31 +++++++++++++++++++++++++++++++ tests/kubetestrunner.cpp | 6 ++++++ tests/tst_applicationstart.qml | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 tests/CMakeLists.txt create mode 100644 tests/kubetestrunner.cpp create mode 100644 tests/tst_applicationstart.qml (limited to 'tests') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..ac19eaaa --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,31 @@ +project(tests) + +cmake_minimum_required(VERSION 2.8.12) +cmake_policy(SET CMP0063 NEW) + +include(CPack) +include(FeatureSummary) +find_package(PkgConfig) + +################# set KDE specific information ################# + +find_package(ECM 0.0.8 REQUIRED NO_MODULE) + +# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) + +include(KDEInstallDirs) +include(KDECMakeSettings) +include(KDECompilerSettings) + +find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Widgets WebEngine QuickTest) + +set (QT_MIN_VERSION "5.6.0") + +# build testrunner +add_executable(kubetestrunner kubetestrunner.cpp) +qt5_use_modules(kubetestrunner Gui Quick Widgets WebEngine QuickTest) + +# tests +add_test(NAME qmltests COMMAND kubetestrunner WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + diff --git a/tests/kubetestrunner.cpp b/tests/kubetestrunner.cpp new file mode 100644 index 00000000..c0bee01a --- /dev/null +++ b/tests/kubetestrunner.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) +{ + return quick_test_main(argc, argv, "example", 0); +} diff --git a/tests/tst_applicationstart.qml b/tests/tst_applicationstart.qml new file mode 100644 index 00000000..15809395 --- /dev/null +++ b/tests/tst_applicationstart.qml @@ -0,0 +1,38 @@ +/* + * Copyright 2017 Christian Mollekopf + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.7 +import QtQuick.Controls 2.0 +import QtQuick.Window 2.1 +import QtTest 1.0 +import org.kube.components.mail 1.0 as KubeMail + + +TestCase { + id: testCase + width: 400 + height: 400 + name: "ApplicationStart" + + KubeMail.Mail { + } + + function test_stuff() { + } +} -- cgit v1.2.3