From 189a799a3a1f8a672983b48b782a933683f00d36 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 7 Nov 2018 08:58:38 -0800 Subject: [PATCH] Added method to detect OS type. Needed for running automated tests. --- interface/src/scripting/TestScriptingInterface.cpp | 10 ++++++++++ interface/src/scripting/TestScriptingInterface.h | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/interface/src/scripting/TestScriptingInterface.cpp b/interface/src/scripting/TestScriptingInterface.cpp index c3aeb2643b..a9ba165037 100644 --- a/interface/src/scripting/TestScriptingInterface.cpp +++ b/interface/src/scripting/TestScriptingInterface.cpp @@ -199,3 +199,13 @@ void TestScriptingInterface::setOtherAvatarsReplicaCount(int count) { int TestScriptingInterface::getOtherAvatarsReplicaCount() { return qApp->getOtherAvatarsReplicaCount(); } + +QString TestScriptingInterface::getOperatingSystemType() { +#ifdef Q_OS_WIN + return "WINDOWS"; +#elif defined Q_OS_MAC + return "MACOS"; +#else + return "UNKNOWN"; +#endif +} diff --git a/interface/src/scripting/TestScriptingInterface.h b/interface/src/scripting/TestScriptingInterface.h index 4a1d1a3eeb..26e967c9b5 100644 --- a/interface/src/scripting/TestScriptingInterface.h +++ b/interface/src/scripting/TestScriptingInterface.h @@ -163,6 +163,13 @@ public slots: */ Q_INVOKABLE int getOtherAvatarsReplicaCount(); + /**jsdoc + * Returns the Operating Sytem type + * @function Test.getOperatingSystemType + * @returns {string} "WINDOWS", "MACOS" or "UNKNOWN" + */ + QString getOperatingSystemType(); + private: bool waitForCondition(qint64 maxWaitMs, std::function condition); QString _testResultsLocation;