2011-08-25 10:05:28 +02:00
|
|
|
import platform;
|
|
|
|
import shutil;
|
|
|
|
import os;
|
|
|
|
import glob;
|
2011-08-31 16:05:15 +02:00
|
|
|
import atexit;
|
2011-08-25 10:05:28 +02:00
|
|
|
|
|
|
|
SDKPath = ''
|
|
|
|
SettingsPath = ''
|
2011-08-31 16:05:15 +02:00
|
|
|
tmpSettingsDir = ''
|
2011-08-25 10:05:28 +02:00
|
|
|
testSettings.logScreenshotOnFail = True
|
|
|
|
|
2011-08-26 12:39:04 +02:00
|
|
|
source("../../shared/utils.py")
|
2011-08-31 16:05:15 +02:00
|
|
|
source("../../shared/build_utils.py")
|
2011-08-26 12:39:04 +02:00
|
|
|
source("../../shared/mainwin.py")
|
2011-08-25 10:05:28 +02:00
|
|
|
|
2011-08-31 16:05:15 +02:00
|
|
|
def removeTmpSettingsDir():
|
|
|
|
snooze(5)
|
|
|
|
deleteDirIfExists(os.path.dirname(tmpSettingsDir))
|
|
|
|
|
2011-08-25 10:05:28 +02:00
|
|
|
if platform.system() in ('Windows', 'Microsoft'):
|
|
|
|
SDKPath = "C:/QtSDK/src"
|
|
|
|
cwd = os.getcwd() # current dir is directory holding qtcreator.py
|
|
|
|
cwd+="/../../settings/windows"
|
|
|
|
else:
|
|
|
|
SDKPath = os.path.expanduser("~/QtSDK/src")
|
|
|
|
cwd = os.getcwd() # current dir is directory holding qtcreator.py
|
|
|
|
cwd+="/../../settings/unix"
|
2011-08-31 16:05:15 +02:00
|
|
|
|
|
|
|
cwd = os.path.abspath(cwd)
|
|
|
|
tmpSettingsDir = tempDir()
|
|
|
|
tmpSettingsDir = os.path.abspath(tmpSettingsDir+"/settings")
|
|
|
|
shutil.copytree(cwd, tmpSettingsDir)
|
|
|
|
# the following only doesn't work if the test ends in an exception
|
|
|
|
atexit.register(removeTmpSettingsDir)
|
|
|
|
SettingsPath = " -settingspath %s" % tmpSettingsDir
|