danvratil / qcoro

C++ Coroutines for Qt
https://qcoro.dvratil.cz
MIT License
331 stars 53 forks source link

test-qcoroimageprovider requires Qt private API #139

Closed xvitaly closed 1 year ago

xvitaly commented 1 year ago

OS: Fedora Linux 37 qcoro version: 0.7.0 Compiler version: GCC 12.2.1 Qt 5 version: 5.15.7 Qt 6 version: 6.4.0

Log:

[105/176] /usr/bin/g++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_KEYWORDS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_URL_CAST_FROM_STRING -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_QUICK_LIB -DQT_STRICT_ITERATORS -DQT_TESTCASE_BUILDDIR=\"/builddir/build/BUILD/qcoro-0.7.0/release-qt5/redhat-linux-build\" -DQT_TESTLIB_LIB -DQT_USE_STRINGBUILDER -I/builddir/build/BUILD/qcoro-0.7.0/release-qt5/redhat-linux-build/tests/test-qcoroimageprovider_autogen/include -I/builddir/build/BUILD/qcoro-0.7.0/tests/testlibs -I/builddir/build/BUILD/qcoro-0.7.0 -I/builddir/build/BUILD/qcoro-0.7.0/qcoro -I/builddir/build/BUILD/qcoro-0.7.0/qcoro/core -I/builddir/build/BUILD/qcoro-0.7.0/release-qt5/redhat-linux-build/qcoro/core -I/builddir/build/BUILD/qcoro-0.7.0/release-qt5/redhat-linux-build/qcoro -I/builddir/build/BUILD/qcoro-0.7.0/qcoro/quick -I/builddir/build/BUILD/qcoro-0.7.0/release-qt5/redhat-linux-build/qcoro/quick -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtTest -isystem /usr/include/qt5/QtQuick -isystem /usr/include/qt5/QtQmlModels -isystem /usr/include/qt5/QtQml -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtQuick/5.15.7 -isystem /usr/include/qt5/QtQuick/5.15.7/QtQuick -isystem /usr/include/qt5/QtQmlModels/5.15.7 -isystem /usr/include/qt5/QtQmlModels/5.15.7/QtQmlModels -isystem /usr/include/qt5/QtQml/5.15.7 -isystem /usr/include/qt5/QtQml/5.15.7/QtQml -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fcoroutines -DNDEBUG -fPIC -std=gnu++20 -MD -MT tests/CMakeFiles/test-qcoroimageprovider.dir/qcoroimageprovider.cpp.o -MF tests/CMakeFiles/test-qcoroimageprovider.dir/qcoroimageprovider.cpp.o.d -o tests/CMakeFiles/test-qcoroimageprovider.dir/qcoroimageprovider.cpp.o -c /builddir/build/BUILD/qcoro-0.7.0/tests/qcoroimageprovider.cpp
FAILED: tests/CMakeFiles/test-qcoroimageprovider.dir/qcoroimageprovider.cpp.o 
/usr/bin/g++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_KEYWORDS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_URL_CAST_FROM_STRING -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_QUICK_LIB -DQT_STRICT_ITERATORS -DQT_TESTCASE_BUILDDIR=\"/builddir/build/BUILD/qcoro-0.7.0/release-qt5/redhat-linux-build\" -DQT_TESTLIB_LIB -DQT_USE_STRINGBUILDER -I/builddir/build/BUILD/qcoro-0.7.0/release-qt5/redhat-linux-build/tests/test-qcoroimageprovider_autogen/include -I/builddir/build/BUILD/qcoro-0.7.0/tests/testlibs -I/builddir/build/BUILD/qcoro-0.7.0 -I/builddir/build/BUILD/qcoro-0.7.0/qcoro -I/builddir/build/BUILD/qcoro-0.7.0/qcoro/core -I/builddir/build/BUILD/qcoro-0.7.0/release-qt5/redhat-linux-build/qcoro/core -I/builddir/build/BUILD/qcoro-0.7.0/release-qt5/redhat-linux-build/qcoro -I/builddir/build/BUILD/qcoro-0.7.0/qcoro/quick -I/builddir/build/BUILD/qcoro-0.7.0/release-qt5/redhat-linux-build/qcoro/quick -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtTest -isystem /usr/include/qt5/QtQuick -isystem /usr/include/qt5/QtQmlModels -isystem /usr/include/qt5/QtQml -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtQuick/5.15.7 -isystem /usr/include/qt5/QtQuick/5.15.7/QtQuick -isystem /usr/include/qt5/QtQmlModels/5.15.7 -isystem /usr/include/qt5/QtQmlModels/5.15.7/QtQmlModels -isystem /usr/include/qt5/QtQml/5.15.7 -isystem /usr/include/qt5/QtQml/5.15.7/QtQml -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fcoroutines -DNDEBUG -fPIC -std=gnu++20 -MD -MT tests/CMakeFiles/test-qcoroimageprovider.dir/qcoroimageprovider.cpp.o -MF tests/CMakeFiles/test-qcoroimageprovider.dir/qcoroimageprovider.cpp.o.d -o tests/CMakeFiles/test-qcoroimageprovider.dir/qcoroimageprovider.cpp.o -c /builddir/build/BUILD/qcoro-0.7.0/tests/qcoroimageprovider.cpp
In file included from /usr/include/qt5/QtQuick/5.15.7/QtQuick/private/qtquickglobal_p.h:43,
                 from /usr/include/qt5/QtQuick/5.15.7/QtQuick/private/qquickimplicitsizeitem_p.h:55,
                 from /usr/include/qt5/QtQuick/5.15.7/QtQuick/private/qquickimagebase_p.h:54,
                 from /usr/include/qt5/QtQuick/5.15.7/QtQuick/private/qquickimage_p.h:54,
                 from /builddir/build/BUILD/qcoro-0.7.0/tests/qcoroimageprovider.cpp:14:
/usr/include/qt5/QtQml/5.15.7/QtQml/private/qtqmlglobal_p.h:54:10: fatal error: QtCore/private/qglobal_p.h: No such file or directory
   54 | #include <QtCore/private/qglobal_p.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
xvitaly commented 1 year ago

Also this test is broken:

Test project /builddir/build/BUILD/qcoro-0.7.0/release-qt5/redhat-linux-build
      Start  1: test-qtimer
      Start  2: test-qcoroprocess
      Start  3: test-qcorosignal
      Start  4: test-qcorothread
      Start  5: test-qcorotask
      Start  6: test-testconstraints
      Start  7: test-qfuture
      Start  8: test-qcorogenerator
      Start  9: test-qcoroasyncgenerator
      Start 10: test-qdbuspendingcall
      Start 11: test-qdbuspendingreply
      Start 12: test-qcorolocalsocket
      Start 13: test-qcoroabstractsocket
      Start 14: test-qcoronetworkreply
      Start 15: test-qcorotcpserver
      Start 16: test-testhttpserver
      Start 17: test-qcorowebsocket
      Start 18: test-qcorowebsocketserver
      Start 19: test-qcoroqmltask
      Start 20: test-qcoroimageprovider
 1/20 Test  #6: test-testconstraints .............   Passed    0.01 sec
 2/20 Test  #8: test-qcorogenerator ..............   Passed    0.01 sec
 3/20 Test #20: test-qcoroimageprovider ..........Subprocess aborted***Exception:   0.11 sec
 4/20 Test  #4: test-qcorothread .................   Passed    0.22 sec
 5/20 Test #18: test-qcorowebsocketserver ........   Passed    0.26 sec
 6/20 Test #17: test-qcorowebsocket ..............   Passed    0.38 sec
 7/20 Test  #9: test-qcoroasyncgenerator .........   Passed    0.70 sec
 8/20 Test  #5: test-qcorotask ...................   Passed    0.71 sec
 9/20 Test  #1: test-qtimer ......................   Passed    0.75 sec
10/20 Test #19: test-qcoroqmltask ................   Passed    0.99 sec
11/20 Test #10: test-qdbuspendingcall ............   Passed    1.13 sec
12/20 Test  #7: test-qfuture .....................   Passed    1.41 sec
13/20 Test  #3: test-qcorosignal .................   Passed    1.44 sec
14/20 Test #15: test-qcorotcpserver ..............   Passed    1.51 sec
15/20 Test #16: test-testhttpserver ..............   Passed    1.52 sec
16/20 Test #11: test-qdbuspendingreply ...........   Passed    4.13 sec
17/20 Test #14: test-qcoronetworkreply ...........   Passed    6.03 sec
18/20 Test  #2: test-qcoroprocess ................   Passed    7.02 sec
19/20 Test #12: test-qcorolocalsocket ............   Passed    8.59 sec
20/20 Test #13: test-qcoroabstractsocket .........   Passed    9.09 sec
95% tests passed, 1 tests failed out of 20
Total Test time (real) =   9.10 sec
The following tests FAILED:
     20 - test-qcoroimageprovider (Subprocess aborted)
Errors while running CTest
error: Bad exit status from /var/tmp/rpm-tmp.VG6iDg (%check)
danvratil commented 1 year ago

There's no other way to test the image provider. But it's just tests which you execute during packaging, so there's no risk you'd be running against a mis-matching version of Qt. But yes, I would also be happier if I wouldn't have to use it...

I think I just need to fix the find_package in CMake to make it explicit that we require private API.

I'll look into the crash asap - taht shouldn't happen regardless.

danvratil commented 1 year ago

I suspect the reason for the failing test is missing X11:

[root@eb98d3ba9ec6 build]# ctest --output-on-failure .
Test project /qcoro/build
      Start  1: test-qtimer
 1/20 Test  #1: test-qtimer ......................   Passed    0.70 sec
      Start  2: test-qcoroprocess
 2/20 Test  #2: test-qcoroprocess ................   Passed    7.02 sec
      Start  3: test-qcorosignal
 3/20 Test  #3: test-qcorosignal .................   Passed    1.44 sec
      Start  4: test-qcorothread
 4/20 Test  #4: test-qcorothread .................   Passed    0.22 sec
      Start  5: test-qcorotask
 5/20 Test  #5: test-qcorotask ...................   Passed    0.71 sec
      Start  6: test-testconstraints
 6/20 Test  #6: test-testconstraints .............   Passed    0.00 sec
      Start  7: test-qfuture
 7/20 Test  #7: test-qfuture .....................   Passed    1.41 sec
      Start  8: test-qcorogenerator
 8/20 Test  #8: test-qcorogenerator ..............   Passed    0.00 sec
      Start  9: test-qcoroasyncgenerator
 9/20 Test  #9: test-qcoroasyncgenerator .........   Passed    0.68 sec
      Start 10: test-qdbuspendingcall
10/20 Test #10: test-qdbuspendingcall ............   Passed    1.12 sec
      Start 11: test-qdbuspendingreply
11/20 Test #11: test-qdbuspendingreply ...........   Passed    4.12 sec
      Start 12: test-qcorolocalsocket
12/20 Test #12: test-qcorolocalsocket ............   Passed    8.59 sec
      Start 13: test-qcoroabstractsocket
13/20 Test #13: test-qcoroabstractsocket .........   Passed    9.09 sec
      Start 14: test-qcoronetworkreply
14/20 Test #14: test-qcoronetworkreply ...........   Passed    6.03 sec
      Start 15: test-qcorotcpserver
15/20 Test #15: test-qcorotcpserver ..............   Passed    1.51 sec
      Start 16: test-testhttpserver
16/20 Test #16: test-testhttpserver ..............   Passed    1.52 sec
      Start 17: test-qcorowebsocket
17/20 Test #17: test-qcorowebsocket ..............   Passed    0.25 sec
      Start 18: test-qcorowebsocketserver
18/20 Test #18: test-qcorowebsocketserver ........   Passed    0.26 sec
      Start 19: test-qcoroqmltask
19/20 Test #19: test-qcoroqmltask ................   Passed    0.97 sec
      Start 20: test-qcoroimageprovider
20/20 Test #20: test-qcoroimageprovider ..........Subprocess aborted***Exception:   0.13 sec
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

95% tests passed, 1 tests failed out of 20

Total Test time (real) =  45.78 sec

The following tests FAILED:
         20 - test-qcoroimageprovider (Subprocess aborted)
Errors while running CTest

The solution I'm using in the CI is to set QT_QPA_PLATFORM=offscreen - I think you can quickly do that in your spec file for now, and I'll adjust the test to always use the offscreen QPA automatically in the future.

danvratil commented 1 year ago

The test has been fixed and #142 explicitly added Private modules to find_package in CMake, so that it fails at configure time if they are not present, rather than build time.

I'm closing this issue as I think everything has been addressed - the usage of private API itself cannot be resolved right now since otherwise it's not possible to properly test the feature, unfortunately.