Baseline testing: Fix overriding of Project property

Remove some kludgy, redundant and never used functionality for setting
project and test case names, as it also hindered overriding those
properties at runtime.

Pick-to: 6.3 6.2
Change-Id: Ibef7d7d0cb5fc1e462752f2ba2db76cc088dbd48
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Eirik Aavitsland 2022-03-15 15:44:34 +01:00
parent 60592f72d6
commit 9619cec279
2 changed files with 4 additions and 16 deletions

View File

@ -51,9 +51,6 @@ static QByteArray curFunction;
static ImageItemList itemList;
static bool gotBaselines;
static QString definedTestProject;
static QString definedTestCase;
void handleCmdLineArgs(int *argcp, char ***argvp)
{
@ -200,10 +197,7 @@ bool connect(QByteArray *msg, bool *error)
if (!customAutoModeSet)
clientInfo.setAdHocRun(defaultInfo.isAdHocRun());
if (!definedTestProject.isEmpty())
clientInfo.insert(PI_Project, definedTestProject);
QString testCase = definedTestCase;
QString testCase = clientInfo.value(PI_TestCase);
if (testCase.isEmpty() && QTest::testObject() && QTest::testObject()->metaObject()) {
//qDebug() << "Trying to Read TestCaseName from Testlib!";
testCase = QTest::testObject()->metaObject()->className();
@ -233,16 +227,10 @@ bool disconnectFromBaselineServer()
return false;
}
bool connectToBaselineServer(QByteArray *msg, const QString &testProject, const QString &testCase)
bool connectToBaselineServer(QByteArray *msg)
{
bool dummy;
QByteArray dummyMsg;
if (!testProject.isEmpty())
definedTestProject = testProject;
if (!testCase.isEmpty())
definedTestCase = testCase;
return connect(msg ? msg : &dummyMsg, &dummy);
}
@ -259,7 +247,7 @@ void setSimFail(bool fail)
void setProject(const QString &projectName)
{
definedTestProject = projectName;
addClientProperty(PI_Project, projectName);
}
void setProjectImageKeys(const QStringList &keys)

View File

@ -39,7 +39,7 @@ 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 connectToBaselineServer(QByteArray *msg = nullptr);
bool checkImage(const QImage& img, const char *name, quint16 checksum, QByteArray *msg, bool *error, int manualdatatag = 0);
bool testImage(const QImage& img, QByteArray *msg, bool *error);
QTestData &newRow(const char *dataTag, quint16 checksum = 0);