From 2d5f37460b70715c5ffd0fc6b4dc8b0975ed0cc5 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 19 Dec 2017 15:10:02 +0100 Subject: Basic test harness for views --- components/kube/tests/tst_accountsview.qml | 37 ++++++++++++++++++++++++++++++ components/kube/tests/tst_composerview.qml | 37 ++++++++++++++++++++++++++++++ components/kube/tests/tst_mailview.qml | 37 ++++++++++++++++++++++++++++++ tests/kubetestrunner.cpp | 1 + 4 files changed, 112 insertions(+) create mode 100644 components/kube/tests/tst_accountsview.qml create mode 100644 components/kube/tests/tst_composerview.qml create mode 100644 components/kube/tests/tst_mailview.qml diff --git a/components/kube/tests/tst_accountsview.qml b/components/kube/tests/tst_accountsview.qml new file mode 100644 index 00000000..428bb4cc --- /dev/null +++ b/components/kube/tests/tst_accountsview.qml @@ -0,0 +1,37 @@ +/* + * 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 QtTest 1.0 +import "../qml" + +TestCase { + id: testCase + width: 400 + height: 400 + name: "AccountsView" + + AccountsView { + id: accountsView + } + + function test_start() { + verify(accountsView) + } +} diff --git a/components/kube/tests/tst_composerview.qml b/components/kube/tests/tst_composerview.qml new file mode 100644 index 00000000..81ad5eaa --- /dev/null +++ b/components/kube/tests/tst_composerview.qml @@ -0,0 +1,37 @@ +/* + * 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 QtTest 1.0 +import "../qml" + +TestCase { + id: testCase + width: 400 + height: 400 + name: "ComposerView" + + ComposerView { + id: composer + } + + function test_start() { + verify(composer) + } +} diff --git a/components/kube/tests/tst_mailview.qml b/components/kube/tests/tst_mailview.qml new file mode 100644 index 00000000..f31d574d --- /dev/null +++ b/components/kube/tests/tst_mailview.qml @@ -0,0 +1,37 @@ +/* + * 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 QtTest 1.0 +import "../qml" + +TestCase { + id: testCase + width: 400 + height: 400 + name: "MailView" + + MailView { + id: mailView + } + + function test_start() { + verify(mailView) + } +} diff --git a/tests/kubetestrunner.cpp b/tests/kubetestrunner.cpp index bb8fb242..b6c88341 100644 --- a/tests/kubetestrunner.cpp +++ b/tests/kubetestrunner.cpp @@ -3,6 +3,7 @@ int main(int argc, char **argv) { + QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); Sink::Test::initTest(); QTEST_ADD_GPU_BLACKLIST_SUPPORT QTEST_SET_MAIN_SOURCE_PATH -- cgit v1.2.3