Use a console app for Qt5 unit testing so it can be run headless.

pull/15/head
Jussi Pakkanen 11 years ago
parent 3993039933
commit c61da0049c
  1. 6
      test cases/frameworks/4 qt5/main.cpp
  2. 10
      test cases/frameworks/4 qt5/meson.build
  3. 10
      test cases/frameworks/4 qt5/q5core.cpp

@ -10,9 +10,7 @@ int main(int argc, char **argv) {
}
win->setWindowTitle("Meson Qt5 build test");
// Don't actually start the GUI so this
// can be run as a unit test.
//win->show();
//return app.exec();
win->show();
return app.exec();
return 0;
}

@ -2,11 +2,17 @@ project('qt5 build test', 'cpp')
qt5dep = dependency('qt5', modules : 'Widgets')
q5exe = executable('qt5test',
q5exe = executable('qt5app',
sources : ['main.cpp', 'mainWindow.cpp'], # Sources that don't need preprocessing.
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.
resources : 'stuff.qrc', # Resource file for rcc compiler.
deps : qt5dep)
test('qt5test', q5exe)
# We need a console test application because some test environments
# do not have an X server.
q5core = executable('q5core', 'q5core.cpp',
deps : dependency('qt5', modules : 'Core'))
test('qt5test', q5core)

@ -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;
}
Loading…
Cancel
Save