From f1c5c0c1580e68d28eae0373e5df2b92be437af3 Mon Sep 17 00:00:00 2001 From: aavit Date: Tue, 7 Sep 2010 14:02:30 +0200 Subject: More server storage path fixing --- tests/arthur/baselineserver/src/baselineserver.cpp | 22 +++++++++++++++------- tests/arthur/baselineserver/src/baselineserver.h | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp index 685fcae..e7a994f 100644 --- a/tests/arthur/baselineserver/src/baselineserver.cpp +++ b/tests/arthur/baselineserver/src/baselineserver.cpp @@ -94,7 +94,7 @@ void BaselineHandler::receiveRequest() return; } connectionEstablished = true; - qDebug() << runId << logtime() << "Connection established with" << plat.hostname << "Qt version:" << plat.qtVersion << plat.buildKey; + qDebug() << runId << logtime() << "Connection established with" << plat.hostname << proto.socket.peerAddress().toString() << "Qt version:" << plat.qtVersion << plat.buildKey; return; } @@ -191,18 +191,26 @@ void BaselineHandler::receiveDisconnect() QString BaselineHandler::pathForItem(const ImageItem &item, bool isBaseline) { - QString host = plat.hostname; - //# tbd: if "localhost", replace with smth meaningful - host.replace(QRegExp(QLatin1String("^(bq|oslo)-(.*)-\\d\\d$")), QLatin1String("vm-\\2")); - QString pathForRun = BaselineServer::storagePath() + host + QLatin1Char('/'); + if (pathForRun.isNull()) { + QString host = plat.hostname; + if (host == QLatin1String("localhost")) + host = proto.socket.peerAddress().toString(); + else + host.replace(QRegExp(QLatin1String("^(bq|oslo)-(.*)-\\d\\d$")), QLatin1String("vm-\\2")); + pathForRun = BaselineServer::storagePath() + host + QLatin1Char('/'); + } QString storePath = pathForRun; if (isBaseline) storePath += QString(QLatin1String("baselines_%1_%2/")).arg(item.engineAsString(), item.formatAsString()); else storePath += runId + QLatin1Char('/'); - //#? QString itemName = item.scriptName.replace(item.scriptName.lastIndexOf('.'), '_'); - return storePath + item.scriptName + QLatin1Char('.'); + + QString itemName = item.scriptName; + if (itemName.contains(QLatin1Char('.'))) + itemName.replace(itemName.lastIndexOf(QLatin1Char('.')), 1, QLatin1Char('_')); + + return storePath + itemName + QLatin1Char('.'); } QString BaselineHandler::computeMismatchScore(const QImage &baseline, const QImage &rendered) diff --git a/tests/arthur/baselineserver/src/baselineserver.h b/tests/arthur/baselineserver/src/baselineserver.h index 2963fd1..683d2fd 100644 --- a/tests/arthur/baselineserver/src/baselineserver.h +++ b/tests/arthur/baselineserver/src/baselineserver.h @@ -72,6 +72,7 @@ private: PlatformInfo plat; bool connectionEstablished; QString runId; + QString pathForRun; }; #endif // BASELINESERVER_H -- cgit v0.12