summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2016-04-01 13:58:39 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2016-04-01 15:10:30 +0000
commite22ab608d254c03d58f094e0f25d9e83c2f56be8 (patch)
treec780dae8a195d307252a4d7cae102812497cd93b /tests
parentc84570ecc6c3c4d8a8925345afec7e24c0bbb22d (diff)
Add an (initially empty) test for qscxmlc
Change-Id: I68b78d2a186ea88d9aa5ff243d441b9890693a79 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/auto.pro2
-rw-r--r--tests/auto/qscxmlc/data/empty.scxml1
-rw-r--r--tests/auto/qscxmlc/qscxmlc.pro24
-rw-r--r--tests/auto/qscxmlc/tst_qscxmlc.cpp65
-rw-r--r--tests/auto/qscxmlc/tst_qscxmlc.qrc5
5 files changed, 96 insertions, 1 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index b4876f0..2c2bcce 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -1,2 +1,2 @@
TEMPLATE = subdirs
-SUBDIRS = cmake parser scion statemachine
+SUBDIRS = cmake parser scion statemachine qscxmlc
diff --git a/tests/auto/qscxmlc/data/empty.scxml b/tests/auto/qscxmlc/data/empty.scxml
new file mode 100644
index 0000000..10c563b
--- /dev/null
+++ b/tests/auto/qscxmlc/data/empty.scxml
@@ -0,0 +1 @@
+<scxml></scxml>
diff --git a/tests/auto/qscxmlc/qscxmlc.pro b/tests/auto/qscxmlc/qscxmlc.pro
new file mode 100644
index 0000000..285ed87
--- /dev/null
+++ b/tests/auto/qscxmlc/qscxmlc.pro
@@ -0,0 +1,24 @@
+QT = core testlib scxml-private
+CONFIG += testcase console c++11
+CONFIG -= app_bundle
+
+TARGET = tst_qscxmlc
+TEMPLATE = app
+
+RESOURCES += tst_qscxmlc.qrc
+
+SOURCES += \
+ $$PWD/tst_qscxmlc.cpp \
+ $$PWD/../../../tools/qscxmlc/generator.cpp \
+ $$PWD/../../../tools/qscxmlc/scxmlcppdumper.cpp
+
+HEADERS += \
+ $$PWD/../../../tools/qscxmlc/qscxmlc.cpp \ # yes, that's a header. We want to #define scxmlcmain main
+ $$PWD/../../../tools/qscxmlc/moc.h \
+ $$PWD/../../../tools/qscxmlc/generator.h \
+ $$PWD/../../../tools/qscxmlc/outputrevision.h \
+ $$PWD/../../../tools/qscxmlc/utils.h \
+ $$PWD/../../../tools/qscxmlc/scxmlcppdumper.h
+
+INCLUDEPATH += ../../../tools/qscxmlc/
+
diff --git a/tests/auto/qscxmlc/tst_qscxmlc.cpp b/tests/auto/qscxmlc/tst_qscxmlc.cpp
new file mode 100644
index 0000000..a529144
--- /dev/null
+++ b/tests/auto/qscxmlc/tst_qscxmlc.cpp
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtScxml 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 <QtTest>
+#include <QObject>
+#include <QCoreApplication>
+
+#define main qscxmlcmain
+#include "qscxmlc.cpp"
+#undef main
+
+class tst_Qscxmlc: public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void parsing_data();
+ void parsing();
+};
+
+void tst_Qscxmlc::parsing_data()
+{
+ QTest::addColumn<QString>("scxmlFileName");
+ QDir dir(QLatin1String(":/tst_qscxmlc/data/"));
+ foreach (const QString &entry, dir.entryList()) {
+ QTest::newRow(entry.toLatin1().constData()) << dir.filePath(entry);
+ }
+}
+
+void tst_Qscxmlc::parsing()
+{
+ QFETCH(QString, scxmlFileName);
+ QVERIFY(run(QStringList() << QLatin1String("qcsxmlc") << scxmlFileName));
+}
+
+QTEST_MAIN(tst_Qscxmlc)
+
+#include "tst_qscxmlc.moc"
+
+
diff --git a/tests/auto/qscxmlc/tst_qscxmlc.qrc b/tests/auto/qscxmlc/tst_qscxmlc.qrc
new file mode 100644
index 0000000..df21b44
--- /dev/null
+++ b/tests/auto/qscxmlc/tst_qscxmlc.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/tst_qscxmlc">
+ <file>data/empty.scxml</file>
+ </qresource>
+</RCC>