forked from qt-creator/qt-creator
Squish: Starting test cases only if needed files are present
Change-Id: I41a73ce1a4f0d0578cf59af5c69fc19f9ec11dd9 Reviewed-on: http://codereview.qt-project.org/5555 Reviewed-by: Bill King <bill.king@nokia.com> Reviewed-by: Christian Stenger <christian.stenger@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
This commit is contained in:
committed by
Robert Löhning
parent
6e1122ad4b
commit
692806bb8f
@@ -1,5 +1,11 @@
|
||||
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):
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
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)
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
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():
|
||||
|
||||
Reference in New Issue
Block a user