aboutsummaryrefslogtreecommitdiff
path: root/manual tests
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-04-29 17:38:29 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2015-04-29 17:38:29 +0300
commit45d7b589ebfe4f87bad175d3c2e663423b6b3377 (patch)
tree94b2a0f722a04796b199fb62a2e2aab83dc11c13 /manual tests
parent8de41caac8364126c51452acae437ef4e9b30dcb (diff)
downloadmeson-45d7b589ebfe4f87bad175d3c2e663423b6b3377.zip
meson-45d7b589ebfe4f87bad175d3c2e663423b6b3377.tar.gz
meson-45d7b589ebfe4f87bad175d3c2e663423b6b3377.tar.bz2
Added module for Qt4 support.
Diffstat (limited to 'manual tests')
-rw-r--r--manual tests/6 qt4/main.cpp20
-rw-r--r--manual tests/6 qt4/mainWindow.cpp8
-rw-r--r--manual tests/6 qt4/mainWindow.h20
-rw-r--r--manual tests/6 qt4/mainWindow.ui34
-rw-r--r--manual tests/6 qt4/manualinclude.cpp20
-rw-r--r--manual tests/6 qt4/manualinclude.h16
-rw-r--r--manual tests/6 qt4/meson.build41
-rw-r--r--manual tests/6 qt4/q4core.cpp10
-rw-r--r--manual tests/6 qt4/stuff.qrc7
-rw-r--r--manual tests/6 qt4/thing.pngbin0 -> 40303 bytes
-rw-r--r--manual tests/6 qt4/thing2.pngbin0 -> 40303 bytes
11 files changed, 176 insertions, 0 deletions
diff --git a/manual tests/6 qt4/main.cpp b/manual tests/6 qt4/main.cpp
new file mode 100644
index 0000000..4c257a4
--- /dev/null
+++ b/manual tests/6 qt4/main.cpp
@@ -0,0 +1,20 @@
+#include <QApplication>
+#include "mainWindow.h"
+
+int main(int argc, char **argv) {
+ QApplication app(argc, argv);
+ MainWindow *win = new MainWindow();
+ QImage qi(":/thing.png");
+ if(qi.width() != 640) {
+ return 1;
+ }
+ QImage qi2(":/thing2.png");
+ if(qi2.width() != 640) {
+ return 1;
+ }
+ win->setWindowTitle("Meson Qt5 build test");
+
+ win->show();
+ return app.exec();
+ return 0;
+}
diff --git a/manual tests/6 qt4/mainWindow.cpp b/manual tests/6 qt4/mainWindow.cpp
new file mode 100644
index 0000000..cc82c4f
--- /dev/null
+++ b/manual tests/6 qt4/mainWindow.cpp
@@ -0,0 +1,8 @@
+#include "mainWindow.h"
+
+MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
+ setupUi(this);
+}
+
+MainWindow::~MainWindow() {
+}
diff --git a/manual tests/6 qt4/mainWindow.h b/manual tests/6 qt4/mainWindow.h
new file mode 100644
index 0000000..7f6d906
--- /dev/null
+++ b/manual tests/6 qt4/mainWindow.h
@@ -0,0 +1,20 @@
+#ifndef MES_MAINWINDOW
+#define MES_MAINWINDOW
+
+#include <QObject>
+#include <QMainWindow>
+#include "ui_mainWindow.h"
+
+class NotificationModel;
+
+class MainWindow : public QMainWindow, private Ui_MainWindow {
+ Q_OBJECT
+
+public:
+ explicit MainWindow(QWidget *parent=0);
+ ~MainWindow();
+
+private:
+};
+
+#endif
diff --git a/manual tests/6 qt4/mainWindow.ui b/manual tests/6 qt4/mainWindow.ui
new file mode 100644
index 0000000..2eb226a
--- /dev/null
+++ b/manual tests/6 qt4/mainWindow.ui
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>270</width>
+ <height>115</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <widget class="QPushButton" name="pushButton">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>241</width>
+ <height>91</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>I am a button</string>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/manual tests/6 qt4/manualinclude.cpp b/manual tests/6 qt4/manualinclude.cpp
new file mode 100644
index 0000000..0602882
--- /dev/null
+++ b/manual tests/6 qt4/manualinclude.cpp
@@ -0,0 +1,20 @@
+#include"manualinclude.h"
+#include<QCoreApplication>
+
+#include<QObject>
+
+ManualInclude::ManualInclude() {
+}
+
+class MocClass : public QObject {
+ Q_OBJECT
+};
+
+int main(int argc, char **argv) {
+ ManualInclude mi;
+ MocClass mc;
+ return 0;
+}
+
+#include"manualinclude.moc"
+
diff --git a/manual tests/6 qt4/manualinclude.h b/manual tests/6 qt4/manualinclude.h
new file mode 100644
index 0000000..4a00b6c
--- /dev/null
+++ b/manual tests/6 qt4/manualinclude.h
@@ -0,0 +1,16 @@
+#ifndef MANUALINCLUDE_H_
+#define MANUALINCLUDE_H_
+
+#include<QObject>
+
+class ManualInclude : public QObject {
+ Q_OBJECT
+
+public:
+ ManualInclude();
+
+signals:
+ int mysignal();
+};
+
+#endif
diff --git a/manual tests/6 qt4/meson.build b/manual tests/6 qt4/meson.build
new file mode 100644
index 0000000..b9694d9
--- /dev/null
+++ b/manual tests/6 qt4/meson.build
@@ -0,0 +1,41 @@
+project('qt5 build test', 'cpp')
+
+# This is a manual test rather than an automatic one
+# because during Debian package builds only Qt4 or Qt5
+# can be active.
+
+qt4 = import('qt4')
+qt4dep = dependency('qt4', modules : 'Gui')
+
+prep = qt4.preprocess(moc_headers : ['mainWindow.h'], # These need to be fed through the moc tool before use.
+ ui_files : 'mainWindow.ui', # XML files that need to be compiled with the uic tol.
+ qresources : 'stuff.qrc', # Resource file for rcc compiler.
+)
+
+q5exe = executable('qt4app',
+sources : ['main.cpp', 'mainWindow.cpp', # Sources that don't need preprocessing.
+prep],
+dependencies : qt4dep)
+
+# We need a console test application because some test environments
+# do not have an X server.
+
+qt4core = dependency('qt4', modules : 'Core')
+
+qt4coreapp = executable('q4core', 'q4core.cpp',
+dependencies : qt4core)
+
+test('qt4test', qt4coreapp)
+
+# The build system needs to include the cpp files from
+# headers but the user must manually include moc
+# files from sources.
+manpreprocessed = qt4.preprocess(
+ moc_sources : 'manualinclude.cpp',
+ moc_headers : 'manualinclude.h')
+
+q4maninclude = executable('q4maninclude',
+sources : ['manualinclude.cpp', manpreprocessed],
+dependencies : qt4core)
+
+test('q4maninclude', q4maninclude)
diff --git a/manual tests/6 qt4/q4core.cpp b/manual tests/6 qt4/q4core.cpp
new file mode 100644
index 0000000..706e4dc
--- /dev/null
+++ b/manual tests/6 qt4/q4core.cpp
@@ -0,0 +1,10 @@
+#include <QCoreApplication>
+
+int main(int argc, char **argv) {
+ QCoreApplication app(argc, argv);
+
+ // Don't actually start the main loop so this
+ // can be run as a unit test.
+ //return app.exec();
+ return 0;
+}
diff --git a/manual tests/6 qt4/stuff.qrc b/manual tests/6 qt4/stuff.qrc
new file mode 100644
index 0000000..9152500
--- /dev/null
+++ b/manual tests/6 qt4/stuff.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC>
+<RCC version="1.0">
+ <qresource>
+ <file>thing.png</file>
+ <file>thing2.png</file>
+ </qresource>
+</RCC>
diff --git a/manual tests/6 qt4/thing.png b/manual tests/6 qt4/thing.png
new file mode 100644
index 0000000..4b001bd
--- /dev/null
+++ b/manual tests/6 qt4/thing.png
Binary files differ
diff --git a/manual tests/6 qt4/thing2.png b/manual tests/6 qt4/thing2.png
new file mode 100644
index 0000000..4b001bd
--- /dev/null
+++ b/manual tests/6 qt4/thing2.png
Binary files differ