qt5base-lts/tests/auto/tools/qmakelib/tst_qmakelib.h
Lucie Gérard 05fc3aef53 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Task-number: QTBUG-67283
Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-05-16 16:37:38 +02:00

87 lines
2.2 KiB
C++

// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <qmakeevaluator.h>
#include <QObject>
#include <QProcessEnvironment>
#include <QTest>
class tst_qmakelib : public QObject
{
Q_OBJECT
public:
tst_qmakelib() {}
virtual ~tst_qmakelib() {}
private slots:
void initTestCase();
void cleanupTestCase();
void quoteArgUnix_data();
void quoteArgUnix();
void quoteArgWin_data();
void quoteArgWin();
void pathUtils();
void ioUtilRelativity_data();
void ioUtilRelativity();
void ioUtilResolve_data();
void ioUtilResolve();
void proString();
void proStringList();
void proParser_data();
void proParser();
void proEval_data();
void proEval();
private:
void addParseOperators();
void addParseValues();
void addParseConditions();
void addParseControlStatements();
void addParseBraces();
void addParseCustomFunctions();
void addParseAbuse();
void addAssignments();
void addExpansions();
void addControlStructs();
void addReplaceFunctions(const QString &qindir);
void addTestFunctions(const QString &qindir);
QProcessEnvironment m_env;
QHash<ProKey, ProString> m_prop;
QString m_indir, m_outdir;
};
class QMakeTestHandler : public QMakeHandler {
public:
QMakeTestHandler() : QMakeHandler(), printed(false) {}
virtual void message(int type, const QString &msg, const QString &fileName, int lineNo) override
{ print(fileName, lineNo, type, msg); }
virtual void fileMessage(int type, const QString &msg) override
{ Q_UNUSED(type); doPrint(msg); }
virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) override {}
virtual void doneWithEval(ProFile *) override {}
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);
void doPrint(const QString &msg);
QStringList expected;
bool printed;
};