summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Increase timeout for send-data/send1 testv5.13.0-rc3v5.13.0-rc2v5.13.0-rc1v5.13.0-beta4v5.13.0Ulf Hermann2019-05-131-1/+1
| | | | | | | Fixes: QTBUG-75684 Change-Id: I3b379c8f9ee9e17614e663d8842ae4329109c4a4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Don't suppress <log> tags with missing or bad exprUlf Hermann2018-11-143-0/+21
| | | | | | | | | Rather, output an empty string as message in this case. Ignoring log instructions is highly confusing. Change-Id: Iebb30ffd3ade33f1277f3073f015127a99170e40 Task-number: QTBUG-71746 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Fix header inclusion in tst_scion.cppUlf Hermann2018-07-131-1/+1
| | | | | | | | What we are looking for here is QScxmlStateMachine, not the ecmascript datamodel. Change-Id: I5c15e38ffb5a6cf6ec1fa8fcf93d2e3f5a093115 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-201-0/+3
|\ | | | | | | | | | | | | Conflicts: src/scxml/qscxmlcompiler.cpp Change-Id: I4abda984e523cdf2a0810ed7dc1773e055746e18
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-151-0/+3
| |\ | | | | | | | | | Change-Id: Id4d40ec35ed8f13c7704d737312205f334139129
| | * Output a better warning when runtime-loading malformed SCXMLUlf Hermann2017-11-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | The document might technically have a root element. We might not be able to read it, though. Also, output all errors without quotes. Change-Id: I8133e322e452ea0c3d079b5cbe23aed2f2952b3e Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Replace Q_NULLPTR with nullptrKevin Funk2017-09-271-3/+3
| | | | | | | | | | | | | | | Change-Id: I6bee476e2f467b57ee8e4bba1e780cf79c7a460e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Replace Q_DECL_FINAL with finalKevin Funk2017-09-221-1/+1
| | | | | | | | | | | | | | | Change-Id: I074b69d728dfb597f4eb68cf516a2591658303ba Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-211-1/+1
|/ / | | | | | | | | Change-Id: I68e08fd214ad3dbf4de9c9e23b1725950925c1fb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* / Pre-declare some meta types in the headersUlf Hermann2017-08-174-8/+0
|/ | | | | | | | | It doesn't make much sense to declare the meta type for QScxmlError in all the tests. Also, types exposed through Q_PROPERTY should be declared. Change-Id: Ibb08440e1f40845ea779e1c2a3882bc1b1e0a935 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Fix the crash when sending an event into not running seviceJarek Kobus2017-08-153-1/+67
| | | | | | Task-number: QTBUG-61484 Change-Id: I3cebb3378a73d16901b18ec9465bcacf2e5ad486 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix emission of state changed signalsJarek Kobus2017-08-143-0/+33
| | | | | | | | | | | | | | The state index is not the same as its changed signal index. The changed signal is not being generated for history states. The current fix is that we create a hash cache of state index into the signal index of its appropriate signal just after we set the table data for the state machine. Task-number: QTBUG-61243 Change-Id: I778adaf6c2d626be17c50b558f93ec0035ea3325 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-103-7/+119
|\ | | | | | | Change-Id: I467bf942ab818d350a1c08c8567566b9bbfcb5a5
| * Make the content/expr test compliantUlf Hermann2017-02-082-7/+16
| | | | | | | | | | | | | | | | | | We cannot add both an 'event' attribute and a <content> element to <send>, and we cannot match anonymous events in transitions. We can receive them in the C++ code, though. Change-Id: Ieef7aba3fee79181c56002a0334f9f8e4af4df14 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
| * Add a way to verify events received from a test caseUlf Hermann2017-02-081-0/+103
| | | | | | | | | | Change-Id: I1012cb5c1b38c23af32197c48459668dc64144b2 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | Make QScxmlScxmlService::stateMachine a Q_PROPERTYUlf Hermann2017-02-243-0/+96
|/ | | | | | | | Without this, the invoke example doesn't work. Change-Id: I8c4ae9b21e1164946f2a60777b9e9905f2b51237 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Emit runningChanged signal when running changesJan Arne Petersen2016-12-081-0/+21
| | | | | | | | | The QScxmlStateMachine::runningChanged signal was never emitted. Emit it when the running property changes. Change-Id: I9b6cb8d48c9c8d893b0af2b8f87ecd74f4e64055 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* Drop the --no-c++11 parameter from qscxmlcUlf Hermann2016-11-231-1/+0
| | | | | | | We don't support C++98 anymore, so this is useless. Change-Id: Ie918567253af6d9309b601c7cfbc0205ec888048 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Add QScxmlStateMachineInfo::initialTransition()Kevin Funk2016-11-221-0/+15
| | | | | | | Also add tests Change-Id: Ib94bd6c82129e77378caf2c53c3c8d443c6cc334 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add QScxmlStateMachineInfo::stateParent() + testsKevin Funk2016-11-221-0/+8
| | | | | Change-Id: I3d97e1d4019c68859c9551e4a60d39348cf7ebe1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Distinguish invalid state/transition types from IDs and drop root stateUlf Hermann2016-11-221-3/+3
| | | | | | | | | | | | | | | Types and IDs are conceptually different and shouldn't be mixed up this way. Also, as far as I can see, there is no real need to invent a synthetic root state. Leaving that out saves us a lot of inconsistency (e.g. the root state didn't show up in allStates(), and you couldn't ask it for stateChildren()). Without the root state some transitions originate from the invalid state, but that is an equally good characterization for initial transitions as the synthetic root state. Change-Id: I3738df08d0e3702433dabd3fb837f0ddaea57465 Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Add QScxmlStateMachineInfo::transitionEvents()Jan Arne Petersen2016-11-221-0/+9
| | | | | | | Also add corresponding test for the new method. Change-Id: I09c4bb59df06bd33ae8a8667194d5f5d96765e2e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add CMake macros for statechart code generationKevin Funk2016-11-183-0/+68
| | | | | | | | | | | | | | | Introduce qt5_add_statecharts, used exactly like qt5_add_resources. Example usage: qt5_add_statecharts(MAIN_SRCS ../../compiled/connection.scxml ) Add tests Change-Id: If24ea872815e053582b0d7b8d89c4bbfb1162f88 Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Rename QScxmlParser to QScxmlCompilerUlf Hermann2016-10-144-10/+10
| | | | | | | | | It creates an executable representation from an XML description, so it is a compiler and not merely a parser. The name should reflect this. Change-Id: I459445706207b3afae64b3f803c9beae83114bb6 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Use std::function for onEntry and onExit return typesUlf Hermann2016-10-144-8/+2
| | | | | | | | | This allows us to drop the C++14 requirement. As onEntry and onExit are template functions we don't need to care about (not) using the standard library for them. Change-Id: Ie776e04f7e1771914c9f48d2440ef445d87d64c0 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* State machine interrogation interfaceErik Verbruggen2016-10-075-1/+270
| | | | | | | | | | This interface can be used to get all states and transitions from an SCXML state machine. It will also signal which states are entered and exited for each microstep, and which transitions are taken by the microstep. Change-Id: I4bb936add6b3fd87a322093b8aee66521bb294a4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Replace Q_FOREACH/foreach with ranged-forErik Verbruggen2016-09-252-3/+4
| | | | | Change-Id: I7b4d13a49577a7d984727722ff2ae4458eab2d6e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Simplify QScxmlParserUlf Hermann2016-09-221-4/+1
| | | | | | | | | | | | | | There is little point in exposing the intermediate steps of parsing, instantiating the state machine, and instantiating the data model to the user. One method to do all of this is enough and relieves us from the burden of maintaining binary compatibility for multiple poorly named extra methods. Also, drop addError(). Who wants to add errors to the parser from the outside? Change-Id: I4a2faba8c5f130e8a95675ebbdb747df7afdee73 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Add onEntry and onExit templates to QScxmlStateMachinesUlf Hermann2016-09-124-3/+129
| | | | | | | | | These help to avoid repeating "if (isInState) ..." if you only want to execute a handler when a state is entered, or "if (!isInState) ..." if you want to execute it only when a state is left. Change-Id: I0a73585591163dd2741b2d9d4897ee50e9623853 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Replace runningSubStateMachines() with invokableServices()Ulf Hermann2016-08-301-17/+18
| | | | | | | | | | | SCXML allows for different kinds of services, not only other state machines. We might add support for them in the future. From invoked state machines you can always get the actual state machine via the respective property. To make this easily accessible, we make the invoked services QObjects. Change-Id: Idd07783730bc98bded404dc2c2c3bd241180c1f4 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Remove unneeded includesJarek Kobus2016-08-231-1/+0
| | | | | Change-Id: I1c8388b6a912f631affe8bd3752e20bdc8d5eb28 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Get rid of qt modeJarek Kobus2016-08-2312-110/+12
| | | | | Change-Id: Id8cc29a9a27f571f063b1cec51e534a3c762f2c6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Support <content expr="...">Ulf Hermann2016-08-192-0/+32
| | | | | | | | Previously, the expressions were never evaluated, but just taken as strings. Change-Id: Id506670cd0e954919941b5cf7c496b7c57f04711 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* In Qt mode reject documents with events that cannot be mapped to slotsUlf Hermann2016-08-182-1/+3
| | | | | | | | | | | This severely limits the use of Qt mode, as hierarchical events like done.state.foo cannot appear in the document anymore. However, it makes the rules about what is and what is not legal in Qt mode more consistent. Task-number: QTBUG-53435 Change-Id: I08b90f34c651a57d86607eea2a38f5bd1f73b8b3 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Make generated signals publicUlf Hermann2016-08-091-0/+12
| | | | | | | | | | | Access control for signals cannot be enforced anyway and QML has a bug that makes the type compiler crash if anything tries to connect to a private signal. Besides, they should be accessible from other code. Change-Id: I9af527f012e3ea8538107b74ce20157f01fef6ae Task-number: QTBUG-51817 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Remove misleading qt:signal declarationsUlf Hermann2016-08-091-1/+1
| | | | | | | If the document isn't parsed in Qt mode they have no effect. Change-Id: I3c58380b903f33cffc9958e18b009abf9ca5e7d3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Fix test after change in qtbaseErik Verbruggen2016-08-031-1/+1
| | | | | | | | | | | | After d4302ec6936b8b3799a266b640b5d116b3296b29, the QXmlStreamReader will reject more invalid characters for an NMToken. So, instead of the SCXML parser giving an error, the stream reader will give an error. This changes checks for that error. Task-number: QTBUG-55106 Change-Id: Ie8d43b040f0bbe16894ed6ad88157cae2a04fb7e Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Don't generate properties and getters for sub state machinesJarek Kobus2016-07-291-4/+6
| | | | | | | Now we have a generic API for it. Change-Id: I5e48f52b9d27ba3913db92ba238d64a732bb1bd8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Provide API for access to all running sub state machinesJarek Kobus2016-07-294-1/+56
| | | | | Change-Id: Ia7209a79dfa0e49c5ec11132d8461d05070e073b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Generate unique class names for sub machinesJarek Kobus2016-07-282-2/+2
| | | | | Change-Id: I3a83e12a611a6c4c2ab86a45b44e168b62bb7da3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add a test for the state machine with a few sub machinesJarek Kobus2016-07-275-1/+32
| | | | | | | The top state machine refers twice to the same sub machine file. Change-Id: I113740cff544179e3b518d40ef9af21092508622 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Auto-include qscxmlc in module configUlf Hermann2016-07-155-9/+0
| | | | | | | | This enables us to drop all the load(qscxmlc) declarations in the various .pro files. Change-Id: I37e0ddba76be1c4c79dea1302634f62a22032ee2 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Better connection mechanism for eventsUlf Hermann2016-07-142-19/+61
| | | | | | | | | The connectToEvent() mechanism is analogous to connectToState() and allows arbitrary event specifications, with '.' and '*'. In addition a QML component is provided to make event connections available in QML. Change-Id: Ie45422481a794b1b350347c383318857e5dc3f6d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Provide Qt5-style syntax for connectToStateUlf Hermann2016-07-131-5/+52
| | | | | | | | | We should not force people to use the string-based connection syntax. Using modern C++ we can add more convenience here. Unfortunately we have to duplicate some code from QMetaObject, but this is worth it. Change-Id: I4daa1f7cfea9feb3de0159636a508ee64a849f55 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Add a test for connectToState()Jarek Kobus2016-07-133-1/+143
| | | | | Change-Id: I65a35eb193b683612647f17a556b4ad0254fa253 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add a test for non-ascii event namesUlf Hermann2016-07-113-1/+21
| | | | | Change-Id: I65395b71879b1ae3b96b7bb7b7cb2633c0ca7568 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Replace the QStateMachine-based implementation.Erik Verbruggen2016-06-094-28/+37
| | | | | | | | | | | | Under the 'hood a table-based state machine is now used instead of the QStateMachine. The advantage is that states and transitions are no longer QObjects but integers (so no (private) object allocations), and we're no longer hijacking the QStateMachinePrivate to work around some implementation details. Change-Id: I47ab47ab01cbb2204b9ca0e4cdd6a72faf724ce3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Implement srcexpr in <invoke>Jarek Kobus2016-06-073-2/+9
| | | | | Change-Id: I572342eb4952a6a0777a7503d374da6536ba052d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Change verification to run if no parse errors are found.Erik Verbruggen2016-06-078-12/+0
| | | | | | | | | | | Recovery from parse errors in XML is often done by ignoring the erroneous tag and its contents. This means that whole sub-trees are not "loaded", which obviously leeds to verification errors. However, because there was 1 parse error causing them, there is no need to give even more error messages that all stem from the same problem. Change-Id: I359e26f6d71b08590232b342b79e6a95d689bdd1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use parent's loader for loading sub state machines.Jarek Kobus2016-06-021-20/+24
| | | | | Change-Id: Id0b21aab862fdcd7a6a5e964e1c3dd30bd3fccad Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>