Running unit tests that use QWidgets no longer works over ssh on osx in QT5
-
We have a bunch of unit tests written using QTestLib. Some tests use classes like QAction and QMenu, but never draw anything to the screen. Those classes require us to instatiate a QApplication instead of a QCoreApplication in the test runner. The tests are run on a build server over an SSH connection.
Here is what happens:
QT4 (4.8.4):
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
(tests run fine regardless of above warning)QT5 (5.2.1):
PasteBoard: Error creating pasteboard: com.apple.pasteboard.clipboard [-4960]
PasteBoard: Error creating pasteboard: com.apple.pasteboard.find [-4960]
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
Bus error 10.
(runner aborts)To reproduce the above, all you need to do is create a hello world that instantiates a QApplication. It will abort on QT5 and work on QT4.
So, I gather that something has changed related to clipboard in the initialization of QApplication between QT4 and QT5 on OSX.
Is there a workaround? Or any idea how to make running these tests on a headless OSX machine work?
Thanks in advance.
-
Hi,
Indeed several things have changed between 4 and 5.
You should post this question on the interest mailing list, you'll find there Qt's developers/maintainers (this forum is more user oriented)
-
Thanks. I'll post on the interest list.