summaryrefslogtreecommitdiff
path: root/dev-qt
diff options
context:
space:
mode:
authorIonen Wolkens <ionen@gentoo.org>2023-08-21 16:26:26 -0400
committerIonen Wolkens <ionen@gentoo.org>2023-09-05 09:01:04 -0400
commit0321009080c997eafebca8f4bee32973fe881e16 (patch)
treed8a2eb9721219e0e1662c72f687fd56b1b1a63ed /dev-qt
parentdev-qt/qtbase: fix build with USE=oci8 (diff)
downloadgentoo-0321009080c997eafebca8f4bee32973fe881e16.tar.gz
gentoo-0321009080c997eafebca8f4bee32973fe881e16.tar.bz2
gentoo-0321009080c997eafebca8f4bee32973fe881e16.zip
dev-qt/qtbase: various adjustments to run tests
* fix building tests with gcc-13 (backport) * set both TZ and LC_TIME needed by a few tests (p.m. vs pm) * skip a few tests with extra needs for simplicity * skip flaky tests depending on environment/compiler that do not appear to be real issues (e.g. checks mounted filesystems) * skip a few tests failing on x86 chroot that do not "seem" to have consequences, needs more looking into but ultimately want more of a baseline rather than pursue everything right now * skip building a test with -Werror=strict-aliasing issues, not important but saves tinderbox noise (ideally should fix, but well) * skip tests broken without qtbase already being installed (these also have issues with out-of-source build, but given they are broken either way no reason to use IN_SOURCE=1) * delete bunch of test binaries and files being installed when tests are enabled (unfortunately not aware of a better way, upstream may be installing first and using standalone tests or so) * set required use, could alternatively skip a few tests based on USE but this would get further troublesome to maintain * do not try to use docker-compose if found Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'dev-qt')
-rw-r--r--dev-qt/qtbase/files/qtbase-6.5.2-tests-gcc13.patch25
-rw-r--r--dev-qt/qtbase/qtbase-6.5.2.ebuild73
-rw-r--r--dev-qt/qtbase/qtbase-6.5.9999.ebuild72
-rw-r--r--dev-qt/qtbase/qtbase-6.9999.ebuild72
4 files changed, 242 insertions, 0 deletions
diff --git a/dev-qt/qtbase/files/qtbase-6.5.2-tests-gcc13.patch b/dev-qt/qtbase/files/qtbase-6.5.2-tests-gcc13.patch
new file mode 100644
index 000000000000..431d89a387f6
--- /dev/null
+++ b/dev-qt/qtbase/files/qtbase-6.5.2-tests-gcc13.patch
@@ -0,0 +1,25 @@
+https://bugreports.qt.io/browse/QTBUG-114785
+https://code.qt.io/cgit/qt/qtbase.git/commit/?id=3e801b5477a7abfe4b87f20639e345bf3dc7eca8
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sat, 29 Apr 2023 13:01:56 +0200
+Subject: [PATCH] tinycbor: fix build with gcc-13
+
+Fixes: QTBUG-114785
+Pick-to: 6.6 6.5
+Change-Id: I4876ebd8890eee883a0d1a2bef8cb7aec4fd0f2f
+Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
+--- a/src/3rdparty/tinycbor/tests/encoder/data.cpp
++++ b/src/3rdparty/tinycbor/tests/encoder/data.cpp
+@@ -239,9 +239,9 @@
+ QTest::newRow("0.f16") << raw("\xf9\0\0") << QVariant::fromValue(qfloat16(0));
+ QTest::newRow("-1.f16") << raw("\xf9\xbc\0") << QVariant::fromValue(qfloat16(-1));
+ QTest::newRow("1.5f16") << raw("\xf9\x3e\0") << QVariant::fromValue(qfloat16(1.5));
+- QTest::newRow("nan_f16") << raw("\xf9\x7e\0") << QVariant::fromValue<qfloat16>(myNaNf());
+- QTest::newRow("-inf_f16") << raw("\xf9\xfc\0") << QVariant::fromValue<qfloat16>(myNInff());
+- QTest::newRow("+inf_f16") << raw("\xf9\x7c\0") << QVariant::fromValue<qfloat16>(myInff());
++ QTest::newRow("nan_f16") << raw("\xf9\x7e\0") << QVariant::fromValue<qfloat16>(qfloat16(myNaNf()));
++ QTest::newRow("-inf_f16") << raw("\xf9\xfc\0") << QVariant::fromValue<qfloat16>(qfloat16(myNInff()));
++ QTest::newRow("+inf_f16") << raw("\xf9\x7c\0") << QVariant::fromValue<qfloat16>(qfloat16(myInff()));
+ #endif
+
+ QTest::newRow("0.f") << raw("\xfa\0\0\0\0") << QVariant::fromValue(0.f);
diff --git a/dev-qt/qtbase/qtbase-6.5.2.ebuild b/dev-qt/qtbase/qtbase-6.5.2.ebuild
index f80f5b0648d3..4bd5f7c95c60 100644
--- a/dev-qt/qtbase/qtbase-6.5.2.ebuild
+++ b/dev-qt/qtbase/qtbase-6.5.2.ebuild
@@ -41,6 +41,10 @@ REQUIRED_USE+="
gui? ( || ( X eglfs ) || ( X libinput ) )
libinput? ( udev )
sql? ( || ( freetds mysql oci8 odbc postgres sqlite ) )
+ test? (
+ gui jpeg icu
+ sql? ( sqlite )
+ )
vnc? ( gui )
"
@@ -110,8 +114,19 @@ PDEPEND="wayland? ( =dev-qt/qtwayland-${PV}*:6 )" #864509
PATCHES=(
"${FILESDIR}"/${P}-CVE-2023-38197.patch
+ "${FILESDIR}"/${P}-tests-gcc13.patch
)
+src_prepare() {
+ qt6-build_src_prepare
+
+ if use test; then
+ # test itself has -Werror=strict-aliasing issues, drop for simplicity
+ sed -e '/add_subdirectory(qsharedpointer)/d' \
+ -i tests/auto/corelib/tools/CMakeLists.txt || die
+ fi
+}
+
src_configure() {
local mycmakeargs=(
-DINSTALL_ARCHDATADIR="${QT6_ARCHDATADIR}"
@@ -174,6 +189,7 @@ src_configure() {
$(qt_feature sctp)
$(qt_feature ssl openssl)
$(qt_feature vnc)
+ $(usev test -DQT_SKIP_DOCKER_COMPOSE=ON)
)
use sql && mycmakeargs+=(
$(qt_feature freetds sql_tds)
@@ -189,8 +205,65 @@ src_configure() {
qt6-build_src_configure
}
+src_test() {
+ local -x TZ=UTC
+ local -x LC_TIME=C
+
+ local CMAKE_SKIP_TESTS=(
+ # broken with out-of-source + if qtbase is not already installed
+ tst_moc
+ tst_qmake
+ # needs x11/opengl, we *could* run these but tend to be flaky
+ # when opengl rendering is involved (even if software-only)
+ tst_qopengl{,config,widget,window}
+ tst_qgraphicsview
+ tst_qx11info
+ # fails with network sandbox
+ tst_qdnslookup
+ # typical to lack SCTP support on non-generic kernels
+ tst_qsctpsocket
+ # these can be flaky depending on the environment/toolchain
+ tst_qlogging # backtrace log test can easily vary
+ tst_qrawfont # can be affected by available fonts
+ tst_qstorageinfo # checks mounted filesystems
+ # flaky due to using different test framework and fails with USE=-gui
+ tst_selftests
+ # known failing when using clang+glibc+stdc++, needs looking into
+ tst_qthread
+ # partially failing on x86 chroots and seemingly(?) harmless (dev-qt
+ # revdeps tests pass), skip globally to avoid keywording flakiness
+ tst_json
+ tst_qcolorspace
+ tst_qdoublevalidator
+ tst_qglobal
+ tst_qglyphrun
+ tst_qvectornd
+ tst_rcc
+ # note: for linux, upstream only really runs+maintains tests for amd64
+ # https://doc.qt.io/qt-6/supported-platforms.html
+ )
+
+ qt6-build_src_test
+}
+
src_install() {
qt6-build_src_install
qt6_symlink_binary_to_path qmake 6 #863395
+
+ if use test; then
+ local delete_bins=( # need a better way to handle this
+ clientserver copier crashingServer desktopsettingsaware_helper
+ echo fileWriterProcess modal_helper nospace 'one space'
+ paster qcommandlineparser_test_helper qfileopeneventexternal
+ socketprocess syslocaleapp tst_qhashseed_helper 'two space s'
+ write-read-write
+ )
+ local delete=( # sigh
+ "${D}${QT6_BINDIR}"/test*
+ "${delete_bins[@]/#/${D}${QT6_BINDIR}/}"
+ )
+ # using -f given not tracking which tests may be skipped or not
+ rm -rf -- "${delete[@]}" || die
+ fi
}
diff --git a/dev-qt/qtbase/qtbase-6.5.9999.ebuild b/dev-qt/qtbase/qtbase-6.5.9999.ebuild
index bf83f54c5ffa..94a8d5840093 100644
--- a/dev-qt/qtbase/qtbase-6.5.9999.ebuild
+++ b/dev-qt/qtbase/qtbase-6.5.9999.ebuild
@@ -41,6 +41,10 @@ REQUIRED_USE+="
gui? ( || ( X eglfs ) || ( X libinput ) )
libinput? ( udev )
sql? ( || ( freetds mysql oci8 odbc postgres sqlite ) )
+ test? (
+ gui jpeg icu
+ sql? ( sqlite )
+ )
vnc? ( gui )
"
@@ -108,6 +112,16 @@ RDEPEND="
DEPEND="${RDEPEND}"
PDEPEND="wayland? ( =dev-qt/qtwayland-${PV}*:6 )" #864509
+src_prepare() {
+ qt6-build_src_prepare
+
+ if use test; then
+ # test itself has -Werror=strict-aliasing issues, drop for simplicity
+ sed -e '/add_subdirectory(qsharedpointer)/d' \
+ -i tests/auto/corelib/tools/CMakeLists.txt || die
+ fi
+}
+
src_configure() {
local mycmakeargs=(
-DINSTALL_ARCHDATADIR="${QT6_ARCHDATADIR}"
@@ -170,6 +184,7 @@ src_configure() {
$(qt_feature sctp)
$(qt_feature ssl openssl)
$(qt_feature vnc)
+ $(usev test -DQT_SKIP_DOCKER_COMPOSE=ON)
)
use sql && mycmakeargs+=(
$(qt_feature freetds sql_tds)
@@ -185,8 +200,65 @@ src_configure() {
qt6-build_src_configure
}
+src_test() {
+ local -x TZ=UTC
+ local -x LC_TIME=C
+
+ local CMAKE_SKIP_TESTS=(
+ # broken with out-of-source + if qtbase is not already installed
+ tst_moc
+ tst_qmake
+ # needs x11/opengl, we *could* run these but tend to be flaky
+ # when opengl rendering is involved (even if software-only)
+ tst_qopengl{,config,widget,window}
+ tst_qgraphicsview
+ tst_qx11info
+ # fails with network sandbox
+ tst_qdnslookup
+ # typical to lack SCTP support on non-generic kernels
+ tst_qsctpsocket
+ # these can be flaky depending on the environment/toolchain
+ tst_qlogging # backtrace log test can easily vary
+ tst_qrawfont # can be affected by available fonts
+ tst_qstorageinfo # checks mounted filesystems
+ # flaky due to using different test framework and fails with USE=-gui
+ tst_selftests
+ # known failing when using clang+glibc+stdc++, needs looking into
+ tst_qthread
+ # partially failing on x86 chroots and seemingly(?) harmless (dev-qt
+ # revdeps tests pass), skip globally to avoid keywording flakiness
+ tst_json
+ tst_qcolorspace
+ tst_qdoublevalidator
+ tst_qglobal
+ tst_qglyphrun
+ tst_qvectornd
+ tst_rcc
+ # note: for linux, upstream only really runs+maintains tests for amd64
+ # https://doc.qt.io/qt-6/supported-platforms.html
+ )
+
+ qt6-build_src_test
+}
+
src_install() {
qt6-build_src_install
qt6_symlink_binary_to_path qmake 6 #863395
+
+ if use test; then
+ local delete_bins=( # need a better way to handle this
+ clientserver copier crashingServer desktopsettingsaware_helper
+ echo fileWriterProcess modal_helper nospace 'one space'
+ paster qcommandlineparser_test_helper qfileopeneventexternal
+ socketprocess syslocaleapp tst_qhashseed_helper 'two space s'
+ write-read-write
+ )
+ local delete=( # sigh
+ "${D}${QT6_BINDIR}"/test*
+ "${delete_bins[@]/#/${D}${QT6_BINDIR}/}"
+ )
+ # using -f given not tracking which tests may be skipped or not
+ rm -rf -- "${delete[@]}" || die
+ fi
}
diff --git a/dev-qt/qtbase/qtbase-6.9999.ebuild b/dev-qt/qtbase/qtbase-6.9999.ebuild
index bf83f54c5ffa..94a8d5840093 100644
--- a/dev-qt/qtbase/qtbase-6.9999.ebuild
+++ b/dev-qt/qtbase/qtbase-6.9999.ebuild
@@ -41,6 +41,10 @@ REQUIRED_USE+="
gui? ( || ( X eglfs ) || ( X libinput ) )
libinput? ( udev )
sql? ( || ( freetds mysql oci8 odbc postgres sqlite ) )
+ test? (
+ gui jpeg icu
+ sql? ( sqlite )
+ )
vnc? ( gui )
"
@@ -108,6 +112,16 @@ RDEPEND="
DEPEND="${RDEPEND}"
PDEPEND="wayland? ( =dev-qt/qtwayland-${PV}*:6 )" #864509
+src_prepare() {
+ qt6-build_src_prepare
+
+ if use test; then
+ # test itself has -Werror=strict-aliasing issues, drop for simplicity
+ sed -e '/add_subdirectory(qsharedpointer)/d' \
+ -i tests/auto/corelib/tools/CMakeLists.txt || die
+ fi
+}
+
src_configure() {
local mycmakeargs=(
-DINSTALL_ARCHDATADIR="${QT6_ARCHDATADIR}"
@@ -170,6 +184,7 @@ src_configure() {
$(qt_feature sctp)
$(qt_feature ssl openssl)
$(qt_feature vnc)
+ $(usev test -DQT_SKIP_DOCKER_COMPOSE=ON)
)
use sql && mycmakeargs+=(
$(qt_feature freetds sql_tds)
@@ -185,8 +200,65 @@ src_configure() {
qt6-build_src_configure
}
+src_test() {
+ local -x TZ=UTC
+ local -x LC_TIME=C
+
+ local CMAKE_SKIP_TESTS=(
+ # broken with out-of-source + if qtbase is not already installed
+ tst_moc
+ tst_qmake
+ # needs x11/opengl, we *could* run these but tend to be flaky
+ # when opengl rendering is involved (even if software-only)
+ tst_qopengl{,config,widget,window}
+ tst_qgraphicsview
+ tst_qx11info
+ # fails with network sandbox
+ tst_qdnslookup
+ # typical to lack SCTP support on non-generic kernels
+ tst_qsctpsocket
+ # these can be flaky depending on the environment/toolchain
+ tst_qlogging # backtrace log test can easily vary
+ tst_qrawfont # can be affected by available fonts
+ tst_qstorageinfo # checks mounted filesystems
+ # flaky due to using different test framework and fails with USE=-gui
+ tst_selftests
+ # known failing when using clang+glibc+stdc++, needs looking into
+ tst_qthread
+ # partially failing on x86 chroots and seemingly(?) harmless (dev-qt
+ # revdeps tests pass), skip globally to avoid keywording flakiness
+ tst_json
+ tst_qcolorspace
+ tst_qdoublevalidator
+ tst_qglobal
+ tst_qglyphrun
+ tst_qvectornd
+ tst_rcc
+ # note: for linux, upstream only really runs+maintains tests for amd64
+ # https://doc.qt.io/qt-6/supported-platforms.html
+ )
+
+ qt6-build_src_test
+}
+
src_install() {
qt6-build_src_install
qt6_symlink_binary_to_path qmake 6 #863395
+
+ if use test; then
+ local delete_bins=( # need a better way to handle this
+ clientserver copier crashingServer desktopsettingsaware_helper
+ echo fileWriterProcess modal_helper nospace 'one space'
+ paster qcommandlineparser_test_helper qfileopeneventexternal
+ socketprocess syslocaleapp tst_qhashseed_helper 'two space s'
+ write-read-write
+ )
+ local delete=( # sigh
+ "${D}${QT6_BINDIR}"/test*
+ "${delete_bins[@]/#/${D}${QT6_BINDIR}/}"
+ )
+ # using -f given not tracking which tests may be skipped or not
+ rm -rf -- "${delete[@]}" || die
+ fi
}