summaryrefslogtreecommitdiffstats
path: root/tests/arthur/common
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2011-08-05 10:32:52 (GMT)
committeraavit <qt-info@nokia.com>2011-08-05 10:51:17 (GMT)
commitb6b160d9ba1e0a5f1fbd67112f8c78ba48e7cad7 (patch)
tree4428b9dad8a78493ffe4078c0c94b7ca494ebcbe /tests/arthur/common
parentfdc3d5590103f5cbbcfc1a7efec75316ae60eb7b (diff)
downloadQt-b6b160d9ba1e0a5f1fbd67112f8c78ba48e7cad7.zip
Qt-b6b160d9ba1e0a5f1fbd67112f8c78ba48e7cad7.tar.gz
Qt-b6b160d9ba1e0a5f1fbd67112f8c78ba48e7cad7.tar.bz2
Add option to compare to different platform in lancelot autotest
Diffstat (limited to 'tests/arthur/common')
-rw-r--r--tests/arthur/common/baselineprotocol.cpp46
-rw-r--r--tests/arthur/common/baselineprotocol.h13
-rw-r--r--tests/arthur/common/paintcommands.cpp4
3 files changed, 39 insertions, 24 deletions
diff --git a/tests/arthur/common/baselineprotocol.cpp b/tests/arthur/common/baselineprotocol.cpp
index 0fe3aa2..630ca88 100644
--- a/tests/arthur/common/baselineprotocol.cpp
+++ b/tests/arthur/common/baselineprotocol.cpp
@@ -83,7 +83,7 @@ void BaselineProtocol::sysSleep(int ms)
}
PlatformInfo::PlatformInfo()
- : QMap<QString, QString>(), replaceDefault(false)
+ : QMap<QString, QString>(), adHoc(true)
{
}
@@ -134,11 +134,15 @@ PlatformInfo PlatformInfo::localHostInfo()
pi.insert(PI_GitCommit, QLS("Unknown"));
QByteArray gb = qgetenv("PULSE_GIT_BRANCH");
- if (!gb.isEmpty())
+ if (!gb.isEmpty()) {
pi.insert(PI_PulseGitBranch, QString::fromLatin1(gb));
+ pi.setAdHocRun(false);
+ }
QByteArray tb = qgetenv("PULSE_TESTR_BRANCH");
- if (!tb.isEmpty())
+ if (!tb.isEmpty()) {
pi.insert(PI_PulseTestrBranch, QString::fromLatin1(tb));
+ pi.setAdHocRun(false);
+ }
return pi;
}
@@ -147,43 +151,49 @@ PlatformInfo PlatformInfo::localHostInfo()
PlatformInfo::PlatformInfo(const PlatformInfo &other)
: QMap<QString, QString>(other)
{
- sigKeys = other.sigKeys;
- replaceDefault = other.replaceDefault;
+ orides = other.orides;
+ adHoc = other.adHoc;
}
PlatformInfo &PlatformInfo::operator=(const PlatformInfo &other)
{
QMap<QString, QString>::operator=(other);
- sigKeys = other.sigKeys;
- replaceDefault = other.replaceDefault;
+ orides = other.orides;
+ adHoc = other.adHoc;
return *this;
}
-void PlatformInfo::addSignificantKeys(const QStringList &keys, bool replaceDefaultKeys)
+void PlatformInfo::addOverride(const QString& key, const QString& value)
+{
+ orides.append(key);
+ orides.append(value);
+}
+
+
+QStringList PlatformInfo::overrides() const
{
- sigKeys = keys;
- replaceDefault = replaceDefaultKeys;
+ return orides;
}
-QStringList PlatformInfo::addedKeys() const
+void PlatformInfo::setAdHocRun(bool isAdHoc)
{
- return sigKeys;
+ adHoc = isAdHoc;
}
-bool PlatformInfo::addedKeysReplaceDefault() const
+bool PlatformInfo::isAdHocRun() const
{
- return replaceDefault;
+ return adHoc;
}
QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pi)
{
stream << static_cast<const QMap<QString, QString>&>(pi);
- stream << pi.sigKeys << pi.replaceDefault;
+ stream << pi.orides << pi.adHoc;
return stream;
}
@@ -191,7 +201,7 @@ QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pi)
QDataStream & operator>> (QDataStream &stream, PlatformInfo &pi)
{
stream >> static_cast<QMap<QString, QString>&>(pi);
- stream >> pi.sigKeys >> pi.replaceDefault;
+ stream >> pi.orides >> pi.adHoc;
return stream;
}
@@ -346,7 +356,7 @@ BaselineProtocol::~BaselineProtocol()
}
-bool BaselineProtocol::connect(const QString &testCase, bool *dryrun)
+bool BaselineProtocol::connect(const QString &testCase, bool *dryrun, const PlatformInfo& clientInfo)
{
errMsg.clear();
QByteArray serverName(qgetenv("QT_LANCELOT_SERVER"));
@@ -362,7 +372,7 @@ bool BaselineProtocol::connect(const QString &testCase, bool *dryrun)
}
}
- PlatformInfo pi = PlatformInfo::localHostInfo();
+ PlatformInfo pi = clientInfo.isEmpty() ? PlatformInfo::localHostInfo() : clientInfo;
pi.insert(PI_TestCase, testCase);
QByteArray block;
QDataStream ds(&block, QIODevice::ReadWrite);
diff --git a/tests/arthur/common/baselineprotocol.h b/tests/arthur/common/baselineprotocol.h
index 2d09e68..0b08e44 100644
--- a/tests/arthur/common/baselineprotocol.h
+++ b/tests/arthur/common/baselineprotocol.h
@@ -78,13 +78,14 @@ public:
static PlatformInfo localHostInfo();
- void addSignificantKeys(const QStringList& keys, bool replaceDefaultKeys=false);
- QStringList addedKeys() const;
- bool addedKeysReplaceDefault() const;
+ void addOverride(const QString& key, const QString& value);
+ QStringList overrides() const;
+ bool isAdHocRun() const;
+ void setAdHocRun(bool isAdHoc);
private:
- QStringList sigKeys;
- bool replaceDefault;
+ QStringList orides;
+ bool adHoc;
friend QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pi);
friend QDataStream & operator>> (QDataStream &stream, PlatformInfo& pi);
};
@@ -165,7 +166,7 @@ public:
// For client:
// For advanced client:
- bool connect(const QString &testCase, bool *dryrun = 0);
+ bool connect(const QString &testCase, bool *dryrun = 0, const PlatformInfo& clientInfo = PlatformInfo());
bool requestBaselineChecksums(const QString &testFunction, ImageItemList *itemList);
bool submitNewBaseline(const ImageItem &item, QByteArray *serverMsg);
bool submitMismatch(const ImageItem &item, QByteArray *serverMsg);
diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp
index 298c699..f54d942 100644
--- a/tests/arthur/common/paintcommands.cpp
+++ b/tests/arthur/common/paintcommands.cpp
@@ -2454,7 +2454,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);