mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
WIP - recursive tests.
This commit is contained in:
parent
730dce31e3
commit
b81f69d97a
5 changed files with 30 additions and 10 deletions
|
@ -319,11 +319,12 @@ void Test::createRecursiveScript() {
|
|||
return;
|
||||
}
|
||||
|
||||
QFile allTestsFilename(topLevelDirectory + "/" + "allTests.js");
|
||||
const QString recursiveTestsFilename("testRecursive.js");
|
||||
QFile allTestsFilename(topLevelDirectory + "/" + recursiveTestsFilename);
|
||||
if (!allTestsFilename.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
messageBox.critical(0,
|
||||
"Internal Error",
|
||||
"Failed to create \"allTests.js\" in directory \"" + topLevelDirectory + "\""
|
||||
"Failed to create \"" + recursiveTestsFilename + "\" in directory \"" + topLevelDirectory + "\""
|
||||
);
|
||||
|
||||
exit(-1);
|
||||
|
@ -335,9 +336,6 @@ void Test::createRecursiveScript() {
|
|||
textStream << "var autoTester = Script.require(\"https://github.com/highfidelity/hifi_tests/blob/master/tests/utils/autoTester.js?raw=true\");" << endl;
|
||||
textStream << "autoTester.enableRecursive();" << endl << endl;
|
||||
|
||||
// The main will call each test after the previous test is completed
|
||||
// This is implemented with an interval timer that periodically tests if a
|
||||
// running test has increment a testNumber variable that it received as an input.
|
||||
QVector<QString> testPathnames;
|
||||
|
||||
// First test if top-level folder has a test.js file
|
||||
|
@ -371,7 +369,7 @@ void Test::createRecursiveScript() {
|
|||
}
|
||||
|
||||
if (testPathnames.length() <= 0) {
|
||||
messageBox.information(0, "Failure", "No \"test.js\" files found");
|
||||
messageBox.information(0, "Failure", "No \"" + TEST_FILENAME + "\" files found");
|
||||
allTestsFilename.close();
|
||||
return;
|
||||
}
|
||||
|
@ -383,6 +381,9 @@ void Test::createRecursiveScript() {
|
|||
messageBox.information(0, "Success", "Script has been created");
|
||||
}
|
||||
|
||||
void Test::createRecursiveScriptsRecursively() {
|
||||
}
|
||||
|
||||
void Test::createTest() {
|
||||
// Rename files sequentially, as ExpectedResult_1.jpeg, ExpectedResult_2.jpg and so on
|
||||
// Any existing expected result images will be deleted
|
||||
|
|
|
@ -26,6 +26,7 @@ public:
|
|||
void evaluateTests(bool interactiveMode, QProgressBar* progressBar);
|
||||
void evaluateTestsRecursively(bool interactiveMode, QProgressBar* progressBar);
|
||||
void createRecursiveScript();
|
||||
void createRecursiveScriptsRecursively();
|
||||
void createTest();
|
||||
void deleteOldSnapshots();
|
||||
|
||||
|
|
|
@ -30,6 +30,10 @@ void AutoTester::on_createRecursiveScriptButton_clicked() {
|
|||
test.createRecursiveScript();
|
||||
}
|
||||
|
||||
void AutoTester::on_createRecursiveScriptsRecursivelyButton_clicked() {
|
||||
test.createRecursiveScriptsRecursively();
|
||||
}
|
||||
|
||||
void AutoTester::on_createTestButton_clicked() {
|
||||
test.createTest();
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ private slots:
|
|||
void on_evaluateTestsButton_clicked();
|
||||
void on_evaluateTestsRecursivelyButton_clicked();
|
||||
void on_createRecursiveScriptButton_clicked();
|
||||
void on_createRecursiveScriptsRecursivelyButton_clicked();
|
||||
void on_createTestButton_clicked();
|
||||
void on_deleteOldSnapshotsButton_clicked();
|
||||
void on_closeButton_clicked();
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<widget class="QPushButton" name="closeButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>190</x>
|
||||
<x>20</x>
|
||||
<y>300</y>
|
||||
<width>220</width>
|
||||
<height>40</height>
|
||||
|
@ -31,7 +31,7 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>360</x>
|
||||
<y>130</y>
|
||||
<y>210</y>
|
||||
<width>220</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
|
@ -112,7 +112,7 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>360</x>
|
||||
<y>240</y>
|
||||
<y>270</y>
|
||||
<width>220</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
|
@ -121,6 +121,19 @@
|
|||
<string>Delete Old Snapshots</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="createRecursiveScriptsRecursivelyButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>360</x>
|
||||
<y>140</y>
|
||||
<width>220</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create Recursive Scripts Recursively</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
|
@ -145,4 +158,4 @@
|
|||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
</ui>
|
||||
|
|
Loading…
Reference in a new issue