Commit 352f6d6c authored by Christian Stenger's avatar Christian Stenger
Browse files

Squish: Provide overrideStartApplication()



Change-Id: I384d37f9c65b76c299220dea436e45ff58ba0333
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent 4d5c95e1
...@@ -14,6 +14,7 @@ SettingsPath = '' ...@@ -14,6 +14,7 @@ SettingsPath = ''
tmpSettingsDir = '' tmpSettingsDir = ''
testSettings.logScreenshotOnFail = True testSettings.logScreenshotOnFail = True
testSettings.logScreenshotOnError = True testSettings.logScreenshotOnError = True
__origStartApplication__ = None
source("../../shared/classes.py") source("../../shared/classes.py")
source("../../shared/utils.py") source("../../shared/utils.py")
...@@ -26,15 +27,20 @@ source("../../shared/hook_utils.py") ...@@ -26,15 +27,20 @@ source("../../shared/hook_utils.py")
source("../../shared/debugger.py") source("../../shared/debugger.py")
source("../../shared/workarounds.py") source("../../shared/workarounds.py")
if platform.system() == "Darwin": # ATTENTION: if a test case calls startApplication("qtcreator...") for several times this
# function must be called BEFORE any call except the first (which is done always automatically)
def overrideStartApplication():
global startApplication, __origStartApplication__
if (platform.system() != "Darwin"):
return
if (__origStartApplication__ == None):
__origStartApplication__ = startApplication __origStartApplication__ = startApplication
def startApplication(*args): def startApplication(*args):
args = list(args) args = list(args)
if str(args[0]).startswith('qtcreator'): if str(args[0]).startswith('qtcreator'):
args[0] = args[0].replace('qtcreator', '"Qt Creator"', 1) args[0] = args[0].replace('qtcreator', '"Qt Creator"', 1)
__origStartApplication__(*args)
test.log("Using workaround for MacOS (different AUT name)") test.log("Using workaround for MacOS (different AUT name)")
return __origStartApplication__(*args)
def waitForCleanShutdown(timeOut=10): def waitForCleanShutdown(timeOut=10):
appCtxt = currentApplicationContext() appCtxt = currentApplicationContext()
...@@ -167,6 +173,8 @@ else: ...@@ -167,6 +173,8 @@ else:
defaultQtVersion = "Desktop Qt 4.7.4 for GCC (Qt SDK)" defaultQtVersion = "Desktop Qt 4.7.4 for GCC (Qt SDK)"
srcPath = os.getenv("SYSTEST_SRCPATH", sdkPath + "/src") srcPath = os.getenv("SYSTEST_SRCPATH", sdkPath + "/src")
overrideStartApplication()
# the following only doesn't work if the test ends in an exception # the following only doesn't work if the test ends in an exception
if os.getenv("SYSTEST_NOSETTINGSPATH") != "1": if os.getenv("SYSTEST_NOSETTINGSPATH") != "1":
cwd = os.path.abspath(cwd) cwd = os.path.abspath(cwd)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment