From 4e716c0db5cc61ba6357f66c8ea6bb648d6304db Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 3 Feb 2022 08:52:11 +0100 Subject: Squish: Fix unknown global variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Amends 40caa8a4ba97ce7. Change-Id: I014210c2035fa0a69ca273718df726a523a23786 Reviewed-by: Robert Löhning --- tests/system/shared/qtcreator.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index f7ea2a2c609..4c9646ffb6d 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -39,6 +39,13 @@ try: except ImportError: import builtins as __builtin__ # Python 3 + +# ensure global variables are defined before including shared scripts +qt4Path = os.path.expanduser("~/Qt4.8.7") +if platform.system() in ('Windows', 'Microsoft'): + qt4Path = "C:\\Qt\\Qt4.8.7" + +qt4Available = os.path.exists(qt4Path) srcPath = '' SettingsPath = [] tmpSettingsDir = '' @@ -329,18 +336,14 @@ def copySettingsToTmpDir(destination=None, omitFiles=[]): # current dir is directory holding qtcreator.py origSettingsDir = os.path.abspath(os.path.join(os.getcwd(), "..", "..", "settings")) -qt4Path = os.path.expanduser("~/Qt4.8.7") if platform.system() in ('Windows', 'Microsoft'): - qt4Path = "C:\\Qt\\Qt4.8.7" origSettingsDir = os.path.join(origSettingsDir, "windows") elif platform.system() == 'Darwin': origSettingsDir = os.path.join(origSettingsDir, "mac") else: origSettingsDir = os.path.join(origSettingsDir, "unix") -qt4Available = os.path.exists(qt4Path) - srcPath = os.getenv("SYSTEST_SRCPATH", os.path.expanduser(os.path.join("~", "squish-data"))) # the following only doesn't work if the test ends in an exception -- cgit v1.2.3