diff options
author | aavit <qt-info@nokia.com> | 2011-09-01 14:50:59 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-01 16:14:18 +0200 |
commit | 74cadacdd5f571dfbab0e8b5f626bee79761c549 (patch) | |
tree | 23d7a6de0fa6b42ba3cc345d3fb94f33af333ede /tests/auto/lancelot | |
parent | 9bb0cc30ee8566e8c99865a657afd275d2d2f477 (diff) |
Add option to compare to different platform in lancelot autotest
(cherry picked from commit b6b160d9ba1e0a5f1fbd67112f8c78ba48e7cad7)
Conflicts:
tests/baselineserver/src/baselineserver.cpp
Change-Id: Ie8bdff26b8394bb6a5b6b48225b20833dbee0637
Reviewed-on: http://codereview.qt.nokia.com/4082
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'tests/auto/lancelot')
-rw-r--r-- | tests/auto/lancelot/paintcommands.cpp | 4 | ||||
-rw-r--r-- | tests/auto/lancelot/tst_lancelot.cpp | 21 |
2 files changed, 22 insertions, 3 deletions
diff --git a/tests/auto/lancelot/paintcommands.cpp b/tests/auto/lancelot/paintcommands.cpp index 8735baa3f0..9659659973 100644 --- a/tests/auto/lancelot/paintcommands.cpp +++ b/tests/auto/lancelot/paintcommands.cpp @@ -2306,7 +2306,11 @@ void PaintCommands::command_gradient_setRadialExtended(QRegExp re) "focal radius=%.2f, spread=%d\n", cx, cy, rad, fx, fy, frad, m_gradientSpread); +#if QT_VERSION >= 0x040800 QRadialGradient rg(QPointF(cx, cy), rad, QPointF(fx, fy), frad); +#else + QRadialGradient rg(QPointF(cx, cy), rad, QPointF(fx, fy)); +#endif rg.setStops(m_gradientStops); rg.setSpread(m_gradientSpread); rg.setCoordinateMode(m_gradientCoordinate); diff --git a/tests/auto/lancelot/tst_lancelot.cpp b/tests/auto/lancelot/tst_lancelot.cpp index cba5fab4d1..256ff29889 100644 --- a/tests/auto/lancelot/tst_lancelot.cpp +++ b/tests/auto/lancelot/tst_lancelot.cpp @@ -62,6 +62,7 @@ public: tst_Lancelot(); static bool simfail; + static PlatformInfo clientInfo; private: enum GraphicsEngine { @@ -98,6 +99,7 @@ private slots: }; bool tst_Lancelot::simfail = false; +PlatformInfo tst_Lancelot::clientInfo; tst_Lancelot::tst_Lancelot() { @@ -112,7 +114,7 @@ void tst_Lancelot::initTestCase() #if defined(Q_OS_SOMEPLATFORM) QSKIP("This test is not supported on this platform.", SkipAll); #endif - if (!proto.connect(QLatin1String("tst_Lancelot"), &dryRunMode)) + if (!proto.connect(QLatin1String("tst_Lancelot"), &dryRunMode, clientInfo)) QSKIP(qPrintable(proto.errorMessage()), SkipAll); #if defined(USE_RUNTIME_DIR) @@ -329,13 +331,26 @@ QTEST_MAIN(tst_Lancelot) int main(int argc, char *argv[]) { + tst_Lancelot::clientInfo = PlatformInfo::localHostInfo(); + char *fargv[20]; int fargc = 0; for (int i = 0; i < qMin(argc, 19); i++) { - if (!qstrcmp(argv[i], "-simfail")) + if (!qstrcmp(argv[i], "-simfail")) { tst_Lancelot::simfail = true; - else + } else if (!qstrcmp(argv[i], "-compareto") && i < argc-1) { + QString arg = QString::fromLocal8Bit(argv[++i]); + int split = arg.indexOf(QLC('=')); + if (split < 0) + continue; + QString key = arg.left(split).trimmed(); + QString value = arg.mid(split+1).trimmed(); + if (key.isEmpty() || value.isEmpty()) + continue; + tst_Lancelot::clientInfo.addOverride(key, value); + } else { fargv[fargc++] = argv[i]; + } } fargv[fargc] = 0; return rmain(fargc, fargv); |