diff options
Diffstat (limited to 'tests/auto/qmake')
108 files changed, 3965 insertions, 0 deletions
diff --git a/tests/auto/qmake/.gitignore b/tests/auto/qmake/.gitignore new file mode 100644 index 0000000000..bac457d34d --- /dev/null +++ b/tests/auto/qmake/.gitignore @@ -0,0 +1 @@ +tst_qmake diff --git a/tests/auto/qmake/qmake.pro b/tests/auto/qmake/qmake.pro new file mode 100644 index 0000000000..d0faa872b8 --- /dev/null +++ b/tests/auto/qmake/qmake.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +HEADERS += testcompiler.h +SOURCES += tst_qmake.cpp testcompiler.cpp +QT -= gui + +cross_compile: DEFINES += QMAKE_CROSS_COMPILED + + diff --git a/tests/auto/qmake/testcompiler.cpp b/tests/auto/qmake/testcompiler.cpp new file mode 100644 index 0000000000..dbdeee89e6 --- /dev/null +++ b/tests/auto/qmake/testcompiler.cpp @@ -0,0 +1,270 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "testcompiler.h" + +#include <QProcess> +#include <QDir> + +static QString targetName( BuildType buildMode, const QString& target, const QString& version ) +{ + Q_UNUSED(version); + QString targetName = target; + +#if defined (Q_OS_WIN32) + switch (buildMode) + { + case Exe: // app + targetName.append(".exe"); + break; + case Dll: // dll + if (!version.isEmpty()) + targetName.append(version.section(".", 0, 0)); + targetName.append(".dll"); + break; + case Lib: // lib +#ifdef Q_CC_GNU + targetName.prepend("lib"); + targetName.append(".a"); +#else + targetName.append(".lib"); +#endif + break; + case Plain: + // no conversion + break; + } +#elif defined( Q_OS_MAC ) + switch (buildMode) + { + case Exe: // app + targetName += ".app/Contents/MacOS/" + target.section('/', -1); + break; + case Dll: // dll + targetName.prepend("lib"); + targetName.append("." + version + ".dylib"); + break; + case Lib: // lib + targetName.prepend("lib"); + targetName.append(".a"); + break; + case Plain: + // no conversion + break; + } +#else + switch (buildMode) + { + case Exe: // app + break; + case Dll: // dll + targetName.prepend("lib"); +#if defined (Q_OS_HPUX) && !defined (__ia64) + targetName.append(".sl"); +#elif defined (Q_OS_AIX) + targetName.append(".a"); +#else + targetName.append(".so"); +#endif + break; + case Lib: // lib + targetName.prepend("lib"); + targetName.append(".a"); + break; + case Plain: + // no conversion + break; + } +#endif + return targetName; +} + +TestCompiler::TestCompiler() +{ + setBaseCommands( "", "" ); +} + +TestCompiler::~TestCompiler() +{ +} + +bool TestCompiler::runCommand( QString cmdline ) +{ + testOutput_.append("Running command: " + cmdline); + + QProcess child; + if (!environment_.empty()) + child.setEnvironment(QProcess::systemEnvironment() + environment_); + + child.start(cmdline); + if (!child.waitForStarted(-1)) { + testOutput_.append( "Unable to start child process." ); + return false; + } + + bool failed = false; + child.setReadChannel(QProcess::StandardError); + child.waitForFinished(-1); + + foreach (const QByteArray &output, child.readAllStandardError().split('\n')) { + testOutput_.append(QString::fromLocal8Bit(output)); + + if (output.startsWith("Project MESSAGE: FAILED")) + failed = true; + } + + return !failed && child.exitStatus() == QProcess::NormalExit && child.exitCode() == 0; +} + +void TestCompiler::setBaseCommands( QString makeCmd, QString qmakeCmd ) +{ + makeCmd_ = makeCmd; + qmakeCmd_ = qmakeCmd; +} + +void TestCompiler::resetEnvironment() +{ + environment_.clear(); +} + +void TestCompiler::addToEnvironment( QString varAssignment ) +{ + environment_.push_back(varAssignment); +} + +bool TestCompiler::makeClean( const QString &workPath ) +{ + QDir D; + if (!D.exists(workPath)) { + testOutput_.append( "Directory '" + workPath + "' doesn't exist" ); + return false; + } + + D.setCurrent(workPath); + QFileInfo Fi( workPath + "/Makefile"); + if (Fi.exists()) + // Run make clean + return runCommand( makeCmd_ + " clean" ); + + return true; +} + +bool TestCompiler::makeDistClean( const QString &workPath ) +{ + QDir D; + if (!D.exists(workPath)) { + testOutput_.append( "Directory '" + workPath + "' doesn't exist" ); + return false; + } + + D.setCurrent(workPath); + QFileInfo Fi( workPath + "/Makefile"); + if (Fi.exists()) + // Run make distclean + return runCommand( makeCmd_ + " distclean" ); + + return true; + +} + +bool TestCompiler::qmake( const QString &workDir, const QString &proName, const QString &buildDir ) +{ + QDir D; + D.setCurrent( workDir ); + + if (D.exists("Makefile")) + D.remove("Makefile"); + + QString projectFile = proName; + QString makeFile = buildDir; + if (!projectFile.endsWith(".pro")) + projectFile += ".pro"; + if (!makeFile.isEmpty() && !makeFile.endsWith('/')) + makeFile += '/'; + makeFile += "Makefile"; + + // Now start qmake and generate the makefile + return runCommand( qmakeCmd_ + " " + projectFile + " -o " + makeFile ); +} + +bool TestCompiler::make( const QString &workPath, const QString &target ) +{ + QDir D; + D.setCurrent( workPath ); + + QString cmdline = makeCmd_; + if ( cmdline.contains("nmake", Qt::CaseInsensitive) ) + cmdline.append(" /NOLOGO"); + if ( !target.isEmpty() ) + cmdline += " " + target; + + return runCommand( cmdline ); +} + +bool TestCompiler::exists( const QString &destDir, const QString &exeName, BuildType buildType, const QString &version ) +{ + QFileInfo f(destDir + "/" + targetName(buildType, exeName, version)); + return f.exists(); +} + +bool TestCompiler::removeMakefile( const QString &workPath ) +{ + QDir D; + D.setCurrent( workPath ); + if ( D.exists( "Makefile" ) ) + return D.remove( "Makefile" ); + else + return true; +} + +QString TestCompiler::commandOutput() const +{ +#ifndef Q_OS_WIN + return testOutput_.join("\n"); +#else + return testOutput_.join("\r\n"); +#endif +} + +void TestCompiler::clearCommandOutput() +{ + testOutput_.clear(); +} diff --git a/tests/auto/qmake/testcompiler.h b/tests/auto/qmake/testcompiler.h new file mode 100644 index 0000000000..4ef0584d9a --- /dev/null +++ b/tests/auto/qmake/testcompiler.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef TESTCOMPILER_H +#define TESTCOMPILER_H + +#include <QObject> +#include <QStringList> + +enum BuildType { Exe, Dll, Lib, Plain }; + +class TestCompiler : public QObject +{ + Q_OBJECT + +public: + TestCompiler(); + virtual ~TestCompiler(); + + void setBaseCommands( QString makeCmd, QString qmakeCmd ); + void resetEnvironment(); + void addToEnvironment( QString varAssignment ); + + // executes a make clean in the specified workPath + bool makeClean( const QString &workPath ); + // executes a make dist clean in the specified workPath + bool makeDistClean( const QString &workPath ); + // executes a qmake on proName in the specified workDir, output goes to buildDir or workDir if it's null + bool qmake( const QString &workDir, const QString &proName, const QString &buildDir = QString() ); + // executes a make in the specified workPath, with an optional target (eg. install) + bool make( const QString &workPath, const QString &target = QString() ); + // checks if the executable exists in destDir + bool exists( const QString &destDir, const QString &exeName, BuildType buildType, const QString &version ); + // removes the makefile + bool removeMakefile( const QString &workPath ); + // returns each line of stdout of the last command append with a "new line" character(s) to suit the platform + QString commandOutput() const; + // clear the results of storage of stdout for running previous commands + void clearCommandOutput(); + +private: + bool runCommand( QString cmdLine ); + + QString makeCmd_; + QString qmakeCmd_; + QStringList environment_; + + // need to make this available somewhere + QStringList testOutput_; +}; + +#endif // TESTCOMPILER_H diff --git a/tests/auto/qmake/testdata/bundle-spaces/bundle-spaces.pro b/tests/auto/qmake/testdata/bundle-spaces/bundle-spaces.pro new file mode 100644 index 0000000000..644a817a8e --- /dev/null +++ b/tests/auto/qmake/testdata/bundle-spaces/bundle-spaces.pro @@ -0,0 +1,13 @@ +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . + +# Input +SOURCES += main.cpp + +QWERTY_BUNDLE.version = Bogus.78 +QWERTY_BUNDLE.files = some-file "existing file" "non-existing file" +QWERTY_BUNDLE.path = QwertyData + +QMAKE_BUNDLE_DATA = QWERTY_BUNDLE diff --git a/tests/auto/qmake/testdata/bundle-spaces/existing file b/tests/auto/qmake/testdata/bundle-spaces/existing file new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/auto/qmake/testdata/bundle-spaces/existing file diff --git a/tests/auto/qmake/testdata/bundle-spaces/main.cpp b/tests/auto/qmake/testdata/bundle-spaces/main.cpp new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/auto/qmake/testdata/bundle-spaces/main.cpp diff --git a/tests/auto/qmake/testdata/bundle-spaces/some-file b/tests/auto/qmake/testdata/bundle-spaces/some-file new file mode 100644 index 0000000000..9975dba4ba --- /dev/null +++ b/tests/auto/qmake/testdata/bundle-spaces/some-file @@ -0,0 +1,6 @@ +all: + C:\git\qt-kinetic-animations\bin\qmake qdir.pro -o Makefile -spec win32-msvc2008 + nmake -f Makefile +first: all +qmake: + C:\git\qt-kinetic-animations\bin\qmake qdir.pro -o Makefile -spec win32-msvc2008 diff --git a/tests/auto/qmake/testdata/comments/comments.pro b/tests/auto/qmake/testdata/comments/comments.pro new file mode 100644 index 0000000000..5f1ac083fa --- /dev/null +++ b/tests/auto/qmake/testdata/comments/comments.pro @@ -0,0 +1,33 @@ +LIST = 1 2 3 4 #a comment +!equals( LIST, 1 2 3 4 ) { + message( "FAILED: inline comment" ) +} + +LIST = 1 \ + 2 \ +# 3 \ + 4 +!equals( LIST, 1 2 4 ) { + message( "FAILED: commented out continuation" ) +} + +LIST = 1 \ + 2 \#comment + 3 \ + 4 +!equals( LIST, 1 2 3 4 ) { + message( "FAILED: comment at end of continuation") +} + + +LIST = 1 2 3 4#comment +!equals( LIST, 1 2 3 4 ) { + message( "FAILED: no space before comment" ) +} + +LIST = 1 2 3 4$${LITERAL_HASH}five +!equals( LIST, 1 2 3 4$${LITERAL_HASH}five ) { + message( "FAILED: using LITERAL_HASH" ) +} + + diff --git a/tests/auto/qmake/testdata/duplicateLibraryEntries/duplib.pro b/tests/auto/qmake/testdata/duplicateLibraryEntries/duplib.pro new file mode 100644 index 0000000000..3c30bbbdcd --- /dev/null +++ b/tests/auto/qmake/testdata/duplicateLibraryEntries/duplib.pro @@ -0,0 +1,10 @@ +LIBS = -lqui -lqtest -lqui +CONFIG -= link_prl +JOINEDLIBS = $$join(LIBS, "_") + +!contains(JOINEDLIBS, -lqui_-lqtest_-lqui) { + message("FAILED: duplibs") +} + + + diff --git a/tests/auto/qmake/testdata/export_across_file_boundaries/.qmake.cache b/tests/auto/qmake/testdata/export_across_file_boundaries/.qmake.cache new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/auto/qmake/testdata/export_across_file_boundaries/.qmake.cache diff --git a/tests/auto/qmake/testdata/export_across_file_boundaries/features/default_pre.prf b/tests/auto/qmake/testdata/export_across_file_boundaries/features/default_pre.prf new file mode 100644 index 0000000000..123f9bc53d --- /dev/null +++ b/tests/auto/qmake/testdata/export_across_file_boundaries/features/default_pre.prf @@ -0,0 +1,7 @@ +defineTest(setVar) { + eval($${1}=bar) + export($$1) +} + +setVar(FOO) + diff --git a/tests/auto/qmake/testdata/export_across_file_boundaries/foo.pro b/tests/auto/qmake/testdata/export_across_file_boundaries/foo.pro new file mode 100644 index 0000000000..c3196cbceb --- /dev/null +++ b/tests/auto/qmake/testdata/export_across_file_boundaries/foo.pro @@ -0,0 +1,17 @@ +!equals(FOO,bar) { + message( "FAILED: export() invisible from default_pre.prf to foo.pro" ) +} + +O_FOO=$$fromfile(oink.pri,FOO) +O_BAR=$$fromfile(oink.pri,BAR) + +!equals(O_BAR,bar) { + message( "FAILED: export() invisible from oink.pri through \$$fromfile()" ) +} + +!equals(O_FOO,bar) { + message( "FAILED: export() invisible from default_pre.prf through \$$fromfile()" ) +} + + + diff --git a/tests/auto/qmake/testdata/export_across_file_boundaries/oink.pri b/tests/auto/qmake/testdata/export_across_file_boundaries/oink.pri new file mode 100644 index 0000000000..cbd2d0f7d0 --- /dev/null +++ b/tests/auto/qmake/testdata/export_across_file_boundaries/oink.pri @@ -0,0 +1 @@ +setVar(BAR) diff --git a/tests/auto/qmake/testdata/findDeps/findDeps.pro b/tests/auto/qmake/testdata/findDeps/findDeps.pro new file mode 100644 index 0000000000..43577b5122 --- /dev/null +++ b/tests/auto/qmake/testdata/findDeps/findDeps.pro @@ -0,0 +1,17 @@ +TEMPLATE = app +TARGET = findDeps +DEPENDPATH += . +INCLUDEPATH += . +DESTDIR = ./ + +# Input +HEADERS += object1.h \ + object2.h \ + object3.h \ + object4.h \ + object5.h \ + object6.h \ + object7.h \ + object8.h \ + object9.h +SOURCES += main.cpp diff --git a/tests/auto/qmake/testdata/findDeps/main.cpp b/tests/auto/qmake/testdata/findDeps/main.cpp new file mode 100644 index 0000000000..f5af48eb1c --- /dev/null +++ b/tests/auto/qmake/testdata/findDeps/main.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + + #include <moc_object1.cpp> +/**/ #include <moc_object2.cpp> +/**//**/ #include <moc_object3.cpp> +/*'*/ #include <moc_object4.cpp> +/* +*/ #include <moc_object5.cpp> + +// +#include <moc_object6.cpp> + +static void function1(); +#include <moc_object7.cpp> +static void function2(); /**/ +#include <moc_object8.cpp> +static void function3(); // +#include <moc_object9.cpp> + +int main () {} + diff --git a/tests/auto/qmake/testdata/findDeps/object1.h b/tests/auto/qmake/testdata/findDeps/object1.h new file mode 100644 index 0000000000..2f18b60617 --- /dev/null +++ b/tests/auto/qmake/testdata/findDeps/object1.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QObject> + +class Object1 : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findDeps/object2.h b/tests/auto/qmake/testdata/findDeps/object2.h new file mode 100644 index 0000000000..5a7d1f7da2 --- /dev/null +++ b/tests/auto/qmake/testdata/findDeps/object2.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QObject> + +class Object2 : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findDeps/object3.h b/tests/auto/qmake/testdata/findDeps/object3.h new file mode 100644 index 0000000000..2107e38cf5 --- /dev/null +++ b/tests/auto/qmake/testdata/findDeps/object3.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QObject> + +class Object3 : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findDeps/object4.h b/tests/auto/qmake/testdata/findDeps/object4.h new file mode 100644 index 0000000000..df73457dd4 --- /dev/null +++ b/tests/auto/qmake/testdata/findDeps/object4.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QObject> + +class Object4 : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findDeps/object5.h b/tests/auto/qmake/testdata/findDeps/object5.h new file mode 100644 index 0000000000..82cc04d856 --- /dev/null +++ b/tests/auto/qmake/testdata/findDeps/object5.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QObject> + +class Object5 : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findDeps/object6.h b/tests/auto/qmake/testdata/findDeps/object6.h new file mode 100644 index 0000000000..57cc51c011 --- /dev/null +++ b/tests/auto/qmake/testdata/findDeps/object6.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QObject> + +class Object6 : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findDeps/object7.h b/tests/auto/qmake/testdata/findDeps/object7.h new file mode 100644 index 0000000000..5f181ec36d --- /dev/null +++ b/tests/auto/qmake/testdata/findDeps/object7.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QObject> + +class Object7 : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findDeps/object8.h b/tests/auto/qmake/testdata/findDeps/object8.h new file mode 100644 index 0000000000..c23e37f77f --- /dev/null +++ b/tests/auto/qmake/testdata/findDeps/object8.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QObject> + +class Object8 : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findDeps/object9.h b/tests/auto/qmake/testdata/findDeps/object9.h new file mode 100644 index 0000000000..41121000e7 --- /dev/null +++ b/tests/auto/qmake/testdata/findDeps/object9.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QObject> + +class Object9 : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findMocs/findMocs.pro b/tests/auto/qmake/testdata/findMocs/findMocs.pro new file mode 100644 index 0000000000..1469b4c5c3 --- /dev/null +++ b/tests/auto/qmake/testdata/findMocs/findMocs.pro @@ -0,0 +1,9 @@ +TEMPLATE = app +TARGET = findMocs +DEPENDPATH += . +INCLUDEPATH += . +DESTDIR = ./ + +# Input +HEADERS += object1.h object2.h object3.h object4.h object5.h object6.h object7.h +SOURCES += main.cpp diff --git a/tests/auto/qmake/testdata/findMocs/main.cpp b/tests/auto/qmake/testdata/findMocs/main.cpp new file mode 100644 index 0000000000..eb95fc9b82 --- /dev/null +++ b/tests/auto/qmake/testdata/findMocs/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <moc_object1.cpp> +#include <moc_object2.cpp> +#include <moc_object3.cpp> +#include "object4.h" +#include <moc_object5.cpp> +#include <moc_object6.cpp> +#include <moc_object7.cpp> + +int main () {} + diff --git a/tests/auto/qmake/testdata/findMocs/object1.h b/tests/auto/qmake/testdata/findMocs/object1.h new file mode 100644 index 0000000000..7c08ae2b38 --- /dev/null +++ b/tests/auto/qmake/testdata/findMocs/object1.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +/**//*'*/ +#include <QObject> + +class Object1 : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findMocs/object2.h b/tests/auto/qmake/testdata/findMocs/object2.h new file mode 100644 index 0000000000..bd24fb37ad --- /dev/null +++ b/tests/auto/qmake/testdata/findMocs/object2.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/**//*"*/ +#include <QObject> + +class Object2 : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findMocs/object3.h b/tests/auto/qmake/testdata/findMocs/object3.h new file mode 100644 index 0000000000..7cc0dafd22 --- /dev/null +++ b/tests/auto/qmake/testdata/findMocs/object3.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* +*/ +#include <QObject> + +class Object3 : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findMocs/object4.h b/tests/auto/qmake/testdata/findMocs/object4.h new file mode 100644 index 0000000000..881789c715 --- /dev/null +++ b/tests/auto/qmake/testdata/findMocs/object4.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QObject> + +/*/ <-- Inside a comment + +class Object4 : public QObject +{ + Q_OBJECT +}; + +Comment ends there --> /*/ + +// Now we poison moc, just to make sure this doesn't get moc'ed :) +class NonMocObject +/* : QObject */ +{ + /* qmake ignore Q_OBJECT */ + Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findMocs/object5.h b/tests/auto/qmake/testdata/findMocs/object5.h new file mode 100644 index 0000000000..af1ce59e6b --- /dev/null +++ b/tests/auto/qmake/testdata/findMocs/object5.h @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QObject> + +class Object5 : public QObject +{ +/**/Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findMocs/object6.h b/tests/auto/qmake/testdata/findMocs/object6.h new file mode 100644 index 0000000000..b770d60d0d --- /dev/null +++ b/tests/auto/qmake/testdata/findMocs/object6.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/**//*'*/ +#include <QObject> + +class Object6 : public QObject +{ +/**//* + */Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/findMocs/object7.h b/tests/auto/qmake/testdata/findMocs/object7.h new file mode 100644 index 0000000000..06cb17792a --- /dev/null +++ b/tests/auto/qmake/testdata/findMocs/object7.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/**//*'*/ +#include <QObject> + +class Object7 : public QObject +{ +// +Q_OBJECT +}; + diff --git a/tests/auto/qmake/testdata/func_export/func_export.pro b/tests/auto/qmake/testdata/func_export/func_export.pro new file mode 100644 index 0000000000..0cff1f830e --- /dev/null +++ b/tests/auto/qmake/testdata/func_export/func_export.pro @@ -0,0 +1,22 @@ +defineTest(doExport) { + EXPORTED += $$1 + export(EXPORTED) +} + +defineTest(callDoExport) { + doExport(bar) + doExport(baz) + EXPORTED = oink + !isEqual(EXPORTED, "oink") { + message( "FAILED: function-scope exports [$$EXPORTED] != oink" ) + } +} + +doExport(foo) +callDoExport() +!isEqual(EXPORTED, "foo bar baz") { + message( "FAILED: global-scope exports [$$EXPORTED] != foo bar baz" ) +} + + + diff --git a/tests/auto/qmake/testdata/func_variables/func_variables.pro b/tests/auto/qmake/testdata/func_variables/func_variables.pro new file mode 100644 index 0000000000..9b786f7eda --- /dev/null +++ b/tests/auto/qmake/testdata/func_variables/func_variables.pro @@ -0,0 +1,52 @@ +defineTest(testVariable) { + varname=$$1 + value=$$eval($$varname) + RESULT=$$value + export(RESULT) +} + +defineTest(callTest) { + myvar=$$1 + testVariable(myvar) +} + +defineTest(callTestExport) { + myvar=$$1 + export(myvar) + testVariable(myvar) +} + +defineTest(callTestExportChange) { + myvar=foo + export(myvar) + myvar=$$1 + testVariable(myvar) +} + +value=direct +myvar=$$value +testVariable(myvar) +!isEqual(RESULT,$$value) { + message( "FAILED: result [$$RESULT] != $$value" ) +} + +value=export +callTestExport($$value) +!isEqual(RESULT,$$value) { + message( "FAILED: result [$$RESULT] != $$value" ) +} + +value=export_and_change +callTestExportChange($$value) +!isEqual(RESULT,$$value) { + message( "FAILED: result [$$RESULT] != $$value" ) +} + +value=local +callTest($$value) +!isEqual(RESULT,$$value) { + message( "FAILED: result [$$RESULT] != $$value" ) +} + + + diff --git a/tests/auto/qmake/testdata/functions/1.cpp b/tests/auto/qmake/testdata/functions/1.cpp new file mode 100644 index 0000000000..8417c2a163 --- /dev/null +++ b/tests/auto/qmake/testdata/functions/1.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ diff --git a/tests/auto/qmake/testdata/functions/2.cpp b/tests/auto/qmake/testdata/functions/2.cpp new file mode 100644 index 0000000000..8417c2a163 --- /dev/null +++ b/tests/auto/qmake/testdata/functions/2.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ diff --git a/tests/auto/qmake/testdata/functions/functions.pro b/tests/auto/qmake/testdata/functions/functions.pro new file mode 100644 index 0000000000..ad66ee863d --- /dev/null +++ b/tests/auto/qmake/testdata/functions/functions.pro @@ -0,0 +1,87 @@ +CONFIG = qt thread + +#count +!count( CONFIG, 2 ) { + message( "FAILED: count function: $$CONFIG" ) +} + +#contains +!contains( CONFIG, thread ) { + message( "FAILED: contains function: $$CONFIG" ) +} + +#exists +!exists( functions.pro ) { + message( "FAILED: exists function" ) +} + +#isEmpty +isEmpty( CONFIG ) { + message( "FAILED: isEmpty function: $CONFIG" ) +} + +#files +!equals($$list($$files(one/*.cpp)), "one/1.cpp one/2.cpp") { + message( "FAILED: files function: one/*.cpp" ) +} +!equals($$list($$files(one/1*.cpp)), "one/1.cpp") { + message( "FAILED: files function: one/1*.cpp" ) +} +!equals($$list($$files(two/*.cpp)), "two/1.cpp two/2.cpp") { + message( "FAILED: files function: two/*.cpp" ) +} +!equals($$list($$files(three/wildcard*.cpp)), "three/wildcard21.cpp three/wildcard22.cpp") { + message( "FAILED: files function: three/wildcard*.cpp" ) +} +!equals($$list($$files(*.cpp)), "1.cpp 2.cpp wildcard21.cpp wildcard22.cpp") { + message( "FAILED: files function: *.cpp" ) +} +!equals($$list($$files(wildcard*.cpp)), "wildcard21.cpp wildcard22.cpp") { + message( "FAILED: files function: wildcard*.cpp" ) +} + +#infile +!infile( infiletest.pro, DEFINES, QT_DLL ){ + message( "FAILED: infile function" ) +} + +#include +include( infiletest.pro, "", true ) +!contains( DEFINES, QT_DLL ) { + message( "FAILED: include function: $$DEFINES" ) +} + +#replace +VERSION=1.0.0 +VERSION_replaced=$$replace(VERSION,\\.,_) +!isEqual(VERSION_replaced, 1_0_0) { + message( "FAILED: replace function: $$VERSION_replaced" ) +} + +#test functions +defineTest(myTestFunction) { + RESULT = + list=$$1 + for(l, list) { + RESULT += $$l + } + export(RESULT) +} +myTestFunction(oink baa moo) +!equals($$list($$member(RESULT, 0)), "oink") { + message("FAILED: myTestFunction: $$RESULT") +} +myTestFunction("oink baa" moo) +!equals($$list($$member(RESULT, 0)), "oink baa") { + message("FAILED: myTestFunction: $$RESULT") +} +myTestFunction(oink "baa moo") +!equals($$list($$member(RESULT, 0)), "oink") { + message("FAILED: myTestFunction: $$RESULT") +} +myTestFunction("oink baa moo") +!equals($$list($$member(RESULT, 0)), "oink baa moo") { + message("FAILED: myTestFunction: $$RESULT") +} + + diff --git a/tests/auto/qmake/testdata/functions/infiletest.pro b/tests/auto/qmake/testdata/functions/infiletest.pro new file mode 100644 index 0000000000..b2492e19d9 --- /dev/null +++ b/tests/auto/qmake/testdata/functions/infiletest.pro @@ -0,0 +1,2 @@ +DEFINES = QT_DLL + diff --git a/tests/auto/qmake/testdata/functions/one/1.cpp b/tests/auto/qmake/testdata/functions/one/1.cpp new file mode 100644 index 0000000000..8417c2a163 --- /dev/null +++ b/tests/auto/qmake/testdata/functions/one/1.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ diff --git a/tests/auto/qmake/testdata/functions/one/2.cpp b/tests/auto/qmake/testdata/functions/one/2.cpp new file mode 100644 index 0000000000..8417c2a163 --- /dev/null +++ b/tests/auto/qmake/testdata/functions/one/2.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ diff --git a/tests/auto/qmake/testdata/functions/three/wildcard21.cpp b/tests/auto/qmake/testdata/functions/three/wildcard21.cpp new file mode 100644 index 0000000000..8417c2a163 --- /dev/null +++ b/tests/auto/qmake/testdata/functions/three/wildcard21.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ diff --git a/tests/auto/qmake/testdata/functions/three/wildcard22.cpp b/tests/auto/qmake/testdata/functions/three/wildcard22.cpp new file mode 100644 index 0000000000..8417c2a163 --- /dev/null +++ b/tests/auto/qmake/testdata/functions/three/wildcard22.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ diff --git a/tests/auto/qmake/testdata/functions/two/1.cpp b/tests/auto/qmake/testdata/functions/two/1.cpp new file mode 100644 index 0000000000..8417c2a163 --- /dev/null +++ b/tests/auto/qmake/testdata/functions/two/1.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ diff --git a/tests/auto/qmake/testdata/functions/two/2.cpp b/tests/auto/qmake/testdata/functions/two/2.cpp new file mode 100644 index 0000000000..8417c2a163 --- /dev/null +++ b/tests/auto/qmake/testdata/functions/two/2.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ diff --git a/tests/auto/qmake/testdata/functions/wildcard21.cpp b/tests/auto/qmake/testdata/functions/wildcard21.cpp new file mode 100644 index 0000000000..8417c2a163 --- /dev/null +++ b/tests/auto/qmake/testdata/functions/wildcard21.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ diff --git a/tests/auto/qmake/testdata/functions/wildcard22.cpp b/tests/auto/qmake/testdata/functions/wildcard22.cpp new file mode 100644 index 0000000000..8417c2a163 --- /dev/null +++ b/tests/auto/qmake/testdata/functions/wildcard22.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ diff --git a/tests/auto/qmake/testdata/include_dir/foo.pro b/tests/auto/qmake/testdata/include_dir/foo.pro new file mode 100644 index 0000000000..ff4a5cd158 --- /dev/null +++ b/tests/auto/qmake/testdata/include_dir/foo.pro @@ -0,0 +1,12 @@ +UI_DIR = +MOC_DIR= +TEMPLATE=app +TARGET=foo +FORMS=untitled.ui +HEADERS=test_file.h +SOURCES=\ + test_file.cpp\ + main.cpp +CONFIG -= debug_and_release_target + + diff --git a/tests/auto/qmake/testdata/include_dir/main.cpp b/tests/auto/qmake/testdata/include_dir/main.cpp new file mode 100644 index 0000000000..edd5851b64 --- /dev/null +++ b/tests/auto/qmake/testdata/include_dir/main.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "test_file.h" +#include <qapplication.h> + +int main( int argc, char **argv ) +{ + QApplication a( argc, argv ); + SomeObject sc; + return a.exec(); +} diff --git a/tests/auto/qmake/testdata/include_dir/test_file.cpp b/tests/auto/qmake/testdata/include_dir/test_file.cpp new file mode 100644 index 0000000000..f497fb0898 --- /dev/null +++ b/tests/auto/qmake/testdata/include_dir/test_file.cpp @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "test_file.h" + +SomeObject::SomeObject() : QWidget() +{ + setupUi( this ); +} diff --git a/tests/auto/qmake/testdata/include_dir/test_file.h b/tests/auto/qmake/testdata/include_dir/test_file.h new file mode 100644 index 0000000000..ae98ef12fd --- /dev/null +++ b/tests/auto/qmake/testdata/include_dir/test_file.h @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include <qwidget.h> + +#include "ui_untitled.h" + +class SomeObject : public QWidget, public Ui_Form +{ + Q_OBJECT +public: + SomeObject(); +signals: + void someSignal(); +}; diff --git a/tests/auto/qmake/testdata/include_dir/untitled.ui b/tests/auto/qmake/testdata/include_dir/untitled.ui new file mode 100644 index 0000000000..2aecd3c943 --- /dev/null +++ b/tests/auto/qmake/testdata/include_dir/untitled.ui @@ -0,0 +1,22 @@ +<ui version="4.0" > + <author></author> + <comment></comment> + <exportmacro></exportmacro> + <class>Form</class> + <widget class="QWidget" name="Form" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form</string> + </property> + </widget> + <pixmapfunction></pixmapfunction> + <resources/> + <connections/> +</ui> diff --git a/tests/auto/qmake/testdata/include_dir_build/README b/tests/auto/qmake/testdata/include_dir_build/README new file mode 100644 index 0000000000..46017fc43e --- /dev/null +++ b/tests/auto/qmake/testdata/include_dir_build/README @@ -0,0 +1 @@ +Here to ensure include_dir_build exists diff --git a/tests/auto/qmake/testdata/include_function/existing_file.pri b/tests/auto/qmake/testdata/include_function/existing_file.pri new file mode 100644 index 0000000000..8b9aaca340 --- /dev/null +++ b/tests/auto/qmake/testdata/include_function/existing_file.pri @@ -0,0 +1,3 @@ +QT = +CONFIG = console +SOURCES = main.cpp diff --git a/tests/auto/qmake/testdata/include_function/include_existing_file.pro b/tests/auto/qmake/testdata/include_function/include_existing_file.pro new file mode 100644 index 0000000000..424062a9ac --- /dev/null +++ b/tests/auto/qmake/testdata/include_function/include_existing_file.pro @@ -0,0 +1,7 @@ +# Test to see if include(), by default, succeeds when the specific file +# to include exists +include(existing_file.pri) + +# Test to see if by specifying full set of parameters to include() +# succeeds when the specified filed to include exists +include(existing_file.pri, "", false) diff --git a/tests/auto/qmake/testdata/include_function/include_missing_file.pro b/tests/auto/qmake/testdata/include_function/include_missing_file.pro new file mode 100644 index 0000000000..0b59981240 --- /dev/null +++ b/tests/auto/qmake/testdata/include_function/include_missing_file.pro @@ -0,0 +1,3 @@ +# Test to see if include(), by default, fails when the specific file +# to include does not exist +include(missing_file.pri) diff --git a/tests/auto/qmake/testdata/include_function/include_missing_file2.pro b/tests/auto/qmake/testdata/include_function/include_missing_file2.pro new file mode 100644 index 0000000000..542b9ff516 --- /dev/null +++ b/tests/auto/qmake/testdata/include_function/include_missing_file2.pro @@ -0,0 +1,3 @@ +# Specifying full set of parameters to include() to test that a warning +# is shown for this non-existing file. +include(missing_file.pri, "", false) diff --git a/tests/auto/qmake/testdata/include_function/main.cpp b/tests/auto/qmake/testdata/include_function/main.cpp new file mode 100644 index 0000000000..e491464c75 --- /dev/null +++ b/tests/auto/qmake/testdata/include_function/main.cpp @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +int main(int /*argc*/, char ** /*argv*/) +{ + return 0; +} diff --git a/tests/auto/qmake/testdata/install_depends/foo.pro b/tests/auto/qmake/testdata/install_depends/foo.pro new file mode 100644 index 0000000000..357216bff8 --- /dev/null +++ b/tests/auto/qmake/testdata/install_depends/foo.pro @@ -0,0 +1,23 @@ +TEMPLATE=app +TARGET=foo +CONFIG -= debug_and_release_target + +HEADERS=test_file.h +SOURCES=\ + test_file.cpp\ + main.cpp + +test1.files=test1 +test1.path=dist +INSTALLS+=test1 + +test2.files=test2 +test2.path=dist +INSTALLS+=test2 + +target.path=dist +target.depends=install_test1 install_test2 +INSTALLS+=target + + + diff --git a/tests/auto/qmake/testdata/install_depends/main.cpp b/tests/auto/qmake/testdata/install_depends/main.cpp new file mode 100644 index 0000000000..edd5851b64 --- /dev/null +++ b/tests/auto/qmake/testdata/install_depends/main.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "test_file.h" +#include <qapplication.h> + +int main( int argc, char **argv ) +{ + QApplication a( argc, argv ); + SomeObject sc; + return a.exec(); +} diff --git a/tests/auto/qmake/testdata/install_depends/test1 b/tests/auto/qmake/testdata/install_depends/test1 new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/auto/qmake/testdata/install_depends/test1 diff --git a/tests/auto/qmake/testdata/install_depends/test2 b/tests/auto/qmake/testdata/install_depends/test2 new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/auto/qmake/testdata/install_depends/test2 diff --git a/tests/auto/qmake/testdata/install_depends/test_file.cpp b/tests/auto/qmake/testdata/install_depends/test_file.cpp new file mode 100644 index 0000000000..f8522e15ef --- /dev/null +++ b/tests/auto/qmake/testdata/install_depends/test_file.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "test_file.h" + +SomeObject::SomeObject() : QObject() +{ +} diff --git a/tests/auto/qmake/testdata/install_depends/test_file.h b/tests/auto/qmake/testdata/install_depends/test_file.h new file mode 100644 index 0000000000..6307313777 --- /dev/null +++ b/tests/auto/qmake/testdata/install_depends/test_file.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include <qobject.h> + +class SomeObject : public QObject +{ + Q_OBJECT +public: + SomeObject(); +signals: + void someSignal(); +}; diff --git a/tests/auto/qmake/testdata/one_space/main.cpp b/tests/auto/qmake/testdata/one_space/main.cpp new file mode 100644 index 0000000000..14e04856f2 --- /dev/null +++ b/tests/auto/qmake/testdata/one_space/main.cpp @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + + +#include <qapplication.h> + +int main( int argc, char **argv ) +{ + QApplication a( argc, argv ); + return a.exec(); +} diff --git a/tests/auto/qmake/testdata/one_space/one_space.pro b/tests/auto/qmake/testdata/one_space/one_space.pro new file mode 100644 index 0000000000..247bd27096 --- /dev/null +++ b/tests/auto/qmake/testdata/one_space/one_space.pro @@ -0,0 +1,10 @@ +TEMPLATE = app +CONFIG += qt warn_on +SOURCES = main.cpp +TARGET = "one space" +DESTDIR = ./ + +infile($(QTDIR)/.qmake.cache, CONFIG, debug):CONFIG += debug +infile($(QTDIR)/.qmake.cache, CONFIG, release):CONFIG += release + + diff --git a/tests/auto/qmake/testdata/operators/operators.pro b/tests/auto/qmake/testdata/operators/operators.pro new file mode 100644 index 0000000000..5285c1a982 --- /dev/null +++ b/tests/auto/qmake/testdata/operators/operators.pro @@ -0,0 +1,24 @@ +CONFIG = qt thread + +CONFIG += debug +!contains( CONFIG, debug ) { + message( "FAILED: +=" ) +} + +CONFIG -= thread +contains( CONFIG, thread ) { + message( "FAILED: -=" ) +} + +CONFIG = thread +CONFIG *= thread +!count( CONFIG, 1 ) { + message( "FAILED: *=" ) +} + +CONFIG = thread QT_DLL debug +CONFIG ~= s/QT_+/Q_ +!contains( CONFIG, Q_DLL ) { + message( "FAILED: ~=" ) +} + diff --git a/tests/auto/qmake/testdata/prompt/prompt.pro b/tests/auto/qmake/testdata/prompt/prompt.pro new file mode 100644 index 0000000000..238022c755 --- /dev/null +++ b/tests/auto/qmake/testdata/prompt/prompt.pro @@ -0,0 +1,2 @@ +# a = $$prompt(Prompteroo) + diff --git a/tests/auto/qmake/testdata/quotedfilenames/main.cpp b/tests/auto/qmake/testdata/quotedfilenames/main.cpp new file mode 100644 index 0000000000..af65c9f1f1 --- /dev/null +++ b/tests/auto/qmake/testdata/quotedfilenames/main.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + + +#include <qapplication.h> + +int main( int argc, char **argv ) +{ + QApplication a( argc, argv ); + return a.exec(); +} + diff --git a/tests/auto/qmake/testdata/quotedfilenames/quotedfilenames.pro b/tests/auto/qmake/testdata/quotedfilenames/quotedfilenames.pro new file mode 100644 index 0000000000..7f22f437c2 --- /dev/null +++ b/tests/auto/qmake/testdata/quotedfilenames/quotedfilenames.pro @@ -0,0 +1,22 @@ +TEMPLATE = app +CONFIG += qt warn_on +TARGET = quotedfilenames +SOURCES = main.cpp + +RCCINPUT = "rc folder/test.qrc" +RCCOUTPUT = test.cpp + +rcc_test.commands = rcc -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} +rcc_test.output = $$RCCOUTPUT +rcc_test.input = RCCINPUT +rcc_test.variable_out = SOURCES +rcc_test.name = RCC_TEST +rcc_test.CONFIG += no_link +rcc_test.depends = $$QMAKE_RCC + +QMAKE_EXTRA_COMPILERS += rcc_test + +DESTDIR = ./ + + + diff --git a/tests/auto/qmake/testdata/quotedfilenames/rc folder/logo.png b/tests/auto/qmake/testdata/quotedfilenames/rc folder/logo.png Binary files differnew file mode 100644 index 0000000000..bb07d76816 --- /dev/null +++ b/tests/auto/qmake/testdata/quotedfilenames/rc folder/logo.png diff --git a/tests/auto/qmake/testdata/quotedfilenames/rc folder/test.qrc b/tests/auto/qmake/testdata/quotedfilenames/rc folder/test.qrc new file mode 100644 index 0000000000..54ec5dcfc5 --- /dev/null +++ b/tests/auto/qmake/testdata/quotedfilenames/rc folder/test.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>logo.png</file> +</qresource> +</RCC> diff --git a/tests/auto/qmake/testdata/shadow_files/foo.pro b/tests/auto/qmake/testdata/shadow_files/foo.pro new file mode 100644 index 0000000000..fc1e7e586d --- /dev/null +++ b/tests/auto/qmake/testdata/shadow_files/foo.pro @@ -0,0 +1,17 @@ +TEMPLATE=app +CONFIG -= debug_and_release_target +TARGET=foo +HEADERS=test_file.h +SOURCES=\ + test_file.cpp\ + main.cpp + +target.path=dist +INSTALLS+=target + +test.files=test.txt foo.bar +test.path=dist +INSTALLS+=test + + + diff --git a/tests/auto/qmake/testdata/shadow_files/main.cpp b/tests/auto/qmake/testdata/shadow_files/main.cpp new file mode 100644 index 0000000000..edd5851b64 --- /dev/null +++ b/tests/auto/qmake/testdata/shadow_files/main.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "test_file.h" +#include <qapplication.h> + +int main( int argc, char **argv ) +{ + QApplication a( argc, argv ); + SomeObject sc; + return a.exec(); +} diff --git a/tests/auto/qmake/testdata/shadow_files/test.txt b/tests/auto/qmake/testdata/shadow_files/test.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/auto/qmake/testdata/shadow_files/test.txt diff --git a/tests/auto/qmake/testdata/shadow_files/test_file.cpp b/tests/auto/qmake/testdata/shadow_files/test_file.cpp new file mode 100644 index 0000000000..f8522e15ef --- /dev/null +++ b/tests/auto/qmake/testdata/shadow_files/test_file.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "test_file.h" + +SomeObject::SomeObject() : QObject() +{ +} diff --git a/tests/auto/qmake/testdata/shadow_files/test_file.h b/tests/auto/qmake/testdata/shadow_files/test_file.h new file mode 100644 index 0000000000..6307313777 --- /dev/null +++ b/tests/auto/qmake/testdata/shadow_files/test_file.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include <qobject.h> + +class SomeObject : public QObject +{ + Q_OBJECT +public: + SomeObject(); +signals: + void someSignal(); +}; diff --git a/tests/auto/qmake/testdata/shadow_files_build/README b/tests/auto/qmake/testdata/shadow_files_build/README new file mode 100644 index 0000000000..15e48c043e --- /dev/null +++ b/tests/auto/qmake/testdata/shadow_files_build/README @@ -0,0 +1 @@ +Here to ensure shadow_files_build exists, used by the shadow_files test. diff --git a/tests/auto/qmake/testdata/shadow_files_build/foo.bar b/tests/auto/qmake/testdata/shadow_files_build/foo.bar new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/auto/qmake/testdata/shadow_files_build/foo.bar diff --git a/tests/auto/qmake/testdata/simple_app/build/README b/tests/auto/qmake/testdata/simple_app/build/README new file mode 100644 index 0000000000..acfd9d9226 --- /dev/null +++ b/tests/auto/qmake/testdata/simple_app/build/README @@ -0,0 +1 @@ +Here to ensure build/ exists, used by the simple_app_shadowbuild2 test. diff --git a/tests/auto/qmake/testdata/simple_app/main.cpp b/tests/auto/qmake/testdata/simple_app/main.cpp new file mode 100644 index 0000000000..23d1bbd188 --- /dev/null +++ b/tests/auto/qmake/testdata/simple_app/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + + +#include "test_file.h" +#include <qapplication.h> + +int main( int argc, char **argv ) +{ + QApplication a( argc, argv ); + SomeObject sc; + return a.exec(); +} diff --git a/tests/auto/qmake/testdata/simple_app/simple_app.pro b/tests/auto/qmake/testdata/simple_app/simple_app.pro new file mode 100644 index 0000000000..a8c4ad613d --- /dev/null +++ b/tests/auto/qmake/testdata/simple_app/simple_app.pro @@ -0,0 +1,13 @@ +TEMPLATE = app +CONFIG += qt warn_on +HEADERS = test_file.h +SOURCES = test_file.cpp \ + main.cpp +RESOURCES = test.qrc +TARGET = simple_app +DESTDIR = ./ + +infile($(QTDIR)/.qmake.cache, CONFIG, debug):CONFIG += debug +infile($(QTDIR)/.qmake.cache, CONFIG, release):CONFIG += release + + diff --git a/tests/auto/qmake/testdata/simple_app/test.qrc b/tests/auto/qmake/testdata/simple_app/test.qrc new file mode 100644 index 0000000000..decde3dd24 --- /dev/null +++ b/tests/auto/qmake/testdata/simple_app/test.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>test.qrc</file> + </qresource> +</RCC> diff --git a/tests/auto/qmake/testdata/simple_app/test_file.cpp b/tests/auto/qmake/testdata/simple_app/test_file.cpp new file mode 100644 index 0000000000..f8522e15ef --- /dev/null +++ b/tests/auto/qmake/testdata/simple_app/test_file.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "test_file.h" + +SomeObject::SomeObject() : QObject() +{ +} diff --git a/tests/auto/qmake/testdata/simple_app/test_file.h b/tests/auto/qmake/testdata/simple_app/test_file.h new file mode 100644 index 0000000000..6307313777 --- /dev/null +++ b/tests/auto/qmake/testdata/simple_app/test_file.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include <qobject.h> + +class SomeObject : public QObject +{ + Q_OBJECT +public: + SomeObject(); +signals: + void someSignal(); +}; diff --git a/tests/auto/qmake/testdata/simple_app_build/README b/tests/auto/qmake/testdata/simple_app_build/README new file mode 100644 index 0000000000..81dc596e5b --- /dev/null +++ b/tests/auto/qmake/testdata/simple_app_build/README @@ -0,0 +1 @@ +Placeholder file to ensure this directory exists diff --git a/tests/auto/qmake/testdata/simple_dll/simple.cpp b/tests/auto/qmake/testdata/simple_dll/simple.cpp new file mode 100644 index 0000000000..bcb948cd22 --- /dev/null +++ b/tests/auto/qmake/testdata/simple_dll/simple.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "simple.h" + +Simple::Simple() +{ +} + +Simple::~Simple() +{ +} + +QString Simple::test() +{ + return "This is a test"; +} diff --git a/tests/auto/qmake/testdata/simple_dll/simple.h b/tests/auto/qmake/testdata/simple_dll/simple.h new file mode 100644 index 0000000000..429e7d9ed8 --- /dev/null +++ b/tests/auto/qmake/testdata/simple_dll/simple.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef SIMPLE_H +#define SIMPLE_H + +#include <qstring.h> + +//class SIMPLEDLL_EXPORT Simple +class Simple +{ +public: + Simple(); + ~Simple(); + + QString test(); +}; + +#endif + + + diff --git a/tests/auto/qmake/testdata/simple_dll/simple_dll.pro b/tests/auto/qmake/testdata/simple_dll/simple_dll.pro new file mode 100644 index 0000000000..9af38ecce6 --- /dev/null +++ b/tests/auto/qmake/testdata/simple_dll/simple_dll.pro @@ -0,0 +1,19 @@ +TEMPLATE = lib +CONFIG += qt warn_on dll + +win32:DEFINES += SIMPLEDLL_MAKEDLL + +HEADERS = simple.h +SOURCES = simple.cpp + +VERSION = 1.0.0 +INCLUDEPATH += . tmp +MOC_DIR = tmp +OBJECTS_DIR = tmp +TARGET = simple_dll +DESTDIR = ./ + +infile($(QTDIR)/.qmake.cache, CONFIG, debug):CONFIG += debug +infile($(QTDIR)/.qmake.cache, CONFIG, release):CONFIG += release + + diff --git a/tests/auto/qmake/testdata/simple_lib/simple.cpp b/tests/auto/qmake/testdata/simple_lib/simple.cpp new file mode 100644 index 0000000000..bcb948cd22 --- /dev/null +++ b/tests/auto/qmake/testdata/simple_lib/simple.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "simple.h" + +Simple::Simple() +{ +} + +Simple::~Simple() +{ +} + +QString Simple::test() +{ + return "This is a test"; +} diff --git a/tests/auto/qmake/testdata/simple_lib/simple.h b/tests/auto/qmake/testdata/simple_lib/simple.h new file mode 100644 index 0000000000..e6cba5cc26 --- /dev/null +++ b/tests/auto/qmake/testdata/simple_lib/simple.h @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef SIMPLE_H +#define SIMPLE_H + +#include <qstring.h> + +class Simple +{ +public: + Simple(); + ~Simple(); + + QString test(); +}; + +#endif + + + diff --git a/tests/auto/qmake/testdata/simple_lib/simple_lib.pro b/tests/auto/qmake/testdata/simple_lib/simple_lib.pro new file mode 100644 index 0000000000..209bba6348 --- /dev/null +++ b/tests/auto/qmake/testdata/simple_lib/simple_lib.pro @@ -0,0 +1,14 @@ +TEMPLATE = lib +CONFIG += qt warn_on release staticlib +CONFIG -= dll + +HEADERS = simple.h +SOURCES = simple.cpp + +VERSION = 1.0.0 +INCLUDEPATH += . tmp +MOC_DIR = tmp +OBJECTS_DIR = tmp +TARGET = simple_lib +DESTDIR = ./ + diff --git a/tests/auto/qmake/testdata/subdirs/simple_app/main.cpp b/tests/auto/qmake/testdata/subdirs/simple_app/main.cpp new file mode 100644 index 0000000000..23d1bbd188 --- /dev/null +++ b/tests/auto/qmake/testdata/subdirs/simple_app/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + + +#include "test_file.h" +#include <qapplication.h> + +int main( int argc, char **argv ) +{ + QApplication a( argc, argv ); + SomeObject sc; + return a.exec(); +} diff --git a/tests/auto/qmake/testdata/subdirs/simple_app/simple_app.pro b/tests/auto/qmake/testdata/subdirs/simple_app/simple_app.pro new file mode 100644 index 0000000000..f496d5bb8e --- /dev/null +++ b/tests/auto/qmake/testdata/subdirs/simple_app/simple_app.pro @@ -0,0 +1,12 @@ +TEMPLATE = app +CONFIG += qt warn_on +HEADERS = test_file.h +SOURCES = test_file.cpp \ + main.cpp +TARGET = simple_app +DESTDIR = ./ + +infile($(QTDIR)/.qmake.cache, CONFIG, debug):CONFIG += debug +infile($(QTDIR)/.qmake.cache, CONFIG, release):CONFIG += release + + diff --git a/tests/auto/qmake/testdata/subdirs/simple_app/test_file.cpp b/tests/auto/qmake/testdata/subdirs/simple_app/test_file.cpp new file mode 100644 index 0000000000..f8522e15ef --- /dev/null +++ b/tests/auto/qmake/testdata/subdirs/simple_app/test_file.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "test_file.h" + +SomeObject::SomeObject() : QObject() +{ +} diff --git a/tests/auto/qmake/testdata/subdirs/simple_app/test_file.h b/tests/auto/qmake/testdata/subdirs/simple_app/test_file.h new file mode 100644 index 0000000000..6307313777 --- /dev/null +++ b/tests/auto/qmake/testdata/subdirs/simple_app/test_file.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include <qobject.h> + +class SomeObject : public QObject +{ + Q_OBJECT +public: + SomeObject(); +signals: + void someSignal(); +}; diff --git a/tests/auto/qmake/testdata/subdirs/simple_dll/simple.cpp b/tests/auto/qmake/testdata/subdirs/simple_dll/simple.cpp new file mode 100644 index 0000000000..bcb948cd22 --- /dev/null +++ b/tests/auto/qmake/testdata/subdirs/simple_dll/simple.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "simple.h" + +Simple::Simple() +{ +} + +Simple::~Simple() +{ +} + +QString Simple::test() +{ + return "This is a test"; +} diff --git a/tests/auto/qmake/testdata/subdirs/simple_dll/simple.h b/tests/auto/qmake/testdata/subdirs/simple_dll/simple.h new file mode 100644 index 0000000000..429e7d9ed8 --- /dev/null +++ b/tests/auto/qmake/testdata/subdirs/simple_dll/simple.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef SIMPLE_H +#define SIMPLE_H + +#include <qstring.h> + +//class SIMPLEDLL_EXPORT Simple +class Simple +{ +public: + Simple(); + ~Simple(); + + QString test(); +}; + +#endif + + + diff --git a/tests/auto/qmake/testdata/subdirs/simple_dll/simple_dll.pro b/tests/auto/qmake/testdata/subdirs/simple_dll/simple_dll.pro new file mode 100644 index 0000000000..a54a07a0e7 --- /dev/null +++ b/tests/auto/qmake/testdata/subdirs/simple_dll/simple_dll.pro @@ -0,0 +1,20 @@ +include($(QTDIR)/.qmake.cache) +TEMPLATE = lib +CONFIG += qt warn_on dll + +win32:DEFINES += SIMPLEDLL_MAKEDLL + +HEADERS = simple.h +SOURCES = simple.cpp + +VERSION = 1.0.0 +INCLUDEPATH += . tmp +MOC_DIR = tmp +OBJECTS_DIR = tmp +TARGET = simple_dll +DESTDIR = ./ + +infile($(QTDIR)/.qmake.cache, CONFIG, debug):CONFIG += debug +infile($(QTDIR)/.qmake.cache, CONFIG, release):CONFIG += release + + diff --git a/tests/auto/qmake/testdata/subdirs/subdirs.pro b/tests/auto/qmake/testdata/subdirs/subdirs.pro new file mode 100644 index 0000000000..5da200eabb --- /dev/null +++ b/tests/auto/qmake/testdata/subdirs/subdirs.pro @@ -0,0 +1,6 @@ +TEMPLATE = subdirs +SUBDIRS = simple_app \ + simple_dll +CONFIG += ordered + + diff --git a/tests/auto/qmake/testdata/substitutes/sub/test2.in b/tests/auto/qmake/testdata/substitutes/sub/test2.in new file mode 100644 index 0000000000..78a60695ae --- /dev/null +++ b/tests/auto/qmake/testdata/substitutes/sub/test2.in @@ -0,0 +1 @@ +heya diff --git a/tests/auto/qmake/testdata/substitutes/test.in b/tests/auto/qmake/testdata/substitutes/test.in new file mode 100644 index 0000000000..2fa05e0110 --- /dev/null +++ b/tests/auto/qmake/testdata/substitutes/test.in @@ -0,0 +1,2 @@ +test +tst diff --git a/tests/auto/qmake/testdata/substitutes/test.pro b/tests/auto/qmake/testdata/substitutes/test.pro new file mode 100644 index 0000000000..26b02722e8 --- /dev/null +++ b/tests/auto/qmake/testdata/substitutes/test.pro @@ -0,0 +1,5 @@ +QMAKE_SUBSTITUTES += test.in sub/test2.in indirect + +indirect.input = $$PWD/test3.txt +indirect.output = $$OUT_PWD/sub/indirect_test.txt + diff --git a/tests/auto/qmake/testdata/substitutes/test3.txt b/tests/auto/qmake/testdata/substitutes/test3.txt new file mode 100644 index 0000000000..ce01362503 --- /dev/null +++ b/tests/auto/qmake/testdata/substitutes/test3.txt @@ -0,0 +1 @@ +hello diff --git a/tests/auto/qmake/testdata/substitutes_build/README b/tests/auto/qmake/testdata/substitutes_build/README new file mode 100644 index 0000000000..81dc596e5b --- /dev/null +++ b/tests/auto/qmake/testdata/substitutes_build/README @@ -0,0 +1 @@ +Placeholder file to ensure this directory exists diff --git a/tests/auto/qmake/testdata/variables/variables.pro b/tests/auto/qmake/testdata/variables/variables.pro new file mode 100644 index 0000000000..cefcddf0fb --- /dev/null +++ b/tests/auto/qmake/testdata/variables/variables.pro @@ -0,0 +1,14 @@ +CONFIG = 1 2 3 4 5 +JOINEDCONFIG = $$join( CONFIG, "-GLUE-", "-BEFORE-", "-AFTER-" ) +!contains( JOINEDCONFIG, -BEFORE-1-GLUE-2-GLUE-3-GLUE-4-GLUE-5-AFTER- ) { + message( "FAILED: join [$$JOINEDCONFIG != -BEFORE-1-GLUE-2-GLUE-3-GLUE-4-GLUE-5-AFTER-]" ) +} + +# To test member we need to use join +NEWCONFIG = $$member( CONFIG, 4 ) $$member( CONFIG, 3 ) $$member( CONFIG, 2 ) +JOINEDNEWCONFIG = $$join( NEWCONFIG, "-" ) +!contains( JOINEDNEWCONFIG, 5-4-3 ) { + message( "FAILED: member [$$JOINEDNEWCONFIG != 5-4-3]" ) +} + + diff --git a/tests/auto/qmake/tst_qmake.cpp b/tests/auto/qmake/tst_qmake.cpp new file mode 100644 index 0000000000..81a51e10f3 --- /dev/null +++ b/tests/auto/qmake/tst_qmake.cpp @@ -0,0 +1,504 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/QtTest> + +#if !defined(QMAKE_CROSS_COMPILED) + +#include "testcompiler.h" + +#include <QObject> +#include <QDir> + +class tst_qmake : public QObject +{ + Q_OBJECT + +public: + tst_qmake(); + virtual ~tst_qmake(); + +public slots: + void initTestCase(); + void cleanupTestCase(); + void init(); + void cleanup(); + +private slots: + void simple_app(); + void simple_app_shadowbuild(); + void simple_app_shadowbuild2(); + void simple_lib(); + void simple_dll(); + void subdirs(); + void functions(); + void operators(); + void variables(); + void func_export(); + void func_variables(); + void comments(); + void duplicateLibraryEntries(); + void export_across_file_boundaries(); + void include_dir(); + void install_files(); + void install_depends(); + void quotedfilenames(); + void prompt(); + void one_space(); + void findMocs(); + void findDeps(); +#ifndef Q_OS_WIN + // Test requires make + void bundle_spaces(); +#endif + void includefunction(); + void substitutes(); + +private: + TestCompiler test_compiler; + QString base_path; +}; + +tst_qmake::tst_qmake() +{ + QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath); + QString cmd = QString("%2/qmake \"QT_VERSION=%1\"").arg(QT_VERSION).arg(binpath); +#ifdef Q_CC_MSVC + test_compiler.setBaseCommands( "nmake", cmd ); +#elif defined(Q_CC_MINGW) + test_compiler.setBaseCommands( "mingw32-make", cmd ); +#elif defined(Q_OS_WIN) && defined(Q_CC_GNU) + test_compiler.setBaseCommands( "mmmake", cmd ); +#else + test_compiler.setBaseCommands( "make", cmd ); +#endif + QDir dir; + base_path = dir.currentPath(); +} + +tst_qmake::~tst_qmake() +{ + +} + +void tst_qmake::initTestCase() +{ +} + +void tst_qmake::cleanupTestCase() +{ +} + +void tst_qmake::init() +{ + test_compiler.clearCommandOutput(); +} + +void tst_qmake::cleanup() +{ + test_compiler.clearCommandOutput(); +} + +void tst_qmake::simple_app() +{ + QString workDir = base_path + "/testdata/simple_app"; + + QVERIFY( test_compiler.qmake( workDir, "simple_app" )); + QVERIFY( test_compiler.make( workDir )); + QVERIFY( test_compiler.exists( workDir, "simple_app", Exe, "1.0.0" )); + QVERIFY( test_compiler.makeClean( workDir )); + QVERIFY( test_compiler.exists( workDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.makeDistClean( workDir )); + QVERIFY( !test_compiler.exists( workDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( test_compiler.removeMakefile( workDir ) ); +} + +void tst_qmake::simple_app_shadowbuild() +{ + QString workDir = base_path + "/testdata/simple_app"; + QString buildDir = base_path + "/testdata/simple_app_build"; + + QVERIFY( test_compiler.qmake( workDir, "simple_app", buildDir )); + QVERIFY( test_compiler.make( buildDir )); + QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); + QVERIFY( test_compiler.makeClean( buildDir )); + QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.makeDistClean( buildDir )); + QVERIFY( !test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( test_compiler.removeMakefile( buildDir ) ); +} + +void tst_qmake::simple_app_shadowbuild2() +{ + QString workDir = base_path + "/testdata/simple_app"; + QString buildDir = base_path + "/testdata/simple_app/build"; + + QVERIFY( test_compiler.qmake( workDir, "simple_app", buildDir )); + QVERIFY( test_compiler.make( buildDir )); + QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); + QVERIFY( test_compiler.makeClean( buildDir )); + QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.makeDistClean( buildDir )); + QVERIFY( !test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( test_compiler.removeMakefile( buildDir ) ); +} + +void tst_qmake::simple_dll() +{ + QString workDir = base_path + "/testdata/simple_dll"; + + QDir D; + D.remove( workDir + "/Makefile"); + QVERIFY( test_compiler.qmake( workDir, "simple_dll" )); + QVERIFY( test_compiler.make( workDir )); + QVERIFY( test_compiler.exists( workDir, "simple_dll", Dll, "1.0.0" )); + QVERIFY( test_compiler.makeClean( workDir )); + QVERIFY( test_compiler.exists( workDir, "simple_dll", Dll, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.makeDistClean( workDir )); + QVERIFY( !test_compiler.exists( workDir, "simple_dll", Dll, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( test_compiler.removeMakefile( workDir ) ); +} + +void tst_qmake::simple_lib() +{ + QString workDir = base_path + "/testdata/simple_lib"; + + QDir D; + D.remove( workDir + "/Makefile"); + QVERIFY( test_compiler.qmake( workDir, "simple_lib" )); + QVERIFY( test_compiler.make( workDir )); + QVERIFY( test_compiler.exists( workDir, "simple_lib", Lib, "1.0.0" )); + QVERIFY( test_compiler.makeClean( workDir )); + QVERIFY( test_compiler.exists( workDir, "simple_lib", Lib, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.makeDistClean( workDir )); + QVERIFY( !test_compiler.exists( workDir, "simple_lib", Lib, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( test_compiler.removeMakefile( workDir ) ); +} + +void tst_qmake::subdirs() +{ + QString workDir = base_path + "/testdata/subdirs"; + + QDir D; + D.remove( workDir + "/simple_app/Makefile"); + D.remove( workDir + "/simple_dll/Makefile"); + QVERIFY( test_compiler.qmake( workDir, "subdirs" )); + QVERIFY( test_compiler.make( workDir )); + QVERIFY( test_compiler.exists( workDir + "/simple_app", "simple_app", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/simple_dll", "simple_dll", Dll, "1.0.0" )); + QVERIFY( test_compiler.makeClean( workDir )); + // Should still exist after a make clean + QVERIFY( test_compiler.exists( workDir + "/simple_app", "simple_app", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/simple_dll", "simple_dll", Dll, "1.0.0" )); + // Since subdirs templates do not have a make dist clean, we should clean up ourselves + // properly + QVERIFY( test_compiler.makeDistClean( workDir )); + QVERIFY( test_compiler.removeMakefile( workDir ) ); +} + +void tst_qmake::functions() +{ + QString workDir = base_path + "/testdata/functions"; + QVERIFY( test_compiler.qmake( workDir, "functions" )); +} + +void tst_qmake::operators() +{ + QString workDir = base_path + "/testdata/operators"; + QVERIFY( test_compiler.qmake( workDir, "operators" )); +} + +void tst_qmake::variables() +{ + QString workDir = base_path + "/testdata/variables"; + QVERIFY(test_compiler.qmake( workDir, "variables" )); +} + +void tst_qmake::func_export() +{ + QString workDir = base_path + "/testdata/func_export"; + QVERIFY(test_compiler.qmake( workDir, "func_export" )); +} + +void tst_qmake::func_variables() +{ + QString workDir = base_path + "/testdata/func_variables"; + QVERIFY(test_compiler.qmake( workDir, "func_variables" )); +} + +void tst_qmake::comments() +{ + QString workDir = base_path + "/testdata/comments"; + QVERIFY(test_compiler.qmake( workDir, "comments" )); +} + +void tst_qmake::duplicateLibraryEntries() +{ + QVERIFY(true); + /* TODO: this test does not work as the problem it tests doesn't happen + until after the parsing of the pro-file and thus has to be tested + by parsing the Makefile. This is not doable with the current + testcompiler framework and has as such been put on hold. + + QString workDir = base_path + "/testdata/duplicateLibraryEntries"; + QVERIFY(test_compiler.qmake(workDir, "duplicateLibraryEntries")); */ +} + +void tst_qmake::export_across_file_boundaries() +{ + // This relies on features so we need to set the QMAKEFEATURES environment variable + test_compiler.addToEnvironment("QMAKEFEATURES=."); + QString workDir = base_path + "/testdata/export_across_file_boundaries"; + QVERIFY( test_compiler.qmake( workDir, "foo" )); + test_compiler.resetEnvironment(); +} + +void tst_qmake::include_dir() +{ + QString workDir = base_path + "/testdata/include_dir"; + QVERIFY( test_compiler.qmake( workDir, "foo" )); + QVERIFY( test_compiler.make( workDir )); + QVERIFY( test_compiler.exists( workDir, "foo", Exe, "1.0.0" )); + QVERIFY( test_compiler.makeDistClean( workDir )); + + QString buildDir = base_path + "/testdata/include_dir_build"; + QVERIFY( test_compiler.qmake( workDir, "foo", buildDir )); + QVERIFY( test_compiler.make( buildDir )); + QVERIFY( test_compiler.exists( buildDir, "foo", Exe, "1.0.0" )); + QVERIFY( test_compiler.makeDistClean( buildDir )); +} + +void tst_qmake::install_files() +{ + QString workDir = base_path + "/testdata/shadow_files"; + QVERIFY( test_compiler.qmake( workDir, "foo" )); + QVERIFY( test_compiler.make( workDir )); + QVERIFY( test_compiler.exists( workDir, "foo", Exe, "1.0.0" )); + QVERIFY( test_compiler.make( workDir, "install" )); + QVERIFY( test_compiler.exists( workDir + "/dist", "foo", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/dist", "test.txt", Plain, "1.0.0" )); + QVERIFY( test_compiler.make( workDir, "uninstall" )); + QVERIFY( test_compiler.makeDistClean( workDir )); + + QString buildDir = base_path + "/testdata/shadow_files_build"; + QVERIFY( test_compiler.qmake( workDir, "foo", buildDir )); + QVERIFY( test_compiler.make( buildDir )); + QVERIFY( test_compiler.exists( buildDir, "foo", Exe, "1.0.0" )); + QVERIFY( test_compiler.make( buildDir, "install" )); + QVERIFY( test_compiler.exists( workDir + "/dist", "foo", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/dist", "test.txt", Plain, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/dist", "foo.bar", Plain, "1.0.0" )); + QVERIFY( test_compiler.make( buildDir, "uninstall" )); + QVERIFY( test_compiler.makeDistClean( buildDir )); +} + +void tst_qmake::install_depends() +{ + QString workDir = base_path + "/testdata/install_depends"; + QVERIFY( test_compiler.qmake( workDir, "foo" )); + QVERIFY( test_compiler.make( workDir )); + QVERIFY( test_compiler.exists( workDir, "foo", Exe, "1.0.0" )); + QVERIFY( test_compiler.make( workDir, "install" )); + QVERIFY( test_compiler.exists( workDir + "/dist", "foo", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/dist", "test1", Plain, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/dist", "test2", Plain, "1.0.0" )); + QVERIFY( test_compiler.make( workDir, "uninstall" )); + QVERIFY( test_compiler.makeDistClean( workDir )); +} +void tst_qmake::quotedfilenames() +{ + QString workDir = base_path + "/testdata/quotedfilenames"; + QVERIFY( test_compiler.qmake( workDir, "quotedfilenames" )); + QVERIFY( test_compiler.makeClean( workDir )); + QVERIFY( test_compiler.make( workDir )); + QVERIFY( test_compiler.exists( workDir, "quotedfilenames", Exe, "1.0.0" )); +} + +void tst_qmake::prompt() +{ +#if 0 + QProcess qmake; + qmake.setReadChannelMode(QProcess::MergedChannels); + qmake.setWorkingDirectory(QLatin1String("testdata/prompt")); + qmake.start(QLatin1String("qmake CONFIG-=debug_and_release CONFIG-=debug CONFIG+=release"), + QIODevice::Text | QIODevice::ReadWrite); + QVERIFY(qmake.waitForStarted(20000)); + QByteArray read = qmake.readAll(); + qDebug() << read; + QCOMPARE(read, QByteArray("Project PROMPT: Prompteroo? ")); + qmake.write("promptetiprompt\n"); + QVERIFY(qmake.waitForFinished(20000)); +#endif +} + +void tst_qmake::one_space() +{ + QString workDir = base_path + "/testdata/one_space"; + + QVERIFY( test_compiler.qmake( workDir, "one_space" )); + QVERIFY( test_compiler.make( workDir )); + QVERIFY( test_compiler.exists( workDir, "one space", Exe, "1.0.0" )); + QVERIFY( test_compiler.makeClean( workDir )); + QVERIFY( test_compiler.exists( workDir, "one space", Exe, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.makeDistClean( workDir )); + QVERIFY( !test_compiler.exists( workDir, "one space", Exe, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( test_compiler.removeMakefile( workDir ) ); +} + +void tst_qmake::findMocs() +{ + QString workDir = base_path + "/testdata/findMocs"; + + QVERIFY( test_compiler.qmake(workDir, "findMocs") ); + QVERIFY( test_compiler.make(workDir) ); + QVERIFY( test_compiler.exists(workDir, "findMocs", Exe, "1.0.0" ) ); + QVERIFY( test_compiler.makeClean(workDir) ); + QVERIFY( test_compiler.exists(workDir, "findMocs", Exe, "1.0.0" ) ); + QVERIFY( test_compiler.makeDistClean(workDir ) ); + QVERIFY( !test_compiler.exists(workDir, "findMocs", Exe, "1.0.0" ) ); + QVERIFY( test_compiler.removeMakefile(workDir) ); +} + +void tst_qmake::findDeps() +{ + QString workDir = base_path + "/testdata/findDeps"; + + QVERIFY( test_compiler.qmake(workDir, "findDeps") ); + QVERIFY( test_compiler.make(workDir) ); + QVERIFY( test_compiler.exists(workDir, "findDeps", Exe, "1.0.0" ) ); + QVERIFY( test_compiler.makeClean(workDir) ); + QVERIFY( test_compiler.exists(workDir, "findDeps", Exe, "1.0.0" ) ); + QVERIFY( test_compiler.makeDistClean(workDir ) ); + QVERIFY( !test_compiler.exists(workDir, "findDeps", Exe, "1.0.0" ) ); + QVERIFY( test_compiler.removeMakefile(workDir) ); +} + +struct TempFile + : QFile +{ + TempFile(QString filename) + : QFile(filename) + { + } + + ~TempFile() + { + if (this->exists()) + this->remove(); + } +}; + +#ifndef Q_OS_WIN +void tst_qmake::bundle_spaces() +{ + QString workDir = base_path + "/testdata/bundle-spaces"; + + // We set up alternate commands here, to make sure we're testing Mac + // Bundles and since this might be the wrong output we rely on dry-running + // make (-n). + + TestCompiler local_tc; + local_tc.setBaseCommands("make -n", "qmake -macx -spec macx-g++"); + + QVERIFY( local_tc.qmake(workDir, "bundle-spaces") ); + + TempFile non_existing_file(workDir + "/non-existing file"); + QVERIFY( !non_existing_file.exists() ); + + // Make fails: no rule to make "non-existing file" + QVERIFY( !local_tc.make(workDir) ); + + QVERIFY( non_existing_file.open(QIODevice::WriteOnly) ); + QVERIFY( non_existing_file.exists() ); + + // Aha! + QVERIFY( local_tc.make(workDir) ); + + // Cleanup + QVERIFY( non_existing_file.remove() ); + QVERIFY( !non_existing_file.exists() ); + QVERIFY( local_tc.removeMakefile(workDir) ); +} +#endif // Q_OS_WIN + +void tst_qmake::includefunction() +{ + QString workDir = base_path + "/testdata/include_function"; + QString warningMsg("Unable to find file for inclusion"); + QVERIFY(test_compiler.qmake( workDir, "include_existing_file")); + QVERIFY(!test_compiler.commandOutput().contains(warningMsg)); + + // test include() usage on a missing file + test_compiler.clearCommandOutput(); + workDir = base_path + "/testdata/include_function"; + QVERIFY(test_compiler.qmake( workDir, "include_missing_file" )); + QVERIFY(test_compiler.commandOutput().contains(warningMsg)); + + // test include() usage on a missing file when all function parameters are used + test_compiler.clearCommandOutput(); + workDir = base_path + "/testdata/include_function"; + QVERIFY(test_compiler.qmake( workDir, "include_missing_file2" )); + QVERIFY(test_compiler.commandOutput().contains(warningMsg)); +} + +void tst_qmake::substitutes() +{ + QString workDir = base_path + "/testdata/substitutes"; + QVERIFY( test_compiler.qmake( workDir, "test" )); + QVERIFY( test_compiler.exists( workDir, "test", Plain, "" )); + QVERIFY( test_compiler.exists( workDir, "sub/test2", Plain, "" )); + QVERIFY( test_compiler.exists( workDir, "sub/indirect_test.txt", Plain, "" )); + QVERIFY( test_compiler.makeDistClean( workDir )); + + QString buildDir = base_path + "/testdata/substitutes_build"; + QVERIFY( test_compiler.qmake( workDir, "test", buildDir )); + QVERIFY( test_compiler.exists( buildDir, "test", Plain, "" )); + QVERIFY( test_compiler.exists( buildDir, "sub/test2", Plain, "" )); + QVERIFY( test_compiler.exists( buildDir, "sub/indirect_test.txt", Plain, "" )); + QVERIFY( test_compiler.makeDistClean( buildDir )); +} + +QTEST_MAIN(tst_qmake) +#include "tst_qmake.moc" + +#else // QMAKE_CROSS_COMPILED +QTEST_NOOP_MAIN +#endif |