summaryrefslogtreecommitdiffstats
path: root/tests/arthur
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2010-09-07 12:02:30 (GMT)
committeraavit <qt-info@nokia.com>2010-09-07 12:02:30 (GMT)
commitf1c5c0c1580e68d28eae0373e5df2b92be437af3 (patch)
tree85efc296d2f86470aea2a90cde85c9c505e205d6 /tests/arthur
parentbf12d2047b00eb88d96f2767b07c47bbb8df6b89 (diff)
downloadQt-f1c5c0c1580e68d28eae0373e5df2b92be437af3.zip
Qt-f1c5c0c1580e68d28eae0373e5df2b92be437af3.tar.gz
Qt-f1c5c0c1580e68d28eae0373e5df2b92be437af3.tar.bz2
More server storage path fixing
Diffstat (limited to 'tests/arthur')
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.cpp22
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.h1
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