mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 04:18:12 +02:00
Deal with no High Fidelity folder
This commit is contained in:
parent
e914b3ad66
commit
e9a1da832e
2 changed files with 13 additions and 15 deletions
|
@ -29,7 +29,7 @@ void TestRunner::run() {
|
||||||
|
|
||||||
// This will be restored at the end of the tests
|
// This will be restored at the end of the tests
|
||||||
saveExistingHighFidelityAppDataFolder();
|
saveExistingHighFidelityAppDataFolder();
|
||||||
|
|
||||||
// Download the latest High Fidelity installer
|
// Download the latest High Fidelity installer
|
||||||
QStringList urls;
|
QStringList urls;
|
||||||
urls << INSTALLER_URL;
|
urls << INSTALLER_URL;
|
||||||
|
@ -79,23 +79,22 @@ void TestRunner::saveExistingHighFidelityAppDataFolder() {
|
||||||
|
|
||||||
_appDataFolder = dataDirectory + "\\High Fidelity";
|
_appDataFolder = dataDirectory + "\\High Fidelity";
|
||||||
|
|
||||||
if (!_appDataFolder.exists()) {
|
if (_appDataFolder.exists()) {
|
||||||
QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__),
|
// The original folder is saved in a unique name
|
||||||
"The High Fidelity data folder was not found in " + dataDirectory);
|
_savedAppDataFolder = dataDirectory + "/" + UNIQUE_FOLDER_NAME;
|
||||||
exit(-1);
|
_appDataFolder.rename(_appDataFolder.path(), _savedAppDataFolder.path());
|
||||||
}
|
}
|
||||||
|
|
||||||
// The original folder is saved in a unique name
|
|
||||||
_savedAppDataFolder = dataDirectory + "/" + UNIQUE_FOLDER_NAME;
|
|
||||||
_appDataFolder.rename(_appDataFolder.path(), _savedAppDataFolder.path());
|
|
||||||
|
|
||||||
// Copy an "empty" AppData folder (i.e. no entities)
|
// Copy an "empty" AppData folder (i.e. no entities)
|
||||||
copyFolder(QDir::currentPath() + "/AppDataHighFidelity", _appDataFolder.path());
|
copyFolder(QDir::currentPath() + "/AppDataHighFidelity", _appDataFolder.path());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestRunner::restoreHighFidelityAppDataFolder() {
|
void TestRunner::restoreHighFidelityAppDataFolder() {
|
||||||
_appDataFolder.removeRecursively();
|
_appDataFolder.removeRecursively();
|
||||||
_appDataFolder.rename(_savedAppDataFolder.path(), _appDataFolder.path());
|
|
||||||
|
if (_savedAppDataFolder != QDir()) {
|
||||||
|
_appDataFolder.rename(_savedAppDataFolder.path(), _appDataFolder.path());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestRunner::selectTemporaryFolder() {
|
void TestRunner::selectTemporaryFolder() {
|
||||||
|
@ -176,6 +175,10 @@ void TestRunner::evaluateResults() {
|
||||||
autoTester->startTestsEvaluation(false, true, _snapshotFolder, _branch, _user);
|
autoTester->startTestsEvaluation(false, true, _snapshotFolder, _branch, _user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestRunner::automaticTestRunEvaluationComplete() {
|
||||||
|
restoreHighFidelityAppDataFolder();
|
||||||
|
}
|
||||||
|
|
||||||
// Copies a folder recursively
|
// Copies a folder recursively
|
||||||
void TestRunner::copyFolder(const QString& source, const QString& destination) {
|
void TestRunner::copyFolder(const QString& source, const QString& destination) {
|
||||||
try {
|
try {
|
||||||
|
@ -207,7 +210,3 @@ void TestRunner::copyFolder(const QString& source, const QString& destination) {
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestRunner::automaticTestRunEvaluationComplete() {
|
|
||||||
restoreHighFidelityAppDataFolder();
|
|
||||||
}
|
|
||||||
|
|
|
@ -105,7 +105,6 @@ private:
|
||||||
|
|
||||||
HelpWindow _helpWindow;
|
HelpWindow _helpWindow;
|
||||||
|
|
||||||
|
|
||||||
void* _caller;
|
void* _caller;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue