mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 06:24:41 +02:00
Added referral to physical memory Test.
Added menu items - `close` and `about`
This commit is contained in:
parent
91197cadcf
commit
aceaa510c8
5 changed files with 91 additions and 25 deletions
|
@ -498,6 +498,12 @@ ExtractedText Test::getTestScriptLines(QString testFileName) {
|
||||||
const QString regexAssertGPU(ws + functionAssertGPU + ws + "\\(" + ws + quotedString + ".*");
|
const QString regexAssertGPU(ws + functionAssertGPU + ws + "\\(" + ws + quotedString + ".*");
|
||||||
const QRegularExpression lineAssertGPU = QRegularExpression(regexAssertGPU);
|
const QRegularExpression lineAssertGPU = QRegularExpression(regexAssertGPU);
|
||||||
|
|
||||||
|
// Assert the correct amount of memory
|
||||||
|
const QString functionAssertPhysicalMemoryGB(ws + "autoTester" + ws + "\\." + ws + "assertPhysicalMemoryGB");
|
||||||
|
const QString regexAssertPhysicalMemoryGB(ws + functionAssertPhysicalMemoryGB + ws + "\\(" + ws + quotedString + ".*");
|
||||||
|
const QRegularExpression lineAssertPhysicalMemoryGB = QRegularExpression(regexAssertPhysicalMemoryGB);
|
||||||
|
|
||||||
|
|
||||||
// Each step is either of the following forms:
|
// Each step is either of the following forms:
|
||||||
// autoTester.addStepSnapshot("Take snapshot"...
|
// autoTester.addStepSnapshot("Take snapshot"...
|
||||||
// autoTester.addStep("Clean up after test"...
|
// autoTester.addStep("Clean up after test"...
|
||||||
|
@ -514,18 +520,27 @@ ExtractedText Test::getTestScriptLines(QString testFileName) {
|
||||||
if (lineContainingTitle.match(line).hasMatch()) {
|
if (lineContainingTitle.match(line).hasMatch()) {
|
||||||
QStringList tokens = line.split('"');
|
QStringList tokens = line.split('"');
|
||||||
relevantTextFromTest.title = tokens[1];
|
relevantTextFromTest.title = tokens[1];
|
||||||
|
|
||||||
} else if (lineAssertPlatform.match(line).hasMatch()) {
|
} else if (lineAssertPlatform.match(line).hasMatch()) {
|
||||||
QStringList platforms = line.split('"');
|
QStringList platforms = line.split('"');
|
||||||
relevantTextFromTest.platform = platforms[1];
|
relevantTextFromTest.platform = platforms[1];
|
||||||
|
|
||||||
} else if (lineAssertDisplay.match(line).hasMatch()) {
|
} else if (lineAssertDisplay.match(line).hasMatch()) {
|
||||||
QStringList displays = line.split('"');
|
QStringList displays = line.split('"');
|
||||||
relevantTextFromTest.display = displays[1];
|
relevantTextFromTest.display = displays[1];
|
||||||
|
|
||||||
} else if (lineAssertCPU.match(line).hasMatch()) {
|
} else if (lineAssertCPU.match(line).hasMatch()) {
|
||||||
QStringList cpus = line.split('"');
|
QStringList cpus = line.split('"');
|
||||||
relevantTextFromTest.cpu = cpus[1];
|
relevantTextFromTest.cpu = cpus[1];
|
||||||
|
|
||||||
} else if (lineAssertGPU.match(line).hasMatch()) {
|
} else if (lineAssertGPU.match(line).hasMatch()) {
|
||||||
QStringList gpus = line.split('"');
|
QStringList gpus = line.split('"');
|
||||||
relevantTextFromTest.gpu = gpus[1];
|
relevantTextFromTest.gpu = gpus[1];
|
||||||
|
|
||||||
|
} else if (lineAssertPhysicalMemoryGB.match(line).hasMatch()) {
|
||||||
|
QStringList physicalMemoryGB = line.split('"');
|
||||||
|
relevantTextFromTest.physicalMemoryGB = physicalMemoryGB[1];
|
||||||
|
|
||||||
} else if (lineStepSnapshot.match(line).hasMatch()) {
|
} else if (lineStepSnapshot.match(line).hasMatch()) {
|
||||||
QStringList tokens = line.split('"');
|
QStringList tokens = line.split('"');
|
||||||
QString nameOfStep = tokens[1];
|
QString nameOfStep = tokens[1];
|
||||||
|
@ -534,6 +549,7 @@ ExtractedText Test::getTestScriptLines(QString testFileName) {
|
||||||
step->text = nameOfStep;
|
step->text = nameOfStep;
|
||||||
step->takeSnapshot = true;
|
step->takeSnapshot = true;
|
||||||
relevantTextFromTest.stepList.emplace_back(step);
|
relevantTextFromTest.stepList.emplace_back(step);
|
||||||
|
|
||||||
} else if (lineStep.match(line).hasMatch()) {
|
} else if (lineStep.match(line).hasMatch()) {
|
||||||
QStringList tokens = line.split('"');
|
QStringList tokens = line.split('"');
|
||||||
QString nameOfStep = tokens[1];
|
QString nameOfStep = tokens[1];
|
||||||
|
@ -630,62 +646,74 @@ void Test::createMDFile(QString testDirectory) {
|
||||||
|
|
||||||
// Platform
|
// Platform
|
||||||
QStringList platforms = testScriptLines.platform.split(" ");;
|
QStringList platforms = testScriptLines.platform.split(" ");;
|
||||||
stream << "## Platforms\n";
|
if (platforms.size() > 0) {
|
||||||
stream << "Run the test on each of the following platforms\n";
|
stream << "## Platforms\n";
|
||||||
for (int i = 0; i < platforms.size(); ++i) {
|
stream << "Run the test on each of the following platforms\n";
|
||||||
// Note that the platforms parameter may include extra spaces, these appear as empty strings in the list
|
for (int i = 0; i < platforms.size(); ++i) {
|
||||||
if (platforms[i] != QString()) {
|
// Note that the platforms parameter may include extra spaces, these appear as empty strings in the list
|
||||||
stream << " - " << platforms[i] << "\n";
|
if (platforms[i] != QString()) {
|
||||||
|
stream << " - " << platforms[i] << "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display
|
// Display
|
||||||
QStringList displays = testScriptLines.display.split(" ");
|
QStringList displays = testScriptLines.display.split(" ");
|
||||||
stream << "## Displays\n";
|
if (displays.size()) {
|
||||||
stream << "Run the test on each of the following displays\n";
|
stream << "## Displays\n";
|
||||||
for (int i = 0; i < displays.size(); ++i) {
|
stream << "Run the test on each of the following displays\n";
|
||||||
// Note that the displays parameter may include extra spaces, these appear as empty strings in the list
|
for (int i = 0; i < displays.size(); ++i) {
|
||||||
if (displays[i] != QString()) {
|
// Note that the displays parameter may include extra spaces, these appear as empty strings in the list
|
||||||
stream << " - " << displays[i] << "\n";
|
if (displays[i] != QString()) {
|
||||||
|
stream << " - " << displays[i] << "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CPU
|
// CPU
|
||||||
QStringList cpus = testScriptLines.cpu.split(" ");
|
QStringList cpus = testScriptLines.cpu.split(" ");
|
||||||
stream << "## Processors\n";
|
if (cpus.size() > 0) {
|
||||||
stream << "Run the test on each of the following processors\n";
|
stream << "## Processors\n";
|
||||||
for (int i = 0; i < cpus.size(); ++i) {
|
stream << "Run the test on each of the following processors\n";
|
||||||
// Note that the cpus parameter may include extra spaces, these appear as empty strings in the list
|
for (int i = 0; i < cpus.size(); ++i) {
|
||||||
if (cpus[i] != QString()) {
|
// Note that the cpus parameter may include extra spaces, these appear as empty strings in the list
|
||||||
stream << " - " << cpus[i] << "\n";
|
if (cpus[i] != QString()) {
|
||||||
|
stream << " - " << cpus[i] << "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GPU
|
// GPU
|
||||||
QStringList gpus = testScriptLines.gpu.split(" ");
|
QStringList gpus = testScriptLines.gpu.split(" ");
|
||||||
stream << "## Graphics Cards\n";
|
if (gpus.size() > 0) {
|
||||||
stream << "Run the test on graphics cards from each of the following vendors\n";
|
stream << "## Graphics Cards\n";
|
||||||
for (int i = 0; i < gpus.size(); ++i) {
|
stream << "Run the test on graphics cards from each of the following vendors\n";
|
||||||
// Note that the gpus parameter may include extra spaces, these appear as empty strings in the list
|
for (int i = 0; i < gpus.size(); ++i) {
|
||||||
if (gpus[i] != QString()) {
|
// Note that the gpus parameter may include extra spaces, these appear as empty strings in the list
|
||||||
stream << " - " << gpus[i] << "\n";
|
if (gpus[i] != QString()) {
|
||||||
|
stream << " - " << gpus[i] << "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stream << "## Steps\n";
|
stream << "## Steps\n";
|
||||||
stream << "Press space bar to advance step by step\n\n";
|
stream << "Press space bar to advance step by step\n\n";
|
||||||
|
|
||||||
|
// Note that snapshots of step n are taken in step n+1
|
||||||
|
// (this implies that if the LAST step requests a snapshot then this will not work - caveat emptor)
|
||||||
int snapShotIndex { 0 };
|
int snapShotIndex { 0 };
|
||||||
for (size_t i = 0; i < testScriptLines.stepList.size(); ++i) {
|
for (size_t i = 0; i < testScriptLines.stepList.size(); ++i) {
|
||||||
stream << "### Step " << QString::number(i + 1) << "\n";
|
stream << "### Step " << QString::number(i + 1) << "\n";
|
||||||
stream << "- " << testScriptLines.stepList[i]->text << "\n";
|
stream << "- " << testScriptLines.stepList[i]->text << "\n";
|
||||||
if (testScriptLines.stepList[i]->takeSnapshot) {
|
if ((i + 1 < testScriptLines.stepList.size()) && testScriptLines.stepList[i + 1]->takeSnapshot) {
|
||||||
stream << "- .rightJustified(5, '0') << ".png)\n";
|
stream << "- .rightJustified(5, '0') << ".png)\n";
|
||||||
++snapShotIndex;
|
++snapShotIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mdFile.close();
|
mdFile.close();
|
||||||
|
|
||||||
|
messageBox.information(0, "Success", "Test MD file " + mdFilename + " has been created");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::createTestsOutline() {
|
void Test::createTestsOutline() {
|
||||||
|
|
|
@ -34,6 +34,8 @@ public:
|
||||||
QString display;
|
QString display;
|
||||||
QString cpu;
|
QString cpu;
|
||||||
QString gpu;
|
QString gpu;
|
||||||
|
QString physicalMemoryGB;
|
||||||
|
|
||||||
StepList stepList;
|
StepList stepList;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
//
|
//
|
||||||
#include "AutoTester.h"
|
#include "AutoTester.h"
|
||||||
|
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
AutoTester::AutoTester(QWidget *parent) : QMainWindow(parent) {
|
AutoTester::AutoTester(QWidget *parent) : QMainWindow(parent) {
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
ui.checkBoxInteractiveMode->setChecked(true);
|
ui.checkBoxInteractiveMode->setChecked(true);
|
||||||
|
@ -18,6 +20,9 @@ AutoTester::AutoTester(QWidget *parent) : QMainWindow(parent) {
|
||||||
test = new Test();
|
test = new Test();
|
||||||
|
|
||||||
signalMapper = new QSignalMapper();
|
signalMapper = new QSignalMapper();
|
||||||
|
|
||||||
|
connect(ui.actionClose, &QAction::triggered, this, &AutoTester::on_closeButton_clicked);
|
||||||
|
connect(ui.actionAbout, &QAction::triggered, this, &AutoTester::about);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTester::on_evaluateTestsButton_clicked() {
|
void AutoTester::on_evaluateTestsButton_clicked() {
|
||||||
|
@ -100,3 +105,8 @@ void AutoTester::saveImage(int index) {
|
||||||
ui.progressBar->setValue(_numberOfImagesDownloaded);
|
ui.progressBar->setValue(_numberOfImagesDownloaded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AutoTester::about() {
|
||||||
|
QMessageBox messageBox;
|
||||||
|
messageBox.information(0, "About", QString("Built ") + __DATE__ + " : " + __TIME__);
|
||||||
|
}
|
|
@ -37,6 +37,8 @@ private slots:
|
||||||
|
|
||||||
void saveImage(int index);
|
void saveImage(int index);
|
||||||
|
|
||||||
|
void about();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AutoTesterClass ui;
|
Ui::AutoTesterClass ui;
|
||||||
Test* test;
|
Test* test;
|
||||||
|
|
|
@ -157,6 +157,20 @@
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<widget class="QMenu" name="menuFile">
|
||||||
|
<property name="title">
|
||||||
|
<string>File</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionClose"/>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuHelp">
|
||||||
|
<property name="title">
|
||||||
|
<string>Help</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionAbout"/>
|
||||||
|
</widget>
|
||||||
|
<addaction name="menuFile"/>
|
||||||
|
<addaction name="menuHelp"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QToolBar" name="mainToolBar">
|
<widget class="QToolBar" name="mainToolBar">
|
||||||
<attribute name="toolBarArea">
|
<attribute name="toolBarArea">
|
||||||
|
@ -167,6 +181,16 @@
|
||||||
</attribute>
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusBar"/>
|
<widget class="QStatusBar" name="statusBar"/>
|
||||||
|
<action name="actionClose">
|
||||||
|
<property name="text">
|
||||||
|
<string>Close</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionAbout">
|
||||||
|
<property name="text">
|
||||||
|
<string>About</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|
Loading…
Reference in a new issue