Commit cc454d11 authored by Christian Stenger's avatar Christian Stenger

Squish: Improve cleanup on Win

Change-Id: If39af63b6b65cb09c351bef6158c8ae8b9837668
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent 132f0e2b
...@@ -61,6 +61,8 @@ def waitForCleanShutdown(timeOut=10): ...@@ -61,6 +61,8 @@ def waitForCleanShutdown(timeOut=10):
appCtxt = currentApplicationContext() appCtxt = currentApplicationContext()
shutdownDone = (str(appCtxt)=="") shutdownDone = (str(appCtxt)=="")
if platform.system() in ('Windows','Microsoft'): if platform.system() in ('Windows','Microsoft'):
# cleaning helper for running on the build machines
__checkForQmlViewer__()
endtime = datetime.utcnow() + timedelta(seconds=timeOut) endtime = datetime.utcnow() + timedelta(seconds=timeOut)
while not shutdownDone: while not shutdownDone:
# following work-around because os.kill() works for win not until python 2.7 # following work-around because os.kill() works for win not until python 2.7
...@@ -85,6 +87,19 @@ def waitForCleanShutdown(timeOut=10): ...@@ -85,6 +87,19 @@ def waitForCleanShutdown(timeOut=10):
if not shutdownDone and datetime.utcnow() > endtime: if not shutdownDone and datetime.utcnow() > endtime:
break break
def __checkForQmlViewer__():
tasks = subprocess.Popen("tasklist /FI \"IMAGENAME eq qmlviewer.exe\"", shell=True,
stdout=subprocess.PIPE)
output = tasks.communicate()[0]
tasks.stdout.close()
if "INFO: No tasks are running which match the specified criteria." in output:
return
else:
if subprocess.call("taskkill /F /FI \"IMAGENAME eq qmlviewer.exe\"", shell=True) == 0:
print "Killed still running qmlviewer"
else:
print "qmlviewer is still running - failed to kill it"
def __removeTestingDir__(): def __removeTestingDir__():
def __removeIt__(directory): def __removeIt__(directory):
deleteDirIfExists(directory) deleteDirIfExists(directory)
......
Markdown is supported
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