summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-01-30 20:39:32 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-02-25 13:54:33 +0000
commite507b0148bc2c3159a88f670c826f6f5165606bd (patch)
tree83e282cd4e4f786b0dea55bda989556e7c7c7163 /tests
parent76922a706f0584ce2aa1a0ca758cf0c6196ea729 (diff)
add test for the qmake library
the existing test is a blackbox test. this one is going to be different. the first test is a bit trivial ... Change-Id: Iba1b0b5c32490677551ee92c36f381b884c2765d Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/tools/qmakelib/.gitignore1
-rw-r--r--tests/auto/tools/qmakelib/qmakelib.pro11
-rw-r--r--tests/auto/tools/qmakelib/tst_qmakelib.cpp72
-rw-r--r--tests/auto/tools/tools.pro1
4 files changed, 85 insertions, 0 deletions
diff --git a/tests/auto/tools/qmakelib/.gitignore b/tests/auto/tools/qmakelib/.gitignore
new file mode 100644
index 0000000000..5a0a2058a2
--- /dev/null
+++ b/tests/auto/tools/qmakelib/.gitignore
@@ -0,0 +1 @@
+tst_qmakelib
diff --git a/tests/auto/tools/qmakelib/qmakelib.pro b/tests/auto/tools/qmakelib/qmakelib.pro
new file mode 100644
index 0000000000..df13670438
--- /dev/null
+++ b/tests/auto/tools/qmakelib/qmakelib.pro
@@ -0,0 +1,11 @@
+CONFIG += testcase
+CONFIG += parallel_test
+TARGET = tst_qmakelib
+QT = core testlib
+
+INCLUDEPATH += ../../../../qmake/library
+VPATH += ../../../../qmake/library
+
+SOURCES += \
+ tst_qmakelib.cpp \
+ proitems.cpp
diff --git a/tests/auto/tools/qmakelib/tst_qmakelib.cpp b/tests/auto/tools/qmakelib/tst_qmakelib.cpp
new file mode 100644
index 0000000000..e7bfa8e814
--- /dev/null
+++ b/tests/auto/tools/qmakelib/tst_qmakelib.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#include <proitems.h>
+
+#include <QObject>
+
+class tst_qmakelib : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_qmakelib() {}
+ virtual ~tst_qmakelib() {}
+
+private slots:
+ void proStringList();
+};
+
+void tst_qmakelib::proStringList()
+{
+ ProStringList sl1;
+ sl1 << ProString("qt") << ProString(QLatin1String("is"))
+ << ProString(QStringLiteral("uncool")).mid(2);
+
+ QCOMPARE(sl1.toQStringList(), QStringList() << "qt" << "is" << "cool");
+ QCOMPARE(sl1.join(QStringLiteral("~~")), QStringLiteral("qt~~is~~cool"));
+
+ ProStringList sl2;
+ sl2 << ProString("mostly") << ProString("...") << ProString("is") << ProString("...");
+ sl1.insertUnique(sl2);
+ QCOMPARE(sl1.toQStringList(), QStringList() << "qt" << "is" << "cool" << "mostly" << "...");
+
+ QVERIFY(sl1.contains("cool"));
+ QVERIFY(!sl1.contains("COOL"));
+ QVERIFY(sl1.contains("COOL", Qt::CaseInsensitive));
+}
+
+QTEST_MAIN(tst_qmakelib)
+#include "tst_qmakelib.moc"
diff --git a/tests/auto/tools/tools.pro b/tests/auto/tools/tools.pro
index 5367e8b7ef..7e4dc67b09 100644
--- a/tests/auto/tools/tools.pro
+++ b/tests/auto/tools/tools.pro
@@ -1,5 +1,6 @@
TEMPLATE=subdirs
SUBDIRS=\
+ qmakelib \
qmake \
uic \
moc \