diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2024-04-11 09:57:59 -0700 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2024-04-26 18:19:36 +0200 |
commit | c14f399d2ab42fa612121e805d8ec1e63747ccd6 (patch) | |
tree | f0b3a01b37460dbc0b03d7bd7a9e7d8d43d7c586 /src/testlib/qtestcase.qdoc | |
parent | 4ae6f40b3a2e2fe4f617a1c911c8d066c18cdab9 (diff) |
QTest: rip out qxp::function_ref from reportResult()
This is causing huge code bloat because everything is a local lambda.
Instead, pass direct type-erased function and data pointers to the
replacement function. Testing with tst_qcborvalue, this reduces the
compilation time and the output binary size significantly:
Before After
Compiler Time Size Time Size
GCC 13.2 136.99 s 202.3 MB 13.88 s 14.3 MB
GCC 14.0 131.49 s 202.7 MB 14.69 s 14.4 MB
Clang 17 77.2 s 146.7 MB 13.62 s 12.2 MB
Clang 18 141.9 s 187.1 MB 13.62 s 12.4 MB
This causes a difference in how toString() overloads are
found. Previously it would match far more overloads because the
toString() calls were expanded by the macro. Now, we depend on
Argument-Dependent Lookup and associated namespaces, so toString()
overloads should not be in the QTest namespace any more.
With this patch applied, the testlib testcase of tst_selftest
started failing, because nullptr is now handled differently.
However, I consider it as a bugfix, because previously it was
falling back to a default implementation, and now it is using
the QTest::toString(std::nullptr_t) overload, which is a
desired behavior. Update the reference files for tst_selftest
with the new expected output.
Task-number: QTBUG-124272
Change-Id: Ie28eadac333c4bcd8c08fffd17c5484186accdf6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/testlib/qtestcase.qdoc')
-rw-r--r-- | src/testlib/qtestcase.qdoc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc index 973899e4d3..2eb060b9af 100644 --- a/src/testlib/qtestcase.qdoc +++ b/src/testlib/qtestcase.qdoc @@ -1608,7 +1608,8 @@ */ /*! - \fn char *QTest::toString(QSizePolicy::ControlType ct) + \fn char *toString(QSizePolicy::ControlType ct) + \relates QTest \overload \since 5.5 @@ -1616,7 +1617,8 @@ */ /*! - \fn char *QTest::toString(QSizePolicy::ControlTypes cts) + \fn char *toString(QSizePolicy::ControlTypes cts) + \relates QTest \overload \since 5.5 @@ -1624,7 +1626,8 @@ */ /*! - \fn char *QTest::toString(QSizePolicy::Policy p) + \fn char *toString(QSizePolicy::Policy p) + \relates QTest \overload \since 5.5 @@ -1632,7 +1635,8 @@ */ /*! - \fn char *QTest::toString(QSizePolicy sp) + \fn char *toString(QSizePolicy sp) + \relates QTest \overload \since 5.5 |