Commit 692806bb authored by Robert Loehning's avatar Robert Loehning Committed by Robert Löhning
Browse files

Squish: Starting test cases only if needed files are present

Change-Id: I41a73ce1a4f0d0578cf59af5c69fc19f9ec11dd9
Reviewed-on: http://codereview.qt-project.org/5555

Reviewed-by: default avatarBill King <bill.king@nokia.com>
Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
parent 6e1122ad
import tempfile, shutil, os
def neededFilePresent(path):
found = os.path.exists(path)
if not found:
test.fatal("Missing file or directory: " + path)
return found
def tempDir():
Result = os.path.abspath(os.getcwd()+"/../../testing")
if not os.path.exists(Result):
......
source("../../shared/qtcreator.py")
def main():
test.verify(os.path.exists(srcPath + "/creator/tests/manual/cplusplus-tools/cplusplus-tools.pro"))
if not neededFilePresent(srcPath + "/creator/tests/manual/cplusplus-tools/cplusplus-tools.pro"):
return
startApplication("qtcreator" + SettingsPath)
......
......@@ -4,7 +4,8 @@ import re;
SpeedCrunchPath = ""
def main():
test.verify(os.path.exists(SpeedCrunchPath))
if not neededFilePresent(SpeedCrunchPath):
return
startApplication("qtcreator" + SettingsPath)
openQmakeProject(SpeedCrunchPath)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 30000)
......
......@@ -6,8 +6,8 @@ def main():
if(which("cmake") == None):
test.fatal("cmake not found")
return
test.verify(os.path.exists(SpeedCrunchPath))
if not neededFilePresent(SpeedCrunchPath):
return
startApplication("qtcreator" + SettingsPath)
......
source("../../shared/qtcreator.py")
def main():
test.verify(os.path.exists(srcPath + "/creator/qtcreator.pro"))
test.verify(os.path.exists(srcPath + "/creator-test-data/speedcrunch/src/speedcrunch.pro"))
pathCreator = srcPath + "/creator/qtcreator.pro"
pathSpeedcrunch = srcPath + "/creator-test-data/speedcrunch/src/speedcrunch.pro"
if not neededFilePresent(pathCreator) or not neededFilePresent(pathSpeedcrunch):
return
startApplication("qtcreator" + SettingsPath)
openQmakeProject(srcPath + "/creator/qtcreator.pro")
openQmakeProject(srcPath + "/creator-test-data/speedcrunch/src/speedcrunch.pro")
openQmakeProject(pathCreator)
openQmakeProject(pathSpeedcrunch)
# Wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 30000)
......
......@@ -5,10 +5,13 @@ templateDir = None
def main():
global workingDir,templateDir
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/keyinteraction/focus")
if not neededFilePresent(sourceExample):
return
startApplication("qtcreator" + SettingsPath)
# using a temporary directory won't mess up an eventually exisiting
workingDir = tempDir()
prepareTemplate()
prepareTemplate(sourceExample)
createNewQtQuickApplication()
# wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 30000)
......@@ -16,11 +19,10 @@ def main():
invokeMenuItem("File", "Exit")
def prepareTemplate():
def prepareTemplate(sourceExample):
global templateDir
templateDir = tempDir()
templateDir = os.path.abspath(templateDir + "/template")
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/keyinteraction/focus")
shutil.copytree(sourceExample, templateDir)
def createNewQtQuickApplication():
......
......@@ -5,10 +5,13 @@ templateDir = None
def main():
global workingDir,templateDir
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection")
if not neededFilePresent(sourceExample):
return
startApplication("qtcreator" + SettingsPath)
# using a temporary directory won't mess up an eventually exisiting
workingDir = tempDir()
prepareTemplate()
prepareTemplate(sourceExample)
createNewQtQuickApplication()
# wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 30000)
......@@ -22,11 +25,10 @@ def main():
logApplicationOutput()
invokeMenuItem("File", "Exit")
def prepareTemplate():
def prepareTemplate(sourceExample):
global templateDir
templateDir = tempDir()
templateDir = os.path.abspath(templateDir + "/template")
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection")
shutil.copytree(sourceExample, templateDir)
def createNewQtQuickApplication():
......
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