summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@nokia.com>2012-04-05 14:29:13 +0200
committerRobert Löhning <robert.loehning@nokia.com>2012-04-05 17:22:06 +0200
commitf521c9f0628fc89ddc41a1584d65369f9c07a2f3 (patch)
treed00bca3f83c12f00a03a45d2fb24e59a0fcc2142
parent2aa4b803a636751c9e97bd0c655a0c37bf921622 (diff)
downloadqt-creator-f521c9f0628fc89ddc41a1584d65369f9c07a2f3.tar.gz
Squish: Always use the same function for preparing templates
Change-Id: I90dac33dde4c0c3d39c8e8038371dfbb3403dce3 Reviewed-by: Christian Stenger <christian.stenger@nokia.com>
-rw-r--r--tests/system/shared/project.py6
-rwxr-xr-xtests/system/shared/suites_qtta.py7
-rw-r--r--tests/system/suite_general/tst_create_proj_wizard/test.py8
-rw-r--r--tests/system/suite_qtquick/tst_qml_editor/test.py8
-rw-r--r--tests/system/suite_qtquick/tst_qtquick_creation2/test.py8
5 files changed, 9 insertions, 28 deletions
diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py
index 6228a9b8f2..43f5c34d2b 100644
--- a/tests/system/shared/project.py
+++ b/tests/system/shared/project.py
@@ -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
diff --git a/tests/system/shared/suites_qtta.py b/tests/system/shared/suites_qtta.py
index c177e0132a..d435b154e7 100755
--- a/tests/system/shared/suites_qtta.py
+++ b/tests/system/shared/suites_qtta.py
@@ -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
-
diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py
index d62442138e..e600f3e7d4 100644
--- a/tests/system/suite_general/tst_create_proj_wizard/test.py
+++ b/tests/system/suite_general/tst_create_proj_wizard/test.py
@@ -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
diff --git a/tests/system/suite_qtquick/tst_qml_editor/test.py b/tests/system/suite_qtquick/tst_qml_editor/test.py
index 1b01c3fc00..38396f7e92 100644
--- a/tests/system/suite_qtquick/tst_qml_editor/test.py
+++ b/tests/system/suite_qtquick/tst_qml_editor/test.py
@@ -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")
diff --git a/tests/system/suite_qtquick/tst_qtquick_creation2/test.py b/tests/system/suite_qtquick/tst_qtquick_creation2/test.py
index c87cd78ddb..e590351fb5 100644
--- a/tests/system/suite_qtquick/tst_qtquick_creation2/test.py
+++ b/tests/system/suite_qtquick/tst_qtquick_creation2/test.py
@@ -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