move parser test to a separate file
for better structure. Change-Id: I16bd1ca245640e92ffe167241a5a565e7a550e1d Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
parent
df43683975
commit
48c38aae10
1966
tests/auto/tools/qmakelib/parsertest.cpp
Normal file
1966
tests/auto/tools/qmakelib/parsertest.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -6,8 +6,12 @@ QT = core testlib
|
||||
INCLUDEPATH += ../../../../qmake/library
|
||||
VPATH += ../../../../qmake/library
|
||||
|
||||
HEADERS += \
|
||||
tst_qmakelib.h
|
||||
|
||||
SOURCES += \
|
||||
tst_qmakelib.cpp \
|
||||
parsertest.cpp \
|
||||
ioutils.cpp \
|
||||
proitems.cpp \
|
||||
qmakevfs.cpp \
|
||||
|
File diff suppressed because it is too large
Load Diff
77
tests/auto/tools/qmakelib/tst_qmakelib.h
Normal file
77
tests/auto/tools/qmakelib/tst_qmakelib.h
Normal file
@ -0,0 +1,77 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 <qmakeparser.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QtTest/QtTest>
|
||||
|
||||
class tst_qmakelib : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
tst_qmakelib() {}
|
||||
virtual ~tst_qmakelib() {}
|
||||
|
||||
private slots:
|
||||
void quoteArgUnix_data();
|
||||
void quoteArgUnix();
|
||||
void quoteArgWin_data();
|
||||
void quoteArgWin();
|
||||
void pathUtils();
|
||||
|
||||
void proString();
|
||||
void proStringList();
|
||||
|
||||
void proParser_data();
|
||||
void proParser();
|
||||
};
|
||||
|
||||
class QMakeHandler : public QMakeParserHandler {
|
||||
public:
|
||||
QMakeHandler() : QMakeParserHandler(), printed(false) {}
|
||||
virtual void message(int type, const QString &msg, const QString &fileName, int lineNo)
|
||||
{ print(fileName, lineNo, type, msg); }
|
||||
|
||||
void setExpectedMessages(const QStringList &msgs) { expected = msgs; }
|
||||
QStringList expectedMessages() const { return expected; }
|
||||
|
||||
bool printedMessages() const { return printed; }
|
||||
|
||||
private:
|
||||
void print(const QString &fileName, int lineNo, int type, const QString &msg);
|
||||
|
||||
QStringList expected;
|
||||
bool printed;
|
||||
};
|
Loading…
Reference in New Issue
Block a user