diff options
Diffstat (limited to 'tests/auto/blackbox/testdata')
22 files changed, 776 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/buildproperties_source/bp_source.qbp b/tests/auto/blackbox/testdata/buildproperties_source/bp_source.qbp new file mode 100644 index 000000000..0d6cb5741 --- /dev/null +++ b/tests/auto/blackbox/testdata/buildproperties_source/bp_source.qbp @@ -0,0 +1,16 @@ +import qbs.base 1.0 + +Project { + Product { + type: "application" + name: "HelloWorld" + + Depends { name: 'cpp' } + + Group { + cpp.defines: ['WORLD="BANANA"'] + files : [ "main.cpp" ] + } + } +} + diff --git a/tests/auto/blackbox/testdata/buildproperties_source/main.cpp b/tests/auto/blackbox/testdata/buildproperties_source/main.cpp new file mode 100644 index 000000000..fbae63cf0 --- /dev/null +++ b/tests/auto/blackbox/testdata/buildproperties_source/main.cpp @@ -0,0 +1,47 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ + +#include <stdio.h> + +#ifndef WORLD +# error WORLD is not defined +#endif + +int main() +{ + puts("Hello " WORLD "!"); +} diff --git a/tests/auto/blackbox/testdata/moc_h/bla.cpp b/tests/auto/blackbox/testdata/moc_h/bla.cpp new file mode 100644 index 000000000..9045af23d --- /dev/null +++ b/tests/auto/blackbox/testdata/moc_h/bla.cpp @@ -0,0 +1,44 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ + +#include "bla.h" + +int main() +{ + MyObject obj; + obj.setObjectName("I am the object!"); +} diff --git a/tests/auto/blackbox/testdata/moc_h/bla_noqobject.h b/tests/auto/blackbox/testdata/moc_h/bla_noqobject.h new file mode 100644 index 000000000..54e7cbd8f --- /dev/null +++ b/tests/auto/blackbox/testdata/moc_h/bla_noqobject.h @@ -0,0 +1,43 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ + +#include <QObject> + +class MyObject : public QObject +{ +}; + diff --git a/tests/auto/blackbox/testdata/moc_h/bla_qobject.h b/tests/auto/blackbox/testdata/moc_h/bla_qobject.h new file mode 100644 index 000000000..4f58ed10a --- /dev/null +++ b/tests/auto/blackbox/testdata/moc_h/bla_qobject.h @@ -0,0 +1,44 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ + +#include <QObject> + +class MyObject : public QObject +{ + Q_OBJECT +}; + diff --git a/tests/auto/blackbox/testdata/moc_h/i.qbp b/tests/auto/blackbox/testdata/moc_h/i.qbp new file mode 100644 index 000000000..0e103ecd9 --- /dev/null +++ b/tests/auto/blackbox/testdata/moc_h/i.qbp @@ -0,0 +1,18 @@ +import qbs.base 1.0 + +Project { + Product { + type: "application" + name: "i" + + Depends { + name: "Qt.core" + } + + files: [ + "bla.cpp", + "bla.h" + ] + } +} + diff --git a/tests/auto/blackbox/testdata/qrc/bla.cpp b/tests/auto/blackbox/testdata/qrc/bla.cpp new file mode 100644 index 000000000..cbb85fa03 --- /dev/null +++ b/tests/auto/blackbox/testdata/qrc/bla.cpp @@ -0,0 +1,42 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ + +int main() +{ + return 3; +} + diff --git a/tests/auto/blackbox/testdata/qrc/bla.qrc b/tests/auto/blackbox/testdata/qrc/bla.qrc new file mode 100644 index 000000000..46c93847e --- /dev/null +++ b/tests/auto/blackbox/testdata/qrc/bla.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>stuff.txt</file> + </qresource> +</RCC> diff --git a/tests/auto/blackbox/testdata/qrc/i.qbp b/tests/auto/blackbox/testdata/qrc/i.qbp new file mode 100644 index 000000000..11b9d1be3 --- /dev/null +++ b/tests/auto/blackbox/testdata/qrc/i.qbp @@ -0,0 +1,19 @@ +import qbs.base 1.0 + +Project { + Product { + type: "application" + name: "i" + + Depends { + name: "Qt.core" + } + + files: [ + "bla.cpp", + "bla.qrc", + "stuff.txt" + ] + } +} + diff --git a/tests/auto/blackbox/testdata/qrc/stuff.txt b/tests/auto/blackbox/testdata/qrc/stuff.txt new file mode 100644 index 000000000..78f0d32c6 --- /dev/null +++ b/tests/auto/blackbox/testdata/qrc/stuff.txt @@ -0,0 +1 @@ +a resource file diff --git a/tests/auto/blackbox/testdata/trackAddFile/after/main.cpp b/tests/auto/blackbox/testdata/trackAddFile/after/main.cpp new file mode 100644 index 000000000..749b6c2d1 --- /dev/null +++ b/tests/auto/blackbox/testdata/trackAddFile/after/main.cpp @@ -0,0 +1,50 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ +#include "narf.h" +#include "zort.h" +#include <cstdio> + +int main(int argc, char **argv) +{ + printf("Hello World!\n"); + Narf narf; + narf.shout(); + Zort zort; + zort.shout(); + return 0; +} + diff --git a/tests/auto/blackbox/testdata/trackAddFile/after/project.qbp b/tests/auto/blackbox/testdata/trackAddFile/after/project.qbp new file mode 100644 index 000000000..2e3a56102 --- /dev/null +++ b/tests/auto/blackbox/testdata/trackAddFile/after/project.qbp @@ -0,0 +1,15 @@ +import qbs.base 1.0 + +Project { + Product { + name: 'someapp' + type: 'application' + Depends { name: 'cpp' } + files: [ + "main.cpp", + "narf.h", "narf.cpp", + "zort.h", "zort.cpp" + ] + } +} + diff --git a/tests/auto/blackbox/testdata/trackAddFile/after/zort.cpp b/tests/auto/blackbox/testdata/trackAddFile/after/zort.cpp new file mode 100644 index 000000000..336ff5fda --- /dev/null +++ b/tests/auto/blackbox/testdata/trackAddFile/after/zort.cpp @@ -0,0 +1,44 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ +#include "zort.h" +#include <cstdio> + +void Zort::shout() +{ + printf("ZORT!\n"); +} + diff --git a/tests/auto/blackbox/testdata/trackAddFile/after/zort.h b/tests/auto/blackbox/testdata/trackAddFile/after/zort.h new file mode 100644 index 000000000..b94b70e27 --- /dev/null +++ b/tests/auto/blackbox/testdata/trackAddFile/after/zort.h @@ -0,0 +1,47 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ +#ifndef ZORT_H +#define ZORT_H + +class Zort +{ +public: + void shout(); +}; + +#endif + diff --git a/tests/auto/blackbox/testdata/trackAddFile/before/main.cpp b/tests/auto/blackbox/testdata/trackAddFile/before/main.cpp new file mode 100644 index 000000000..2fec2b365 --- /dev/null +++ b/tests/auto/blackbox/testdata/trackAddFile/before/main.cpp @@ -0,0 +1,47 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ +#include "narf.h" +#include <cstdio> + +int main(int argc, char **argv) +{ + printf("Hello World!\n"); + Narf narf; + narf.shout(); + return 0; +} + diff --git a/tests/auto/blackbox/testdata/trackAddFile/before/narf.cpp b/tests/auto/blackbox/testdata/trackAddFile/before/narf.cpp new file mode 100644 index 000000000..5c04c9d7c --- /dev/null +++ b/tests/auto/blackbox/testdata/trackAddFile/before/narf.cpp @@ -0,0 +1,44 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ +#include "narf.h" +#include <cstdio> + +void Narf::shout() +{ + printf("NARF!\n"); +} + diff --git a/tests/auto/blackbox/testdata/trackAddFile/before/narf.h b/tests/auto/blackbox/testdata/trackAddFile/before/narf.h new file mode 100644 index 000000000..afc73511f --- /dev/null +++ b/tests/auto/blackbox/testdata/trackAddFile/before/narf.h @@ -0,0 +1,47 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ +#ifndef NARF_H +#define NARF_H + +class Narf +{ +public: + void shout(); +}; + +#endif + diff --git a/tests/auto/blackbox/testdata/trackAddFile/before/project.qbp b/tests/auto/blackbox/testdata/trackAddFile/before/project.qbp new file mode 100644 index 000000000..222788b6a --- /dev/null +++ b/tests/auto/blackbox/testdata/trackAddFile/before/project.qbp @@ -0,0 +1,11 @@ +import qbs.base 1.0 + +Project { + Product { + name: 'someapp' + type: 'application' + Depends { name: 'cpp' } + files: [ "main.cpp", "narf.h", "narf.cpp" ] + } +} + diff --git a/tests/auto/blackbox/testdata/trackFileTags/after/main.cpp b/tests/auto/blackbox/testdata/trackFileTags/after/main.cpp new file mode 100644 index 000000000..fb5a86b9c --- /dev/null +++ b/tests/auto/blackbox/testdata/trackFileTags/after/main.cpp @@ -0,0 +1,46 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ +#include <cstdio> + +int foo(); + +int main(int argc, char **argv) +{ + printf("there's %d foo here\n", foo()); + return 0; +} + diff --git a/tests/auto/blackbox/testdata/trackFileTags/after/project.qbp b/tests/auto/blackbox/testdata/trackFileTags/after/project.qbp new file mode 100644 index 000000000..453658e98 --- /dev/null +++ b/tests/auto/blackbox/testdata/trackFileTags/after/project.qbp @@ -0,0 +1,51 @@ +import qbs.base 1.0 + +Project { + Product { + name: 'someapp' + type: 'application' + Depends { name: 'cpp' } + Group { + files: [ "main.cpp" ] + fileTags: [ "foosource", "cpp" ] + } + } + + Rule { + inputs: ["foosource"] + Artifact { + fileName: input.baseName + ".foo" + fileTags: ["foo"] + } + + prepare: { + var cmd = new JavaScriptCommand(); + cmd.sourceCode = "var file = new TextFile(output.fileName, TextFile.WriteOnly);"; + cmd.sourceCode += "file.truncate();" + cmd.sourceCode += "file.write(\"There's nothing to see here!\");" + cmd.sourceCode += "file.close();" + cmd.description = "generating something"; + return cmd; + } + } + + Rule { + inputs: ["foo"] + Artifact { + fileName: input.baseName + "_foo.cpp" + fileTags: ["cpp"] + } + + prepare: { + var cmd = new JavaScriptCommand(); + cmd.sourceCode = "var file = new TextFile(output.fileName, TextFile.WriteOnly);"; + cmd.sourceCode += "file.truncate();"; + cmd.sourceCode += "file.write(\"// There's nothing to see here!\\n\");"; + cmd.sourceCode += "file.write(\"int foo() { return 15; }\\n\");"; + cmd.sourceCode += "file.close();"; + cmd.description = "generating something"; + return cmd; + } + } +} + diff --git a/tests/auto/blackbox/testdata/trackFileTags/before/main.cpp b/tests/auto/blackbox/testdata/trackFileTags/before/main.cpp new file mode 100644 index 000000000..fe6c86168 --- /dev/null +++ b/tests/auto/blackbox/testdata/trackFileTags/before/main.cpp @@ -0,0 +1,44 @@ +/************************************************************************** +** +** This file is part of the Qt Build Suite +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (info@qt.nokia.com) +** +** +** GNU Lesser General Public License Usage +** +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. +** Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +**************************************************************************/ +#include <cstdio> + +int main(int argc, char **argv) +{ + printf("there's no foo here\n"); + return 0; +} + diff --git a/tests/auto/blackbox/testdata/trackFileTags/before/project.qbp b/tests/auto/blackbox/testdata/trackFileTags/before/project.qbp new file mode 100644 index 000000000..50400f157 --- /dev/null +++ b/tests/auto/blackbox/testdata/trackFileTags/before/project.qbp @@ -0,0 +1,51 @@ +import qbs.base 1.0 + +Project { + Product { + name: 'someapp' + type: 'application' + Depends { name: 'cpp' } + Group { + files: [ "main.cpp" ] + fileTags: [ "cpp" ] + } + } + + Rule { + inputs: ["foosource"] + Artifact { + fileName: input.baseName + ".foo" + fileTags: ["foo"] + } + + prepare: { + var cmd = new JavaScriptCommand(); + cmd.sourceCode = "var file = new TextFile(output.fileName, TextFile.WriteOnly);"; + cmd.sourceCode += "file.truncate();" + cmd.sourceCode += "file.write(\"There's nothing to see here!\");" + cmd.sourceCode += "file.close();" + cmd.description = "generating something"; + return cmd; + } + } + + Rule { + inputs: ["foo"] + Artifact { + fileName: input.baseName + "_foo.cpp" + fileTags: ["cpp"] + } + + prepare: { + var cmd = new JavaScriptCommand(); + cmd.sourceCode = "var file = new TextFile(output.fileName, TextFile.WriteOnly);"; + cmd.sourceCode += "file.truncate();"; + cmd.sourceCode += "file.write(\"// There's nothing to see here!\\n\");"; + cmd.sourceCode += "file.write(\"int foo() { return 15; }\\n\");"; + cmd.sourceCode += "file.close();"; + cmd.description = "generating something"; + return cmd; + } + } +} + |