diff options
author | Christian Stenger <christian.stenger@digia.com> | 2013-03-05 10:50:36 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@digia.com> | 2013-03-06 14:13:04 +0100 |
commit | cc454d11fca814310c5f1a0aaf582253ffd4532a (patch) | |
tree | 4ce0d86a09a480f4337cc8d6135d11c7d27e95c3 | |
parent | 132f0e2bf3f2e6faff7be1ccce0709cd72a4ebc0 (diff) |
Squish: Improve cleanup on Win
Change-Id: If39af63b6b65cb09c351bef6158c8ae8b9837668
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
-rw-r--r-- | tests/system/shared/qtcreator.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index f992c2dd1f..215129dede 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -61,6 +61,8 @@ def waitForCleanShutdown(timeOut=10): appCtxt = currentApplicationContext() shutdownDone = (str(appCtxt)=="") if platform.system() in ('Windows','Microsoft'): + # cleaning helper for running on the build machines + __checkForQmlViewer__() endtime = datetime.utcnow() + timedelta(seconds=timeOut) while not shutdownDone: # following work-around because os.kill() works for win not until python 2.7 @@ -85,6 +87,19 @@ def waitForCleanShutdown(timeOut=10): if not shutdownDone and datetime.utcnow() > endtime: 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 __removeIt__(directory): deleteDirIfExists(directory) |