summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify qscxmlc test scxml and merge it into parser testUlf Hermann2016-06-02114-5516/+544
| | | | | | Change-Id: If51691cff11d9594385fc2642d1ba361758dcf9a Task-number: QTBUG-53118 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Move scxml files into data subfolder, add more testsJarek Kobus2016-05-2010-12/+97
| | | | | Change-Id: I56bcc107c6df43ccc91822cd77b753190125e906 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Enable more testJarek Kobus2016-05-202-27/+3
| | | | | Change-Id: I57e9a9d8a38837c9939b6de8602ce1e86e8df1a8 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Don't bind NULL events to _event variable.Jarek Kobus2016-05-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes test329. According to scxml documentation: "NULL has no name and is used only in these definitions. It never occurs in the event queues of an SCXML Processor". "In the case of <transition> elements that do not contain an 'event' attribute [...], the _event variable will not have a easily predictable value since the transition is not being driven by an event. In these cases, _event will be bound to the last event that was matched against a transition." Analysis of test329: We enter the s1 state, raise event "foo" (which binds the _event variable into "foo" event) and transition into s2 state. When entering s2 we assign the _event variable (which is still bound to "foo") to the Var2. Next, we select eventless transitions for s2. In current implementation, selecting eventless transitions bind _event variable to the empty event. Now we omit it, according to docs. Change-Id: Ib393d4465f9a3ff4afc152aee2c334a80ee5fe66 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Fix posting delayed events in scion playlistsJarek Kobus2016-05-201-9/+3
| | | | | | | | | Instead of posting a delayed event directly we wait desired time and post an event without delay. Change-Id: Ibe4dd866c412458d361de9f3e67898aa06ec4a6c Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Refactor parser, parse recursively nowJarek Kobus2016-05-203-27/+54
| | | | | | | | | | | Splits the parsering function into several smaller functions per element kind. Fixes parsing of 11 scion tests. Fixes parsing of non-terminated comment inside <script> element. Change-Id: I1d82c3164415a71e69e90bc6d3b96bda67dabb6c Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Add a test checking dynamic meta object content of the state machineJarek Kobus2016-05-186-1/+305
| | | | | Change-Id: I4754fc96d34723bd849ff72c4c746f5dee4b1362 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix cmake test caseUlf Hermann2016-05-172-5/+2
| | | | | | | | | | | QtQuick or QML are not required, but scxml is. Also, we should check for a real class to verify the module is there. Task-number: QTBUG-51420 Change-Id: Ic6b6086bfba318933139f4bfd04826980c3716d4 Reviewed-by: Kevin Funk <kevin.funk@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Set the event type of done.state events to internal.Erik Verbruggen2016-05-034-0/+79
| | | | | Change-Id: If874a2aa4a47ea1ebe2dd539c09ff19243dd5558 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Don't leak m_doc->root when nested <scxml> occurred.Jarek Kobus2016-05-022-0/+8
| | | | | Change-Id: I77463e007bc2d4c1ece6c4341026968e6fe10793 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Allow history states for <scxml>'s "initial" attributeUlf Hermann2016-04-192-1/+17
| | | | | | | | The standard doesn't seem to prohibit this and QStateMachine can handle it. Change-Id: Ia22f564c9657582199c3c67318fafd21ec4a8770 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Don't mangle service namesUlf Hermann2016-04-181-0/+11
| | | | | | | We want to look the services up by their original name later. Change-Id: I8a8061bccb064a779e50aefdc6cf348806b417cd Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Don't crash when trying to execute things in the null data modelUlf Hermann2016-04-183-1/+17
| | | | | | | | Rather raise error.execution, as mandated by the standard (in most of those cases). Change-Id: If2e200693198b70b4bf067011318f0d78c44653b Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Give more descriptive names to test casesUlf Hermann2016-04-1535-34/+34
| | | | | Change-Id: I0f1929bf592206ad3a6164a50d9d933a6096741d Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Don't crash on misplaced <invoke>Ulf Hermann2016-04-142-0/+19
| | | | | Change-Id: I052261ef64ae4ada5c93211c61718cd81e4f0dd7 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Detect clashes in event and state namesJarek Kobus2016-04-143-22/+105
| | | | | Change-Id: I6df9f73965442b7866c8912ac8a0a0858640bb62 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Validate IDs and event names, and handle them well in C++ generation.Erik Verbruggen2016-04-1320-5/+482
| | | | | | Change-Id: I2e4e15496e7b2adc2f452745b1341f8fa0140b12 Task-number: QTBUG-51818 Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Add externalEventOccurred() signal.v5.7.0-beta1Jarek Kobus2016-04-123-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This signal is emitted only for events sent from SCXML file which are of qt:signal type. Reasoning: I want to use state names which contain dots, e.g. "Letter.A", "Letter.B", etc. The reason for that is I may listen to "done.state.Letter.*" event, which will be generated automatically whenever one of Letter.* went to its final state. Unfortunately, I cannot use qt-mode in that case, since dots in state names are not allowed in qt-mode. I'm forced to use non-qt-mode. In the same document I send external signals with <send type="qt:signal">. In order to listen to these signals I need to connect to the generic eventOccurred() signal in cpp code, since there is no other way in non-qt-mode. However, when I'm connected to eventOccurred() my slot is being invoked for every internal event, which slows down the execution. Practically, I'm not interested in internal events at all, but only for those marked with type="qt:signal". That's why this patch provides additional generic signal for "qt:signal" only event. Change-Id: Ic9206e98a20f72142f5584e0568f9f33d56f8e97 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Use common .pri file for building qscxmlc and its testJarek Kobus2016-04-121-13/+3
| | | | | | | | That way we ensure we really compile it in the same way. This e.g. defines BUILD_QSCXMLC while building the test. Change-Id: Iffe0e9f1d3cbd543bb69049bb889226212ea49a8 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Don't include source file in tests/auto/qscxmlcJarek Kobus2016-04-122-5/+3
| | | | | Change-Id: I920128e27605487e68c72e2f59e1e53144621816 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* fix prefix buildsOswald Buddenhagen2016-04-081-8/+6
| | | | | | | | rely on qtPrepareTool() for qscxmlc setup. Task-number: QTBUG-51151 Change-Id: I8f8380dcb8519a7786d8fb5b50594c2fe3dff93b Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Add a test for done.state eventJarek Kobus2016-04-062-0/+47
| | | | | Change-Id: Ie8c9c0caaf5530a9d0c63d74e4f520a20af115c3 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Don't crash on <initial> outside a stateUlf Hermann2016-04-052-0/+94
| | | | | Change-Id: I556d037c6ad532fe29d3151bdc840ab34c6e7485 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Report a parse error if we didn't manage to create a root elementUlf Hermann2016-04-045-0/+328
| | | | | | | Subsequent code expects there to be one. Change-Id: I17cdf1d10144fdd4cfcc9863966f404cdf949dca Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Don't crash on unbalanced XML tagsUlf Hermann2016-04-042-0/+80
| | | | | Change-Id: I73ebbb928d9fbce233c2c8b536a77784ef16b5da Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Don't crash on invalid nested state machinesUlf Hermann2016-04-049-0/+483
| | | | | | | | | If an <invoke> tag doesn't contain a state machine, that's an error and should be found when verifying. Also, don't try to verify the nonexistent state machine. Change-Id: Ib371f3f34c9ab5c20f9492b326d1fee87f7b76d2 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Don't crash on "else" instructions without preceding "if"Ulf Hermann2016-04-0415-0/+3570
| | | | | Change-Id: I85e51f9a98bae8e2617ecc0d64c14040dc4bf1b5 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Stop parsing if the root element isn't called "scxml"Ulf Hermann2016-04-047-0/+782
| | | | | | | Otherwise we get various other problems later on. Change-Id: If40c1303fb51f351fd08b350557fea033764f82c Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Add an (initially empty) test for qscxmlcUlf Hermann2016-04-015-1/+96
| | | | | Change-Id: I68b78d2a186ea88d9aa5ff243d441b9890693a79 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Automatically initialize state machines when startingUlf Hermann2016-03-301-1/+0
| | | | | | | | | | This removes the need to call init() before start(), making the API much more intuitive. We also expose the initial values as a Q_PROPERTY so that they can be set in a declarative way from QML. Change-Id: If3c995c956764018bcab7b6caa8485e32bba6f1a Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* Deduplicate QScxmlStateMachine ctor and remove didChangeUlf Hermann2016-03-262-3/+3
| | | | | | | | | | | The didChange parameter to reachedStableState() is rather confusing as a "true" does not denote that the new state is different from the previous one. It just tells us that at least one microstep was performed. This information is not very useful to users of the API, so let's drop it. Change-Id: Ia59e9ad98d813b151429fa0067ab26d007eb4c26 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Rename qscxmlc optionsJarek Kobus2016-03-071-2/+2
| | | | | Change-Id: I6014b117424779f51f28710b6df5635e41d22fae Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Enable tst_scion for MSVC.Friedemann Kleint2016-02-242-1/+2
| | | | | | | | | Add option /bigobj to fix error: tscxml\tests\auto\scion\tst_scion.cpp : fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj Task-number: QTBUG-51144 Change-Id: Ib89f227388ce264315b98b1486bda1de6d5acb52 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Add a test for nested state machineJarek Kobus2016-02-104-7/+67
| | | | | Change-Id: I4f63ebc3650928dfe9097ff61b851ebe22e6f216 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Rename connect -> connectToState, remove "signal" argument.Jarek Kobus2016-02-101-1/+1
| | | | | | Change-Id: I79f4e2f91eabfbf224d4b6acd4c78b77fd80b577 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Change staticMetaObject generation.Erik Verbruggen2016-02-051-11/+0
| | | | | | | | | The full meta-object generation is replaced with the moc generator. This gives a fully functional meta-object without any overhead during object instantiation. Change-Id: Ibf62a6f1bfc0873cd00dd2e4bbad38c8d165005a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Update license headersJarek Kobus2016-01-2610-107/+238
| | | | | Change-Id: If100cc6cfeccc9ec4f13e03d69edfb7fad6bc2f6 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Fix connecting to a signal of a final state, more testsJarek Kobus2015-12-172-9/+57
| | | | | Change-Id: Ia01a5463a26368a907e8ce4443efbc112eb76b11 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Add stateNames() methodJarek Kobus2015-12-175-1/+111
| | | | | Change-Id: Ib53f532f6c8a14c51d4dc82d0c83c33455d36bce Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Rename activeStates() into activeStateNames(), make it constJarek Kobus2015-12-161-1/+1
| | | | | Change-Id: I5f71f24e9c989cad7399221c0e1a59328aadad77 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Fix routing of delayed eventsJarek Kobus2015-12-031-4/+2
| | | | | Change-Id: Ia44c4a4cc64daedfdb03400bd806508838f1f0ac Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Change QScxmlEvent::{name,sendId} from QByteArray to QString.Erik Verbruggen2015-12-032-5/+6
| | | | | Change-Id: I1da62c00865b955864df0326a247bafba6c763ff Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Clean up the state-machine initialization.Erik Verbruggen2015-12-012-3/+4
| | | | | Change-Id: I52d989c8a387faf5894f7dbb526984648b83c7a3 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Even more documentation.Erik Verbruggen2015-12-011-1/+1
| | | | | Change-Id: Iac3a36a61b883ef9fa80a9b37fdc53a73f2b0e27 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Temporarily disable building tests/examples with msvc.Erik Verbruggen2015-11-201-2/+1
| | | | | | | The CI has an issue due to which these can't be build. Change-Id: Iba2ff0ac7b41bbe52b7a838eb3f1cc44f068ed3b Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Build fixes.Erik Verbruggen2015-11-181-1/+3
| | | | | Change-Id: I9f7cf3f50a1ddf787e42c71aada8f6866df573b1 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Revert "Fix routing delayed events"Erik Verbruggen2015-11-181-2/+4
| | | | | | | | | | | This reverts commit edbe5301ec1789081ce17d853e176e7c7fb90014. The patch relies on an export that is only available in "developer mode" (QFreeListDefaultConstants used by QFreeList, which is the type of delayedEventIdFreeList in QStateMachinePrivate). Change-Id: I3a48949bbe98edd8dc593ef047f3e93b70acb4dd Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Fix logging.Erik Verbruggen2015-11-042-2/+1
| | | | | Change-Id: Iae6d7f93b9f257e2c2cd56b2cdd4d13447ce9a8e Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Fix routing delayed eventsJarek Kobus2015-10-301-4/+2
| | | | | Change-Id: Ic872c6ede523eea1b8c5d5aab70b4bbeb5ceccaa Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* The test403c fixed after an obvious fix in QStateMachine.Jarek Kobus2015-10-301-2/+0
| | | | | | | After https://codereview.qt-project.org/#/c/139404/ is in. Change-Id: Id272ced98ab06b0a3a1d2299788e5838cbb1bfe4 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>