Add a couple of utility functions to the baseline test framework
Adds a function for setting the baseline Project name, which selects the top level server directory and hence config settings. Also adds a function that lets the client override the server config setting for the project image keys (ItemPathKeys). This is the list of properties that will be used to determine which clients are "the same", i.e. which baseline to compare against. Overriding that is handy since it allows experimentation and customization of clients without involving changes in the project config on the baseline server. Pick-to: 6.3 6.2 Change-Id: Id3998356494a9a2cb71c009b43593d3dc1b6963a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This commit is contained in:
parent
657a18c7fa
commit
7719fcea4b
@ -42,6 +42,7 @@
|
||||
#include <QRegularExpression>
|
||||
|
||||
const QString PI_Project(QLS("Project"));
|
||||
const QString PI_ProjectImageKeys(QLS("ProjectImageKeys"));
|
||||
const QString PI_TestCase(QLS("TestCase"));
|
||||
const QString PI_HostName(QLS("HostName"));
|
||||
const QString PI_HostAddress(QLS("HostAddress"));
|
||||
|
@ -43,6 +43,7 @@
|
||||
#define FileFormat "png"
|
||||
|
||||
extern const QString PI_Project;
|
||||
extern const QString PI_ProjectImageKeys;
|
||||
extern const QString PI_TestCase;
|
||||
extern const QString PI_HostName;
|
||||
extern const QString PI_HostAddress;
|
||||
|
@ -238,8 +238,10 @@ bool connectToBaselineServer(QByteArray *msg, const QString &testProject, const
|
||||
bool dummy;
|
||||
QByteArray dummyMsg;
|
||||
|
||||
definedTestProject = testProject;
|
||||
definedTestCase = testCase;
|
||||
if (!testProject.isEmpty())
|
||||
definedTestProject = testProject;
|
||||
if (!testCase.isEmpty())
|
||||
definedTestCase = testCase;
|
||||
|
||||
return connect(msg ? msg : &dummyMsg, &dummy);
|
||||
}
|
||||
@ -255,6 +257,16 @@ void setSimFail(bool fail)
|
||||
simfail = fail;
|
||||
}
|
||||
|
||||
void setProject(const QString &projectName)
|
||||
{
|
||||
definedTestProject = projectName;
|
||||
}
|
||||
|
||||
void setProjectImageKeys(const QStringList &keys)
|
||||
{
|
||||
QString keyList = keys.join(QLC(','));
|
||||
addClientProperty(PI_ProjectImageKeys, keyList);
|
||||
}
|
||||
|
||||
void modifyImage(QImage *img)
|
||||
{
|
||||
|
@ -36,6 +36,8 @@ namespace QBaselineTest {
|
||||
void setAutoMode(bool mode);
|
||||
void setSimFail(bool fail);
|
||||
void handleCmdLineArgs(int *argcp, char ***argvp);
|
||||
void setProject(const QString &projectName); // Selects server config settings and top level dir
|
||||
void setProjectImageKeys(const QStringList &keys); // Overrides the ItemPathKeys config setting
|
||||
void addClientProperty(const QString& key, const QString& value);
|
||||
bool connectToBaselineServer(QByteArray *msg = nullptr, const QString &testProject = QString(), const QString &testCase = QString());
|
||||
bool checkImage(const QImage& img, const char *name, quint16 checksum, QByteArray *msg, bool *error, int manualdatatag = 0);
|
||||
|
@ -37,7 +37,7 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
QWidgetBaselineTest::QWidgetBaselineTest()
|
||||
{
|
||||
QBaselineTest::addClientProperty("Project", "Widgets");
|
||||
QBaselineTest::setProject("Widgets");
|
||||
|
||||
// Set key platform properties that are relevant for the appearance of widgets
|
||||
const QString platformName = QGuiApplication::platformName() + "-" + QSysInfo::productType();
|
||||
|
Loading…
x
Reference in New Issue
Block a user