summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2011-12-05 02:46:22 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-06 20:14:10 +0100
commite838cf644fe482d0ff04f2a32f081bc4b6e30297 (patch)
treef0c14ef4a12f06c1bc7c421e05b2f4c8d3be0799 /tests
parentb6e9ff22a376ae94b884a22c85f89f4c37056e5e (diff)
Test that options to macros work.
Change-Id: Id2f57cc2f64ae25f5f84d1206035b7a2c309d1c7 Reviewed-by: Clinton Stimpson <clinton@elemtech.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/cmake/CMakeLists.txt2
-rw-r--r--tests/manual/cmake/fail4/CMakeLists.txt18
-rw-r--r--tests/manual/cmake/fail4/myobject.cpp54
-rw-r--r--tests/manual/cmake/fail4/myobject.h57
-rw-r--r--tests/manual/cmake/fail4/pass4.qrc6
-rw-r--r--tests/manual/cmake/fail4/resource_file.txt1
-rw-r--r--tests/manual/cmake/fail5/CMakeLists.txt15
-rw-r--r--tests/manual/cmake/fail5/myobject.cpp54
-rw-r--r--tests/manual/cmake/fail5/myobject.h57
9 files changed, 264 insertions, 0 deletions
diff --git a/tests/manual/cmake/CMakeLists.txt b/tests/manual/cmake/CMakeLists.txt
index b6d5f318fd..1f2bd3e80a 100644
--- a/tests/manual/cmake/CMakeLists.txt
+++ b/tests/manual/cmake/CMakeLists.txt
@@ -29,3 +29,5 @@ endmacro()
# expect_pass(pass1)
expect_pass(pass2)
expect_pass(pass3)
+expect_fail(fail4)
+expect_fail(fail5)
diff --git a/tests/manual/cmake/fail4/CMakeLists.txt b/tests/manual/cmake/fail4/CMakeLists.txt
new file mode 100644
index 0000000000..dcd4b8bd65
--- /dev/null
+++ b/tests/manual/cmake/fail4/CMakeLists.txt
@@ -0,0 +1,18 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(pass4)
+
+find_package(Qt5Core REQUIRED)
+
+include_directories(${Qt5Core_INCLUDE_DIRS})
+
+qt5_wrap_cpp(moc_files myobject.h)
+
+# Test options. The -binary option generates a binary to dlopen instead of
+# a source file to compile. The compiler will consider it garbage when used
+# in the add_executable call.
+qt5_add_resources(rcc_files "pass4.qrc" OPTIONS -binary)
+
+add_executable(myobject myobject.cpp ${moc_files} ${rcc_files})
+target_link_libraries(myobject ${Qt5Core_LIBRARIES})
diff --git a/tests/manual/cmake/fail4/myobject.cpp b/tests/manual/cmake/fail4/myobject.cpp
new file mode 100644
index 0000000000..251239cde0
--- /dev/null
+++ b/tests/manual/cmake/fail4/myobject.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+** 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$
+** 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.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "myobject.h"
+
+MyObject::MyObject(QObject *parent)
+ : QObject(parent)
+{
+ emit someSignal();
+}
+
+int main(int argc, char **argv)
+{
+ MyObject myObject;
+ return 0;
+}
diff --git a/tests/manual/cmake/fail4/myobject.h b/tests/manual/cmake/fail4/myobject.h
new file mode 100644
index 0000000000..e2e908d32c
--- /dev/null
+++ b/tests/manual/cmake/fail4/myobject.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+** 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$
+** 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.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MYOBJECT_H
+#define MYOBJECT_H
+
+#include <QObject>
+
+class MyObject : public QObject
+{
+ Q_OBJECT
+public:
+ MyObject(QObject *parent = 0);
+
+signals:
+ void someSignal();
+};
+
+#endif
diff --git a/tests/manual/cmake/fail4/pass4.qrc b/tests/manual/cmake/fail4/pass4.qrc
new file mode 100644
index 0000000000..00a17f541f
--- /dev/null
+++ b/tests/manual/cmake/fail4/pass4.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file>resource_file.txt</file>
+</qresource>
+</RCC>
+
diff --git a/tests/manual/cmake/fail4/resource_file.txt b/tests/manual/cmake/fail4/resource_file.txt
new file mode 100644
index 0000000000..2c604a4f18
--- /dev/null
+++ b/tests/manual/cmake/fail4/resource_file.txt
@@ -0,0 +1 @@
+Ken sent me.
diff --git a/tests/manual/cmake/fail5/CMakeLists.txt b/tests/manual/cmake/fail5/CMakeLists.txt
new file mode 100644
index 0000000000..f82a62b626
--- /dev/null
+++ b/tests/manual/cmake/fail5/CMakeLists.txt
@@ -0,0 +1,15 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(pass5)
+
+find_package(Qt5Core REQUIRED)
+
+include_directories(${Qt5Core_INCLUDE_DIRS})
+
+# Test options. The -i option removes the include "myobject.h" from the moc file
+# causing a compile failure. -> Options work
+qt5_wrap_cpp(moc_files myobject.h OPTIONS -i)
+
+add_executable(myobject myobject.cpp ${moc_files})
+target_link_libraries(myobject ${Qt5Core_LIBRARIES})
diff --git a/tests/manual/cmake/fail5/myobject.cpp b/tests/manual/cmake/fail5/myobject.cpp
new file mode 100644
index 0000000000..251239cde0
--- /dev/null
+++ b/tests/manual/cmake/fail5/myobject.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+** 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$
+** 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.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "myobject.h"
+
+MyObject::MyObject(QObject *parent)
+ : QObject(parent)
+{
+ emit someSignal();
+}
+
+int main(int argc, char **argv)
+{
+ MyObject myObject;
+ return 0;
+}
diff --git a/tests/manual/cmake/fail5/myobject.h b/tests/manual/cmake/fail5/myobject.h
new file mode 100644
index 0000000000..e2e908d32c
--- /dev/null
+++ b/tests/manual/cmake/fail5/myobject.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+** 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$
+** 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.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MYOBJECT_H
+#define MYOBJECT_H
+
+#include <QObject>
+
+class MyObject : public QObject
+{
+ Q_OBJECT
+public:
+ MyObject(QObject *parent = 0);
+
+signals:
+ void someSignal();
+};
+
+#endif