diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2016-10-17 12:20:01 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2016-10-20 15:33:38 +0000 |
commit | d07c24c701963ac0eaf1e7fb1774efcf2ee4dee3 (patch) | |
tree | ba12bff89306ad9e13f110b182a7c2b272c26303 /tests | |
parent | 91242e37603bab2c2adcfbc34fd9731b668ae6f6 (diff) |
Add support for the QtScxml module
[ChangeLog] Added support for QtScxml module.
Change-Id: I1ad8d51a3d9532d4a24270e4cc13f26f51620b07
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/blackbox/testdata/qtscxml/dummystatemachine.scxml | 3 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/qtscxml/main.cpp | 15 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/qtscxml/qtscxml.qbs | 52 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 10 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.h | 1 |
5 files changed, 81 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/qtscxml/dummystatemachine.scxml b/tests/auto/blackbox/testdata/qtscxml/dummystatemachine.scxml new file mode 100644 index 000000000..6c751866f --- /dev/null +++ b/tests/auto/blackbox/testdata/qtscxml/dummystatemachine.scxml @@ -0,0 +1,3 @@ +<?xml version="1.0" ?> +<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" name="qbs_test_machine"> +</scxml> diff --git a/tests/auto/blackbox/testdata/qtscxml/main.cpp b/tests/auto/blackbox/testdata/qtscxml/main.cpp new file mode 100644 index 000000000..c9a7d7741 --- /dev/null +++ b/tests/auto/blackbox/testdata/qtscxml/main.cpp @@ -0,0 +1,15 @@ +#ifdef HAS_QTSCXML +#include <dummystatemachine.h> +#endif + +#include <iostream> + +int main() +{ +#ifdef HAS_QTSCXML + QbsTest::QbsStateMachine machine; + std::cout << "state machine name: " << qPrintable(machine.name()) << std::endl; +#else + std::cout << "QtScxml not present" << std::endl; +#endif +} diff --git a/tests/auto/blackbox/testdata/qtscxml/qtscxml.qbs b/tests/auto/blackbox/testdata/qtscxml/qtscxml.qbs new file mode 100644 index 000000000..af96b8594 --- /dev/null +++ b/tests/auto/blackbox/testdata/qtscxml/qtscxml.qbs @@ -0,0 +1,52 @@ +import qbs +import qbs.FileInfo + +Project { + QtApplication { + name: "app" + Depends { name: "Qt.scxml"; required: false } + + Properties { + condition: Qt.scxml.present + cpp.defines: ["HAS_QTSCXML"] + } + + Qt.scxml.className: "QbsStateMachine" + Qt.scxml.namespace: "QbsTest" + + files: ["main.cpp"] + Group { + files: ["dummystatemachine.scxml"] + fileTags: ["qt.scxml.compilable"] + } + } + + Product { + name: "runner" + type: ["runner"] + Depends { name: "app" } + Rule { + inputsFromDependencies: ["application"] + Artifact { + filePath: "dummy" + fileTags: ["runner"] + } + prepare: { + var cmd = new Command(input.filePath); + cmd.description = "running " + input.filePath; + var pathVar; + var pathValue; + if (product.moduleProperty("qbs", "hostOS").contains("windows")) { + pathVar = "PATH"; + pathValue = FileInfo.toWindowsSeparators( + input.moduleProperty("Qt.core", "binPath")); + } else { + pathVar = "LD_LIBRARY_PATH"; + pathValue = input.moduleProperty("Qt.core", "libPath"); + } + cmd.environment = [pathVar + '=' + pathValue]; + return [cmd]; + } + } + } +} diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 4f41cd6ea..03c1df6b0 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -2191,6 +2191,16 @@ void TestBlackbox::qtBug51237() QCOMPARE(runQbs(params), 0); } +void TestBlackbox::qtScxml() +{ + QDir::setCurrent(testDataDir + "/qtscxml"); + QCOMPARE(runQbs(), 0); + if (m_qbsStdout.contains("QtScxml not present")) + QSKIP("QtScxml module not present"); + QVERIFY2(m_qbsStdout.contains("state machine name: qbs_test_machine"), + m_qbsStdout.constData()); +} + void TestBlackbox::dynamicMultiplexRule() { const QString testDir = testDataDir + "/dynamicMultiplexRule"; diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index 182221b78..c7a344e60 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -146,6 +146,7 @@ private slots: void qmlDebugging(); void qobjectInObjectiveCpp(); void qtBug51237(); + void qtScxml(); void radAfterIncompleteBuild(); void radAfterIncompleteBuild_data(); void recursiveRenaming(); |