History

Don't display crash message if running from command line with a test script.

NissimHadar committed 8 years ago

Commit 46f461d1 parent 8b3c4511 file · +20 −4Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

interface/src/Application.cpp+20−4
@@ -743,6 +743,9 @@ extern DisplayPluginList getDisplayPlugins(); · 742 unmodified lines
743extern InputPluginList getInputPlugins();743extern InputPluginList getInputPlugins();
744extern void saveInputPluginSettings(const InputPluginList& plugins);744extern void saveInputPluginSettings(const InputPluginList& plugins);
745 745
746const QString TEST_SCRIPT { "--testScript" };
747const QString TEST_SNAPSHOT_LOCATION { "--testSnapshotLocation" };
748
746bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) {749bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) {
747 const char** constArgv = const_cast<const char**>(argv);750 const char** constArgv = const_cast<const char**>(argv);
748 751
@@ -777,7 +780,22 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 28 unmodified lines
777 780
778 static const auto SUPPRESS_SETTINGS_RESET = "--suppress-settings-reset";781 static const auto SUPPRESS_SETTINGS_RESET = "--suppress-settings-reset";
779 bool suppressPrompt = cmdOptionExists(argc, const_cast<const char**>(argv), SUPPRESS_SETTINGS_RESET);782 bool suppressPrompt = cmdOptionExists(argc, const_cast<const char**>(argv), SUPPRESS_SETTINGS_RESET);
780 bool previousSessionCrashed = CrashHandler::checkForResetSettings(runningMarkerExisted, suppressPrompt);783
784 // Ignore any previous crashes if running from command line with a test script.
785 bool inTestMode { false };
786 for (int i = 0; i < argc; ++i) {
787 QString parameter(argv[i]);
788 if (parameter == TEST_SCRIPT) {
789 inTestMode = true;
790 break;
791 }
792 }
793
794 bool previousSessionCrashed { false };
795 if (!inTestMode) {
796 previousSessionCrashed = CrashHandler::checkForResetSettings(runningMarkerExisted, suppressPrompt);
797 }
798
781 // get dir to use for cache799 // get dir to use for cache
782 static const auto CACHE_SWITCH = "--cache";800 static const auto CACHE_SWITCH = "--cache";
783 QString cacheDir = getCmdOption(argc, const_cast<const char**>(argv), CACHE_SWITCH);801 QString cacheDir = getCmdOption(argc, const_cast<const char**>(argv), CACHE_SWITCH);
@@ -997,10 +1015,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 213 unmodified lines
997 setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));1015 setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
998 setProperty(hifi::properties::CRASHED, _previousSessionCrashed);1016 setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
999 {1017 {
1000 const QString TEST_SCRIPT { "--testScript" };
1001 const QString TEST_SNAPSHOT_LOCATION { "--testSnapshotLocation" };
1002
1003 const QStringList args = arguments();1018 const QStringList args = arguments();
1019
1004 for (int i = 0; i < args.size() - 1; ++i) {1020 for (int i = 0; i < args.size() - 1; ++i) {
1005 if (args.at(i) == TEST_SCRIPT) {1021 if (args.at(i) == TEST_SCRIPT) {
1006 QString testScriptPath = args.at(i + 1);1022 QString testScriptPath = args.at(i + 1);