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>
This commit is contained in:
Oswald Buddenhagen 2015-01-30 20:39:32 +01:00
parent 76922a706f
commit e507b0148b
4 changed files with 85 additions and 0 deletions

1
tests/auto/tools/qmakelib/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
tst_qmakelib

View File

@ -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

View File

@ -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"

View File

@ -1,5 +1,6 @@
TEMPLATE=subdirs TEMPLATE=subdirs
SUBDIRS=\ SUBDIRS=\
qmakelib \
qmake \ qmake \
uic \ uic \
moc \ moc \