aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/.prev_CMakeLists.txt1
-rw-r--r--tests/auto/qml/CMakeLists.txt1
-rw-r--r--tests/auto/qml/qml.pro1
-rw-r--r--tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp21
-rw-r--r--tests/auto/qml/qqmlstatemachine/CMakeLists.txt32
-rw-r--r--tests/auto/qml/qqmlstatemachine/data/cppsignal.qml65
-rw-r--r--tests/auto/qml/qqmlstatemachine/qqmlstatemachine.pro9
-rw-r--r--tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp110
-rw-r--r--tests/auto/qmltest/CMakeLists.txt1
-rw-r--r--tests/auto/qmltest/qmltest.pro1
-rw-r--r--tests/auto/qmltest/statemachine/CMakeLists.txt12
-rw-r--r--tests/auto/qmltest/statemachine/statemachine.pro1
-rw-r--r--tests/auto/qmltest/statemachine/tst_anonymousstate.qml39
-rw-r--r--tests/auto/qmltest/statemachine/tst_enumguard.qml85
-rw-r--r--tests/auto/qmltest/statemachine/tst_guardcondition.qml96
-rw-r--r--tests/auto/qmltest/statemachine/tst_historystate.qml89
-rw-r--r--tests/auto/qmltest/statemachine/tst_initialstate.qml52
-rw-r--r--tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml60
-rw-r--r--tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml66
-rw-r--r--tests/auto/qmltest/statemachine/tst_parallelmachine.qml81
-rw-r--r--tests/auto/qmltest/statemachine/tst_signaltransition.qml71
-rw-r--r--tests/auto/qmltest/statemachine/tst_trafficlight.qml144
-rw-r--r--tests/auto/qmltest/statemachine/tst_triggeredArguments1.qml74
-rw-r--r--tests/auto/qmltest/statemachine/tst_triggeredArguments2.qml74
24 files changed, 0 insertions, 1186 deletions
diff --git a/tests/auto/qml/.prev_CMakeLists.txt b/tests/auto/qml/.prev_CMakeLists.txt
index 3ac0c2f5be..d3c338aa4b 100644
--- a/tests/auto/qml/.prev_CMakeLists.txt
+++ b/tests/auto/qml/.prev_CMakeLists.txt
@@ -28,7 +28,6 @@ add_subdirectory(qtqmlmodules)
add_subdirectory(qquickfolderlistmodel)
add_subdirectory(qqmlapplicationengine)
add_subdirectory(qqmlsettings)
-add_subdirectory(qqmlstatemachine)
add_subdirectory(qmldiskcache)
add_subdirectory(qqmlmetatype)
if(TARGET Qt::Widgets)
diff --git a/tests/auto/qml/CMakeLists.txt b/tests/auto/qml/CMakeLists.txt
index 4466f630e6..3bd4f0334b 100644
--- a/tests/auto/qml/CMakeLists.txt
+++ b/tests/auto/qml/CMakeLists.txt
@@ -28,7 +28,6 @@ add_subdirectory(qtqmlmodules)
add_subdirectory(qquickfolderlistmodel)
add_subdirectory(qqmlapplicationengine)
add_subdirectory(qqmlsettings)
-add_subdirectory(qqmlstatemachine)
add_subdirectory(qmldiskcache)
add_subdirectory(qqmlmetatype)
if(TARGET Qt::Widgets)
diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro
index 714d0a6c84..5409361142 100644
--- a/tests/auto/qml/qml.pro
+++ b/tests/auto/qml/qml.pro
@@ -30,7 +30,6 @@ PUBLICTESTS += \
qquickfolderlistmodel \
qqmlapplicationengine \
qqmlsettings \
- qqmlstatemachine \
qmldiskcache
PRIVATETESTS += \
diff --git a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
index 6f59cca1b1..92a5787bdb 100644
--- a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
+++ b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
@@ -570,27 +570,6 @@ void tst_qqmlmetatype::unregisterAttachedProperties()
QScopedPointer<QObject> obj(c.create());
QVERIFY(obj);
}
-
- qmlClearTypeRegistrations();
- {
- QQmlEngine e;
- QQmlComponent c(&e);
-
- // The extra import shuffles the type IDs around, so that we
- // get a different ID for the attached properties. If the attached
- // properties aren't properly cleared, this will crash.
- c.setData("import QtQml.StateMachine 1.0 \n"
- "import QtQuick 2.2 \n"
- "Item { KeyNavigation.up: null }", dummy);
-
- const QQmlType attachedType = QQmlMetaType::qmlType("QtQuick/KeyNavigation",
- QTypeRevision::fromVersion(2, 2));
- QCOMPARE(attachedType.attachedPropertiesType(QQmlEnginePrivate::get(&e)),
- attachedType.metaObject());
-
- QScopedPointer<QObject> obj(c.create());
- QVERIFY(obj);
- }
}
class Grouped : public QObject
diff --git a/tests/auto/qml/qqmlstatemachine/CMakeLists.txt b/tests/auto/qml/qqmlstatemachine/CMakeLists.txt
deleted file mode 100644
index 4ffe1c3906..0000000000
--- a/tests/auto/qml/qqmlstatemachine/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-# Generated from qqmlstatemachine.pro.
-
-#####################################################################
-## tst_qqmlstatemachine Test:
-#####################################################################
-
-qt_add_test(tst_qqmlstatemachine
- SOURCES
- ../../shared/util.cpp ../../shared/util.h
- tst_qqmlstatemachine.cpp
- INCLUDE_DIRECTORIES
- ../../shared
- PUBLIC_LIBRARIES
- Qt::CorePrivate
- Qt::Gui
- Qt::GuiPrivate
- Qt::QmlPrivate
- Qt::QuickPrivate
-)
-
-## Scopes:
-#####################################################################
-
-qt_extend_target(tst_qqmlstatemachine CONDITION ANDROID OR IOS
- DEFINES
- QT_QMLTEST_DATADIR=\\\":/data\\\"
-)
-
-qt_extend_target(tst_qqmlstatemachine CONDITION NOT ANDROID AND NOT IOS
- DEFINES
- QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
-)
diff --git a/tests/auto/qml/qqmlstatemachine/data/cppsignal.qml b/tests/auto/qml/qqmlstatemachine/data/cppsignal.qml
deleted file mode 100644
index a469185cbc..0000000000
--- a/tests/auto/qml/qqmlstatemachine/data/cppsignal.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQml 2.0
-
-import QtQml.StateMachine 1.0
-
-import CppObjectEnum 1.0
-
-StateMachine {
- id: stateMachine
- initialState: state0
-
- State {
- id: state0
- SignalTransition {
- targetState: state1
- signal: _cppObject.mySignal
- // signalState is mySignal's parameter
- guard: signalState === CppObject.State1
- }
- }
-
- State {
- id: state1
- SignalTransition {
- targetState: state2
- signal: _cppObject.mySignal
- // signalState is mySignal's parameter
- guard: signalState === CppObject.State2
- }
- onEntered: _cppObject.objectState = CppObject.State1
- }
-
- FinalState {
- id: state2
- onEntered: _cppObject.objectState = CppObject.State2
- }
- Component.onCompleted: stateMachine.running = true
-}
diff --git a/tests/auto/qml/qqmlstatemachine/qqmlstatemachine.pro b/tests/auto/qml/qqmlstatemachine/qqmlstatemachine.pro
deleted file mode 100644
index 635f2fa5e0..0000000000
--- a/tests/auto/qml/qqmlstatemachine/qqmlstatemachine.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qqmlstatemachine
-osx:CONFIG -= app_bundle
-
-SOURCES += tst_qqmlstatemachine.cpp
-
-include (../../shared/util.pri)
-
-QT += core-private gui-private qml-private quick-private gui testlib
diff --git a/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp b/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp
deleted file mode 100644
index a6f0d65453..0000000000
--- a/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <QQmlComponent>
-#include <QQmlContext>
-#include <QQmlEngine>
-#include <QTest>
-#include "../../shared/util.h"
-
-class tst_qqmlstatemachine : public QQmlDataTest
-{
- Q_OBJECT
-public:
- tst_qqmlstatemachine();
-
-private slots:
- void tst_cppObjectSignal();
-};
-
-
-class CppObject : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(ObjectState objectState READ objectState WRITE setObjectState NOTIFY objectStateChanged)
- Q_ENUMS(ObjectState)
-public:
- enum ObjectState {
- State0,
- State1,
- State2
- };
-
-public:
- CppObject() {}
-
- ObjectState objectState() const { return m_objectState; }
- void setObjectState(ObjectState objectState) { m_objectState = objectState; emit objectStateChanged();}
-
-signals:
- void objectStateChanged();
- void mySignal(int signalState);
-
-private:
- ObjectState m_objectState = State0;
-};
-
-tst_qqmlstatemachine::tst_qqmlstatemachine()
-{
- QVERIFY(-1 != qmlRegisterUncreatableType<CppObject>("CppObjectEnum", 1, 0, "CppObject", QString()));
-}
-
-void tst_qqmlstatemachine::tst_cppObjectSignal()
-{
- CppObject cppObject;
- QQmlEngine engine;
- QQmlComponent component(&engine, testFileUrl("cppsignal.qml"));
- QVERIFY2(!component.isError(), qPrintable(component.errorString()));
-
- QQmlContext *ctxt = engine.rootContext();
- ctxt->setContextProperty("_cppObject", &cppObject);
- QScopedPointer<QObject> rootObject(component.create());
- QVERIFY(rootObject != nullptr);
-
- // wait for state machine to start
- QTRY_VERIFY(rootObject->property("running").toBool());
-
- // emit signal from cpp
- emit cppObject.mySignal(CppObject::State1);
-
- // check if the signal was propagated
- QTRY_COMPARE(cppObject.objectState(), CppObject::State1);
-
- // emit signal from cpp
- emit cppObject.mySignal(CppObject::State2);
-
- // check if the signal was propagated
- QTRY_COMPARE(cppObject.objectState(), CppObject::State2);
-
- // wait for state machine to finish
- QTRY_VERIFY(!rootObject->property("running").toBool());
-}
-
-
-QTEST_MAIN(tst_qqmlstatemachine)
-
-#include "tst_qqmlstatemachine.moc"
diff --git a/tests/auto/qmltest/CMakeLists.txt b/tests/auto/qmltest/CMakeLists.txt
index 184c1c1216..ac950263b5 100644
--- a/tests/auto/qmltest/CMakeLists.txt
+++ b/tests/auto/qmltest/CMakeLists.txt
@@ -23,7 +23,6 @@ add_subdirectory(rectangle)
add_subdirectory(selftests)
add_subdirectory(shadersource)
add_subdirectory(stability)
-add_subdirectory(statemachine)
add_subdirectory(text)
add_subdirectory(textedit)
add_subdirectory(textinput)
diff --git a/tests/auto/qmltest/qmltest.pro b/tests/auto/qmltest/qmltest.pro
index 8ad1541cbc..3463d1735f 100644
--- a/tests/auto/qmltest/qmltest.pro
+++ b/tests/auto/qmltest/qmltest.pro
@@ -23,7 +23,6 @@ SUBDIRS += \
selftests \
shadersource \
stability \
- statemachine \
text \
textedit \
textinput \
diff --git a/tests/auto/qmltest/statemachine/CMakeLists.txt b/tests/auto/qmltest/statemachine/CMakeLists.txt
deleted file mode 100644
index fafaf382d8..0000000000
--- a/tests/auto/qmltest/statemachine/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-# Generated from statemachine.pro.
-
-#####################################################################
-## statemachine Test:
-#####################################################################
-
-qt_add_test(statemachine
- GUI
- QMLTEST
- PUBLIC_LIBRARIES
- Qt::Gui
-)
diff --git a/tests/auto/qmltest/statemachine/statemachine.pro b/tests/auto/qmltest/statemachine/statemachine.pro
deleted file mode 100644
index a7938e7003..0000000000
--- a/tests/auto/qmltest/statemachine/statemachine.pro
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG += qmltestcase
diff --git a/tests/auto/qmltest/statemachine/tst_anonymousstate.qml b/tests/auto/qmltest/statemachine/tst_anonymousstate.qml
deleted file mode 100644
index 65ce58860c..0000000000
--- a/tests/auto/qmltest/statemachine/tst_anonymousstate.qml
+++ /dev/null
@@ -1,39 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtTest 1.1
-import QtQml.StateMachine 1.0
-
-TestCase {
- StateMachine {
- State {
- }
- }
- name: "anonymousState"
- // no real tests, just make sure it runs
-}
diff --git a/tests/auto/qmltest/statemachine/tst_enumguard.qml b/tests/auto/qmltest/statemachine/tst_enumguard.qml
deleted file mode 100644
index d871ef980a..0000000000
--- a/tests/auto/qmltest/statemachine/tst_enumguard.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtTest 1.1
-import QtQml.StateMachine 1.0
-
-TestCase {
- id: testCase
- StateMachine {
- id: machine
- initialState: startState
- State {
- id: startState
- SignalTransition {
- id: signalTrans
- signal: testCase.mysignal
- guard: alignment === QState.ParallelStates
- targetState: finalState
- }
- }
- FinalState {
- id: finalState
- }
- }
-
- SignalSpy {
- id: finalStateActive
- target: finalState
- signalName: "activeChanged"
- }
-
- signal mysignal(int alignment)
-
- name: "testEnumGuard"
- function test_enumGuard()
- {
- // Start statemachine, should not have reached finalState yet.
- machine.start()
- tryCompare(finalStateActive, "count", 0)
- tryCompare(machine, "running", true)
-
- // Emit the signalTrans.signal which will evaluate the guard. The
- // guard should return true, finalState be reached and the
- // statemachine be stopped.
- testCase.mysignal(QState.ParallelStates)
- tryCompare(finalStateActive, "count", 1)
- tryCompare(machine, "running", false)
-
- // Restart machine.
- machine.start()
- tryCompare(machine, "running", true)
- tryCompare(finalStateActive, "count", 2)
-
- // Emit signal that makes the signalTrans.guard return false. The
- // finalState should not have been triggered.
- testCase.mysignal(QState.ExclusiveStates)
- tryCompare(finalStateActive, "count", 2)
- tryCompare(machine, "running", true)
- }
-}
diff --git a/tests/auto/qmltest/statemachine/tst_guardcondition.qml b/tests/auto/qmltest/statemachine/tst_guardcondition.qml
deleted file mode 100644
index e364b38c81..0000000000
--- a/tests/auto/qmltest/statemachine/tst_guardcondition.qml
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtTest 1.1
-import QtQml.StateMachine 1.0
-
-TestCase {
- id: testCase
- StateMachine {
- id: machine
- initialState: startState
- State {
- id: startState
- SignalTransition {
- id: signalTrans
- signal: testCase.mysignal
- guard: mystr == "test1"
- targetState: finalState
- }
- }
- FinalState {
- id: finalState
- }
- }
-
- SignalSpy {
- id: finalStateActive
- target: finalState
- signalName: "activeChanged"
- }
-
- signal mysignal(string mystr, bool mybool, int myint)
-
- name: "testGuardCondition"
- function test_guardCondition()
- {
- // Start statemachine, should not have reached finalState yet.
- machine.start()
- tryCompare(finalStateActive, "count", 0)
- tryCompare(machine, "running", true)
-
- // Emit the signalTrans.signal which will evaluate the guard. The
- // guard should return true, finalState be reached and the
- // statemachine be stopped.
- testCase.mysignal("test1", true, 2)
- tryCompare(finalStateActive, "count", 1)
- tryCompare(machine, "running", false)
-
- // Restart machine.
- machine.start()
- tryCompare(machine, "running", true)
- tryCompare(finalStateActive, "count", 2)
-
- // Emit signal that makes the signalTrans.guard return false. The
- // finalState should not have been triggered.
- testCase.mysignal("test2", true, 2)
- tryCompare(finalStateActive, "count", 2)
- tryCompare(machine, "running", true)
-
- // Change the guard in javascript to test that boolean true/false
- // works as expected.
- signalTrans.guard = false;
- testCase.mysignal("test1", true, 2)
- tryCompare(finalStateActive, "count", 2)
- tryCompare(machine, "running", true)
- signalTrans.guard = true;
- testCase.mysignal("test1", true, 2)
- tryCompare(finalStateActive, "count", 3)
- tryCompare(machine, "running", false)
- }
-}
diff --git a/tests/auto/qmltest/statemachine/tst_historystate.qml b/tests/auto/qmltest/statemachine/tst_historystate.qml
deleted file mode 100644
index ba94b85b10..0000000000
--- a/tests/auto/qmltest/statemachine/tst_historystate.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtTest 1.1
-import QtQml.StateMachine 1.0
-
-TestCase {
-
- StateMachine {
- id: stateMachine
- initialState: historyState1
-
- State {
- id: state1
- SignalTransition {
- id: st1
- targetState: state2
- }
- }
-
- State {
- id: state2
- initialState: historyState2
- HistoryState {
- id: historyState2
- defaultState: state21
- }
- State {
- id: state21
- }
- }
-
- HistoryState {
- id: historyState1
- defaultState: state1
- }
- }
-
- SignalSpy {
- id: state1SpyActive
- target: state1
- signalName: "activeChanged"
- }
-
- SignalSpy {
- id: state2SpyActive
- target: state2
- signalName: "activeChanged"
- }
-
-
- function test_historyStateAsInitialState()
- {
- stateMachine.start();
- tryCompare(stateMachine, "running", true);
- tryCompare(state1SpyActive, "count" , 1);
- tryCompare(state2SpyActive, "count" , 0);
- st1.invoke();
- tryCompare(state1SpyActive, "count" , 2);
- tryCompare(state2SpyActive, "count" , 1);
- tryCompare(state21, "active", true);
- tryCompare(state1, "active", false);
- }
-}
diff --git a/tests/auto/qmltest/statemachine/tst_initialstate.qml b/tests/auto/qmltest/statemachine/tst_initialstate.qml
deleted file mode 100644
index ba5db1976c..0000000000
--- a/tests/auto/qmltest/statemachine/tst_initialstate.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtTest 1.1
-import QtQml.StateMachine 1.0
-
-TestCase {
- StateMachine {
- id: myStateMachine
- initialState: myState;
- running: true
- State {
- id: myState
- }
- }
-
- name: "initialStateTest"
- function test_initialState() {
- tryCompare(myStateMachine, "running", true);
- compare(myState.active, true);
- myStateMachine.running = false;
- tryCompare(myStateMachine, "running", false);
- myStateMachine.running = true;
- tryCompare(myStateMachine, "running", true);
- tryCompare(myState, "active", true);
- }
-}
diff --git a/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml b/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml
deleted file mode 100644
index f506ed72b2..0000000000
--- a/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtTest 1.1
-import QtQml.StateMachine 1.0
-
-TestCase {
- StateMachine {
- id: myStateMachine
- initialState: parentState
- State {
- id: parentState
- initialState: childState1
- State {
- id: childState1
- }
- State {
- id: childState2
- }
- }
- }
- name: "nestedInitalStates"
-
- function test_nestedInitalStates() {
- compare(myStateMachine.running, false);
- compare(parentState.active, false);
- compare(childState1.active, false);
- compare(childState2.active, false);
- myStateMachine.start();
- tryCompare(myStateMachine, "running", true);
- tryCompare(parentState, "active", true);
- tryCompare(childState1, "active", true);
- compare(childState2.active, false);
- }
-}
diff --git a/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml b/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml
deleted file mode 100644
index 0a63092c3c..0000000000
--- a/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtTest 1.1
-import QtQml.StateMachine 1.0
-
-TestCase {
- StateMachine {
- id: myStateMachine
- initialState: parentState
- State {
- id: parentState
- initialState: childStateMachine
- StateMachine {
- id: childStateMachine
- initialState: childState2
- State {
- id: childState1
- }
- State {
- id: childState2
- }
- }
- }
- }
- name: "nestedStateMachine"
-
- function test_nestedStateMachine() {
- compare(myStateMachine.running, false);
- compare(parentState.active, false);
- compare(childStateMachine.running, false);
- compare(childState1.active, false);
- compare(childState2.active, false);
- myStateMachine.start();
- tryCompare(myStateMachine, "running", true);
- tryCompare(parentState, "active", true);
- tryCompare(childStateMachine, "running", true);
- tryCompare(childState1, "active", false);
- tryCompare(childState2, "active", true);
- }
-}
diff --git a/tests/auto/qmltest/statemachine/tst_parallelmachine.qml b/tests/auto/qmltest/statemachine/tst_parallelmachine.qml
deleted file mode 100644
index eb996c7718..0000000000
--- a/tests/auto/qmltest/statemachine/tst_parallelmachine.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtTest 1.1
-import QtQml.StateMachine 1.0
-
-TestCase {
- StateMachine {
- id: myStateMachine
- initialState: rootState
- State {
- id: rootState
- childMode: State.ParallelStates
- State {
- id: childState1
- childMode: State.ParallelStates
- State {
- id: childState11
- }
- State {
- id: childState12
- }
- }
- State {
- id: childState2
- initialState: childState21
- State {
- id: childState21
- }
- State {
- id: childState22
- }
- }
- }
- }
- name: "nestedParallelMachineStates"
-
- function test_nestedInitalStates() {
- // uncomment me after vm problems are fixed.
- // compare(myStateMachine.running, false);
- compare(childState1.active, false);
- compare(childState11.active, false);
- compare(childState12.active, false);
- compare(childState2.active, false);
- compare(childState21.active, false);
- compare(childState22.active, false);
- myStateMachine.start();
- tryCompare(myStateMachine, "running", true);
- tryCompare(childState1, "active", true);
- tryCompare(childState11, "active", true);
- tryCompare(childState12, "active", true);
- tryCompare(childState2, "active", true);
- tryCompare(childState21, "active", true);
- tryCompare(childState22, "active", false);
- }
-}
diff --git a/tests/auto/qmltest/statemachine/tst_signaltransition.qml b/tests/auto/qmltest/statemachine/tst_signaltransition.qml
deleted file mode 100644
index a57826855a..0000000000
--- a/tests/auto/qmltest/statemachine/tst_signaltransition.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Ford Motor Company
-** Copyright (C) 2017 The Qt Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtTest 1.1
-import QtQml.StateMachine 1.0
-
-TestCase {
- id: testCase
- StateMachine {
- id: machine
- initialState: startState
- State {
- id: startState
- SignalTransition {
- id: signalTrans
- signal: testCase.onMysignal
- targetState: finalState
- }
- }
- FinalState {
- id: finalState
- }
- }
-
- SignalSpy {
- id: finalStateActive
- target: finalState
- signalName: "activeChanged"
- }
-
- signal mysignal()
-
- name: "testSignalTransition"
- function test_signalTransition()
- {
- // Start statemachine, should not have reached finalState yet.
- machine.start()
- tryCompare(finalStateActive, "count", 0)
- tryCompare(machine, "running", true)
-
- testCase.mysignal()
- tryCompare(finalStateActive, "count", 1)
- tryCompare(machine, "running", false)
- }
-}
diff --git a/tests/auto/qmltest/statemachine/tst_trafficlight.qml b/tests/auto/qmltest/statemachine/tst_trafficlight.qml
deleted file mode 100644
index ebbab0a5f4..0000000000
--- a/tests/auto/qmltest/statemachine/tst_trafficlight.qml
+++ /dev/null
@@ -1,144 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtTest 1.1
-import QtQml.StateMachine 1.0
-
-TestCase {
- StateMachine {
- id: machine
- initialState: red
- FinalState {
- id: finalState
- }
-
- State {
- id: red
- initialState: justRed
- State {
- id: justRed
- SignalTransition {
- id: e1
- targetState: waitingForGreen
- }
- SignalTransition {
- id: finalSignal
- targetState: finalState
- }
- }
- State {
- id: waitingForGreen
- TimeoutTransition {
- id: e2
- targetState: yellowred
- timeout: 30
- }
- }
- }
- State {
- id: yellowred
- TimeoutTransition {
- id: e3
- targetState: green
- timeout: 10
- }
- }
- State {
- id: green
- TimeoutTransition {
- id: e4
- targetState: yellow
- timeout: 50
- }
- }
- State {
- id: yellow
- TimeoutTransition {
- id: e5
- targetState: red
- timeout: 10
- }
- }
- }
-
- SignalSpy {
- id: machineSpyRunning
- target: machine
- signalName: "runningChanged"
- }
-
- SignalSpy {
- id: redSpyActive
- target: red
- signalName: "activeChanged"
- }
-
- SignalSpy {
- id: yellowredSpyActive
- target: yellowred
- signalName: "activeChanged"
- }
-
- SignalSpy {
- id: greenSpyActive
- target: green
- signalName: "activeChanged"
- }
-
- SignalSpy {
- id: yellowSpyActive
- target: yellow
- signalName: "activeChanged"
- }
-
-
- name: "testTrafficLight"
- function test_trafficLight()
- {
- var i = 1;
- machine.start();
- tryCompare(machine, "running", true);
- tryCompare(machineSpyRunning, "count", 1);
- tryCompare(redSpyActive, "count", 1);
- for (; i <= 5; ++i) {
- e1.invoke();
- tryCompare(yellowredSpyActive, "count", i * 2);
- tryCompare(greenSpyActive, "count", i * 2);
- tryCompare(redSpyActive, "count", i * 2 + 1);
- tryCompare(yellowSpyActive, "count", i * 2);
- }
- finalSignal.guard = false;
- finalSignal.invoke();
- wait(100);
- tryCompare(machine, "running", true);
- finalSignal.guard = true;
- finalSignal.invoke();
- tryCompare(machine, "running", false);
- tryCompare(redSpyActive, "count", i * 2);
- }
-}
diff --git a/tests/auto/qmltest/statemachine/tst_triggeredArguments1.qml b/tests/auto/qmltest/statemachine/tst_triggeredArguments1.qml
deleted file mode 100644
index 34c172aded..0000000000
--- a/tests/auto/qmltest/statemachine/tst_triggeredArguments1.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtTest 1.1
-import QtQml.StateMachine 1.0
-
-TestCase {
- id: testCase
-
- property string mystr
- property bool mybool
- property int myint
-
- StateMachine {
- id: machine
- initialState: startState
- running: true
- State {
- id: startState
- SignalTransition {
- id: signalTrans
- signal: testCase.mysignal
- onTriggered: {
- testCase.mystr = mystr
- testCase.mybool = mybool
- testCase.myint = myint
- }
- targetState: finalState
- }
- }
- FinalState {
- id: finalState
- }
- }
-
- signal mysignal(string mystr, bool mybool, int myint)
-
- name: "testTriggeredArguments1"
- function test_triggeredArguments()
- {
- tryCompare(startState, "active", true)
-
- // Emit the signalTrans.signal
- testCase.mysignal("test1", true, 2)
- compare(testCase.mystr, "test1")
- compare(testCase.mybool, true)
- compare(testCase.myint, 2)
- }
-}
diff --git a/tests/auto/qmltest/statemachine/tst_triggeredArguments2.qml b/tests/auto/qmltest/statemachine/tst_triggeredArguments2.qml
deleted file mode 100644
index f23cc14152..0000000000
--- a/tests/auto/qmltest/statemachine/tst_triggeredArguments2.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Ford Motor Company
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtTest 1.1
-import QtQml.StateMachine 1.0
-
-TestCase {
- id: testCase
-
- property string mystr
- property bool mybool
- property int myint
-
- StateMachine {
- id: machine
- initialState: startState
- running: true
- State {
- id: startState
- SignalTransition {
- id: signalTrans
- signal: testCase.mysignal
- onTriggered: function(strarg, boolarg, intarg) {
- testCase.mystr = strarg
- testCase.mybool = boolarg
- testCase.myint = intarg
- }
- targetState: finalState
- }
- }
- FinalState {
- id: finalState
- }
- }
-
- signal mysignal(string mystr, bool mybool, int myint)
-
- name: "testTriggeredArguments2"
- function test_triggeredArguments()
- {
- tryCompare(startState, "active", true)
-
- // Emit the signalTrans.signal
- testCase.mysignal("test1", true, 2)
- compare(testCase.mystr, "test1")
- compare(testCase.mybool, true)
- compare(testCase.myint, 2)
- }
-}