From d6efc0aab30c5dc927aa8a0c743ab0c3775321a4 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 9 Dec 2015 10:27:58 +0100 Subject: qmake: teach findMocs to handle backslash-newline gracefully. Change-Id: Id71352c0cf71ab84bd81d4f3d11bb19dc7965903 Reviewed-by: Oswald Buddenhagen --- .../tools/qmake/testdata/findMocs/findMocs.pro | 3 +- tests/auto/tools/qmake/testdata/findMocs/main.cpp | 5 ++- tests/auto/tools/qmake/testdata/findMocs/object1.h | 4 +- tests/auto/tools/qmake/testdata/findMocs/object2.h | 4 +- tests/auto/tools/qmake/testdata/findMocs/object3.h | 4 +- tests/auto/tools/qmake/testdata/findMocs/object4.h | 3 +- tests/auto/tools/qmake/testdata/findMocs/object8.h | 50 ++++++++++++++++++++++ tests/auto/tools/qmake/testdata/findMocs/object9.h | 41 ++++++++++++++++++ 8 files changed, 103 insertions(+), 11 deletions(-) create mode 100644 tests/auto/tools/qmake/testdata/findMocs/object8.h create mode 100644 tests/auto/tools/qmake/testdata/findMocs/object9.h (limited to 'tests') diff --git a/tests/auto/tools/qmake/testdata/findMocs/findMocs.pro b/tests/auto/tools/qmake/testdata/findMocs/findMocs.pro index a4a7dc987d..af672c2621 100644 --- a/tests/auto/tools/qmake/testdata/findMocs/findMocs.pro +++ b/tests/auto/tools/qmake/testdata/findMocs/findMocs.pro @@ -1,4 +1,5 @@ DESTDIR = ./ -HEADERS += object1.h object2.h object3.h object4.h object5.h object6.h object7.h +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/tools/qmake/testdata/findMocs/main.cpp b/tests/auto/tools/qmake/testdata/findMocs/main.cpp index 8e0ef9fc41..3f566c4af4 100644 --- a/tests/auto/tools/qmake/testdata/findMocs/main.cpp +++ b/tests/auto/tools/qmake/testdata/findMocs/main.cpp @@ -39,6 +39,7 @@ #include #include #include +#include "object8.h" +#include -int main () {} - +int main() { return 0; } diff --git a/tests/auto/tools/qmake/testdata/findMocs/object1.h b/tests/auto/tools/qmake/testdata/findMocs/object1.h index e0857f4297..1fcac5f511 100644 --- a/tests/auto/tools/qmake/testdata/findMocs/object1.h +++ b/tests/auto/tools/qmake/testdata/findMocs/object1.h @@ -37,6 +37,6 @@ class Object1 : public QObject { - Q_OBJECT + Q\ +_OBJECT }; - diff --git a/tests/auto/tools/qmake/testdata/findMocs/object2.h b/tests/auto/tools/qmake/testdata/findMocs/object2.h index cc60269cd3..a52489b44c 100644 --- a/tests/auto/tools/qmake/testdata/findMocs/object2.h +++ b/tests/auto/tools/qmake/testdata/findMocs/object2.h @@ -36,6 +36,6 @@ class Object2 : public QObject { - Q_OBJECT + Q_\ +OBJECT }; - diff --git a/tests/auto/tools/qmake/testdata/findMocs/object3.h b/tests/auto/tools/qmake/testdata/findMocs/object3.h index c66edee6e1..c481a0796d 100644 --- a/tests/auto/tools/qmake/testdata/findMocs/object3.h +++ b/tests/auto/tools/qmake/testdata/findMocs/object3.h @@ -37,6 +37,6 @@ class Object3 : public QObject { - Q_OBJECT + Q_OBJ\ +ECT }; - diff --git a/tests/auto/tools/qmake/testdata/findMocs/object4.h b/tests/auto/tools/qmake/testdata/findMocs/object4.h index 73bf9cdaa3..eb38652f14 100644 --- a/tests/auto/tools/qmake/testdata/findMocs/object4.h +++ b/tests/auto/tools/qmake/testdata/findMocs/object4.h @@ -44,10 +44,9 @@ class Object4 : public QObject Comment ends there --> /*/ // Now we poison moc, just to make sure this doesn't get moc'ed :) -class NonMocObject +class NonMocObject4 /* : QObject */ { /* qmake ignore Q_OBJECT */ Q_OBJECT }; - diff --git a/tests/auto/tools/qmake/testdata/findMocs/object8.h b/tests/auto/tools/qmake/testdata/findMocs/object8.h new file mode 100644 index 0000000000..51096e4c27 --- /dev/null +++ b/tests/auto/tools/qmake/testdata/findMocs/object8.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include +#define Q_OBJECTOID_THING // empty + +class Object8 : public QObject +{ + Q_OBJECT\ +OID_THING +}; + +// Now we poison moc, just to make sure this doesn't get moc'ed :) +class NonMocObject8 +/* : QObject */ +{ + /* qmake ignore Q_OBJECT */ + Q_OBJECT +}; diff --git a/tests/auto/tools/qmake/testdata/findMocs/object9.h b/tests/auto/tools/qmake/testdata/findMocs/object9.h new file mode 100644 index 0000000000..bda50355d9 --- /dev/null +++ b/tests/auto/tools/qmake/testdata/findMocs/object9.h @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include +#define juxtaposed "lorem ""ipsum /*" + +class Object9 : public QObject +{ + Q_OBJECT +}; -- cgit v1.2.3