Commit f521c9f0 authored by Robert Loehning's avatar Robert Loehning Committed by Robert Löhning

Squish: Always use the same function for preparing templates

Change-Id: I90dac33dde4c0c3d39c8e8038371dfbb3403dce3
Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
parent 2aa4b803
......@@ -449,3 +449,9 @@ def __getSupportedPlatforms__(text, getAsStrings=False):
if getAsStrings:
result = QtQuickConstants.getTargetsAsStrings(result)
return result, version
# copy example project (sourceExample is path to project) to temporary directory inside repository
def prepareTemplate(sourceExample):
templateDir = os.path.abspath(tempDir() + "/template")
shutil.copytree(sourceExample, templateDir)
return templateDir
......@@ -33,10 +33,3 @@ def checkSyntaxError(issuesView, expectedTextsArray, warnIfMoreIssues = True):
else:
return True
return False
# copy example project (sourceExample is path to project) to <temp>/template dir
def prepareTemplate(sourceExample):
templateDir = os.path.abspath(tempDir() + "/template")
shutil.copytree(sourceExample, templateDir)
return templateDir
......@@ -7,7 +7,7 @@ def main():
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection")
if not neededFilePresent(sourceExample):
return
prepareTemplate(sourceExample)
templateDir = prepareTemplate(sourceExample)
startApplication("qtcreator" + SettingsPath)
overrideInstallLazySignalHandler()
installLazySignalHandler(":frame.templateDescription_QTextBrowser",
......@@ -102,12 +102,6 @@ def main():
clickButton(waitForObject("{text='Cancel' type='QPushButton' unnamed='1' visible='1'}", 20000))
invokeMenuItem("File", "Exit")
def prepareTemplate(sourceExample):
global templateDir
templateDir = tempDir()
templateDir = os.path.abspath(templateDir + "/template")
shutil.copytree(sourceExample, templateDir)
def cleanup():
global templateDir
# waiting for a clean exit - for a full-remove of the temp directory
......
......@@ -14,7 +14,7 @@ def main():
addHelpDocumentationFromSDK()
# using a temporary directory won't mess up an eventually exisiting
workingDir = tempDir()
prepareTemplate(sourceExample)
templateDir = prepareTemplate(sourceExample)
prepareForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
installLazySignalHandler("{type='Core::FutureProgress' unnamed='1''}", "finished()", "__handleFutureProgress__")
createNewQtQuickApplication(workingDir, "untitled", templateDir + "/qml/focus.qml")
......@@ -26,12 +26,6 @@ def main():
test.log("Test finished")
invokeMenuItem("File", "Exit")
def prepareTemplate(sourceExample):
global templateDir
templateDir = tempDir()
templateDir = os.path.abspath(templateDir + "/template")
shutil.copytree(sourceExample, templateDir)
def testRenameId():
global searchFinished
test.log("Testing rename of id")
......
......@@ -11,7 +11,7 @@ def main():
startApplication("qtcreator" + SettingsPath)
# using a temporary directory won't mess up an eventually exisiting
workingDir = tempDir()
prepareTemplate(sourceExample)
templateDir = prepareTemplate(sourceExample)
projectName = createNewQtQuickApplication(workingDir, None, templateDir + "/qml/textselection.qml")
# wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
......@@ -50,12 +50,6 @@ def subprocessFunction():
test.log("Closing QmlApplicationViewer")
sendEvent("QCloseEvent", "{type='QmlApplicationViewer' unnamed='1' visible='1'}")
def prepareTemplate(sourceExample):
global templateDir
templateDir = tempDir()
templateDir = os.path.abspath(templateDir + "/template")
shutil.copytree(sourceExample, templateDir)
def cleanup():
global workingDir,templateDir
# waiting for a clean exit - for a full-remove of the temp 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