summaryrefslogtreecommitdiffstats
path: root/tests/baselineserver/shared
diff options
context:
space:
mode:
Diffstat (limited to 'tests/baselineserver/shared')
-rw-r--r--tests/baselineserver/shared/baselineprotocol.cpp46
-rw-r--r--tests/baselineserver/shared/baselineprotocol.h13
2 files changed, 35 insertions, 24 deletions
diff --git a/tests/baselineserver/shared/baselineprotocol.cpp b/tests/baselineserver/shared/baselineprotocol.cpp
index 0fe3aa22a9..630ca88e5b 100644
--- a/tests/baselineserver/shared/baselineprotocol.cpp
+++ b/tests/baselineserver/shared/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/baselineserver/shared/baselineprotocol.h b/tests/baselineserver/shared/baselineprotocol.h
index 2d09e683d4..0b08e444fd 100644
--- a/tests/baselineserver/shared/baselineprotocol.h
+++ b/tests/baselineserver/shared/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);