From 5e58da8ec10c18494dffb7a39e2a697a1bf59cee Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 30 Oct 2018 22:29:50 -0700 Subject: [PATCH] Interface runs, but AutoTester doesn't wait for completion. --- tools/auto-tester/src/TestRunner.cpp | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 315ac732e0..2bf304943b 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -20,7 +20,7 @@ extern AutoTester* autoTester; #include #include #endif - +#include TestRunner::TestRunner(std::vector dayCheckboxes, std::vector timeEditCheckboxes, std::vector timeEdits, @@ -247,11 +247,10 @@ void TestRunner::verifyInstallationSucceeded() { } void TestRunner::saveExistingHighFidelityAppDataFolder() { +#ifdef Q_OS_WIN QString dataDirectory{ "NOT FOUND" }; -#ifdef Q_OS_WIN dataDirectory = qgetenv("USERPROFILE") + "\\AppData\\Roaming"; -#endif if (_runLatest->isChecked()) { _appDataFolder = dataDirectory + "\\High Fidelity"; @@ -272,6 +271,9 @@ void TestRunner::saveExistingHighFidelityAppDataFolder() { // Copy an "empty" AppData folder (i.e. no entities) copyFolder(QDir::currentPath() + "/AppDataHighFidelity", _appDataFolder.path()); +#elif defined Q_OS_MAC + // TODO: find Mac equivalent of AppData +#endif } void TestRunner::createSnapshotFolder() { @@ -341,6 +343,13 @@ void TestRunner::killProcesses() { QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), "unknown error"); exit(-1); } +#elif defined Q_OS_MAC + // TODO: this doesn't allow interface to run + //QString commandLine = "killall interface\n"; + //system(commandLine.toStdString().c_str()); + + //commandLine = "killall Sandbox\n"; + //system(commandLine.toStdString().c_str()); #endif } @@ -370,7 +379,12 @@ void TestRunner::runInterfaceWithTestScript() { // Move to an empty area url = "file:///~serverless/tutorial.json"; } else { +#ifdef Q_OS_WIN url = "hifi://localhost"; +#elif defined Q_OS_MAC + // TODO: Find out Mac equivalent of AppData, then this win't be needed + url = "hifi://localhost/9999,9999,9999"; +#endif } QString testScript = @@ -381,7 +395,8 @@ void TestRunner::runInterfaceWithTestScript() { QString commandLine = exeFile + " --url " + url + " --no-updater" + " --testScript " + testScript + " quitWhenFinished --testResultsLocation " + _snapshotFolder; #elif defined Q_OS_MAC - QString commandLine = "open -a \"" +_installationFolder + "/interface.app\""; + QString commandLine = "open -a \"" +_installationFolder + "/interface.app\"" + " --args --url " + url + " --no-updater" + " --testScript " + testScript + + " quitWhenFinished --testResultsLocation " + _snapshotFolder; #endif // Helpful for debugging @@ -448,11 +463,15 @@ void TestRunner::addBuildNumberToResults(QString zippedFolderName) { } void TestRunner::restoreHighFidelityAppDataFolder() { +#ifdef Q_OS_WIN _appDataFolder.removeRecursively(); if (_savedAppDataFolder != QDir()) { _appDataFolder.rename(_savedAppDataFolder.path(), _appDataFolder.path()); } +#elif defined Q_OS_MAC + // TODO: find Mac equivalent of AppData +#endif } // Copies a folder recursively