Squish: Improved checks before working on projects

Change-Id: Ieb230be55b94d00be272cb84796ce8fd22f4f8f7
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
Robert Loehning
2012-09-27 15:05:38 +02:00
parent a5b2d8f5c0
commit 832bc738c7
8 changed files with 24 additions and 16 deletions

View File

@@ -5,11 +5,12 @@ source("../../shared/qtcreator.py")
def main(): def main():
# prepare example project # prepare example project
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation") sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation")
if not neededFilePresent(sourceExample): proFile = "propertyanimation.pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):
return return
# copy example project to temp directory # copy example project to temp directory
templateDir = prepareTemplate(sourceExample) templateDir = prepareTemplate(sourceExample)
examplePath = templateDir + "/propertyanimation.pro" examplePath = os.path.join(templateDir, proFile)
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
# open example project # open example project
openQmakeProject(examplePath) openQmakeProject(examplePath)

View File

@@ -5,11 +5,12 @@ source("../../shared/qtcreator.py")
def main(): def main():
# prepare example project # prepare example project
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation") sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation")
if not neededFilePresent(sourceExample): proFile = "propertyanimation.pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):
return return
# copy example project to temp directory # copy example project to temp directory
templateDir = prepareTemplate(sourceExample) templateDir = prepareTemplate(sourceExample)
examplePath = templateDir + "/propertyanimation.pro" examplePath = os.path.join(templateDir, proFile)
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
# open example project # open example project
openQmakeProject(examplePath) openQmakeProject(examplePath)

View File

@@ -6,11 +6,12 @@ def main():
global searchFinished global searchFinished
# prepare example project # prepare example project
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation") sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation")
if not neededFilePresent(sourceExample): proFile = "propertyanimation.pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):
return return
# copy example project to temp directory # copy example project to temp directory
templateDir = prepareTemplate(sourceExample) templateDir = prepareTemplate(sourceExample)
examplePath = templateDir + "/propertyanimation.pro" examplePath = os.path.join(templateDir, proFile)
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
# open example project # open example project
openQmakeProject(examplePath) openQmakeProject(examplePath)

View File

@@ -5,11 +5,12 @@ source("../../shared/qtcreator.py")
def main(): def main():
# prepare example project # prepare example project
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation") sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation")
if not neededFilePresent(sourceExample): proFile = "propertyanimation.pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):
return return
# copy example project to temp directory # copy example project to temp directory
templateDir = prepareTemplate(sourceExample) templateDir = prepareTemplate(sourceExample)
examplePath = templateDir + "/propertyanimation.pro" examplePath = os.path.join(templateDir, proFile)
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
# open example project # open example project
openQmakeProject(examplePath) openQmakeProject(examplePath)

View File

@@ -42,11 +42,12 @@ def checkUsages(resultsView, expectedResults):
def main(): def main():
# prepare example project # prepare example project
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation") sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/animation/basics/property-animation")
if not neededFilePresent(sourceExample): proFile = "propertyanimation.pro"
if not neededFilePresent(os.path.join(sourceExample, proFile)):
return return
# copy example project to temp directory # copy example project to temp directory
templateDir = prepareTemplate(sourceExample) templateDir = prepareTemplate(sourceExample)
examplePath = templateDir + "/propertyanimation.pro" examplePath = os.path.join(templateDir, proFile)
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
# open example project # open example project
openQmakeProject(examplePath) openQmakeProject(examplePath)

View File

@@ -5,7 +5,8 @@ import re
def main(): def main():
global templateDir, textChanged global templateDir, textChanged
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection") sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection")
if not neededFilePresent(sourceExample): qmlFile = os.path.join("qml", "textselection.qml")
if not neededFilePresent(os.path.join(sourceExample, qmlFile)):
return return
templateDir = prepareTemplate(sourceExample) templateDir = prepareTemplate(sourceExample)
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
@@ -65,7 +66,7 @@ def main():
try: try:
waitForObject("{text='Select Existing QML file' type='QLabel' visible='1'}", 1000) waitForObject("{text='Select Existing QML file' type='QLabel' visible='1'}", 1000)
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000) baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
type(baseLineEd, templateDir + "/qml/textselection.qml") type(baseLineEd, os.path.join(templateDir, qmlFile))
clickButton(waitForObject(":Next_QPushButton")) clickButton(waitForObject(":Next_QPushButton"))
except LookupError: except LookupError:
pass pass

View File

@@ -7,7 +7,8 @@ searchFinished = False
def main(): def main():
global workingDir,templateDir global workingDir,templateDir
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/keyinteraction/focus") sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/keyinteraction/focus")
if not neededFilePresent(sourceExample): qmlFile = os.path.join("qml", "focus.qml")
if not neededFilePresent(os.path.join(sourceExample, qmlFile)):
return return
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
# add docs to have the correct tool tips # add docs to have the correct tool tips
@@ -17,7 +18,7 @@ def main():
templateDir = prepareTemplate(sourceExample) templateDir = prepareTemplate(sourceExample)
prepareForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") prepareForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
installLazySignalHandler("{type='Core::FutureProgress' unnamed='1'}", "finished()", "__handleFutureProgress__") installLazySignalHandler("{type='Core::FutureProgress' unnamed='1'}", "finished()", "__handleFutureProgress__")
createNewQtQuickApplication(workingDir, "untitled", templateDir + "/qml/focus.qml") createNewQtQuickApplication(workingDir, "untitled", os.path.join(templateDir, qmlFile))
# wait for parsing to complete # wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
testRenameId() testRenameId()

View File

@@ -6,13 +6,14 @@ templateDir = None
def main(): def main():
global workingDir,templateDir global workingDir,templateDir
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection") sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection")
if not neededFilePresent(sourceExample): qmlFile = os.path.join("qml", "textselection.qml")
if not neededFilePresent(os.path.join(sourceExample, qmlFile)):
return return
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
# using a temporary directory won't mess up an eventually exisiting # using a temporary directory won't mess up an eventually exisiting
workingDir = tempDir() workingDir = tempDir()
templateDir = prepareTemplate(sourceExample) templateDir = prepareTemplate(sourceExample)
projectName = createNewQtQuickApplication(workingDir, None, templateDir + "/qml/textselection.qml") projectName = createNewQtQuickApplication(workingDir, None, os.path.join(templateDir, qmlFile))
# wait for parsing to complete # wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
test.log("Building project") test.log("Building project")