diff options
author | Sami Lempinen <sami.lempinen@nokia.com> | 2011-08-23 11:33:16 (GMT) |
---|---|---|
committer | Sami Lempinen <sami.lempinen@nokia.com> | 2011-08-23 11:33:16 (GMT) |
commit | a28832bb61e7e60ac0fb856daf27b78ff1728520 (patch) | |
tree | d8ecd2387568814a68bf8b8713f3abed9ff9f275 /tests/arthur/common/baselineprotocol.cpp | |
parent | 59f33898919391d3aa4baa6849556965ae7d08ce (diff) | |
parent | 2f5855e8d891a7e93bdb721243f1c0b10fcb5ad9 (diff) | |
download | Qt-a28832bb61e7e60ac0fb856daf27b78ff1728520.zip Qt-a28832bb61e7e60ac0fb856daf27b78ff1728520.tar.gz Qt-a28832bb61e7e60ac0fb856daf27b78ff1728520.tar.bz2 |
Merge remote-tracking branch 'qt/4.8'
Diffstat (limited to 'tests/arthur/common/baselineprotocol.cpp')
-rw-r--r-- | tests/arthur/common/baselineprotocol.cpp | 46 |
1 files changed, 28 insertions, 18 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); |