diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 3a58cf0aa5147304deead4f1dd969811e1b5c7eb..abcd0310d808055c734b198b4c002b1762710ed0 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -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): diff --git a/tests/system/suite_general/tst_basic_cpp_support/test.py b/tests/system/suite_general/tst_basic_cpp_support/test.py index 26061e05e4ae17f2d4be9c301d7723fbab8d71d6..87116d6c2aa0905a22f445f4828382bed384de8d 100644 --- a/tests/system/suite_general/tst_basic_cpp_support/test.py +++ b/tests/system/suite_general/tst_basic_cpp_support/test.py @@ -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) diff --git a/tests/system/suite_general/tst_build_speedcrunch/test.py b/tests/system/suite_general/tst_build_speedcrunch/test.py index 1ee7e6c8be66183ef8c6435724a8af0a9327f780..e57c6a124bf66cfee72a99fec7a85d0d8144a392 100644 --- a/tests/system/suite_general/tst_build_speedcrunch/test.py +++ b/tests/system/suite_general/tst_build_speedcrunch/test.py @@ -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) diff --git a/tests/system/suite_general/tst_cmake_speedcrunch/test.py b/tests/system/suite_general/tst_cmake_speedcrunch/test.py index 57c40ddb64b5c6c57317eb9a19a225c8b484d920..bd94315a9683f35292b0f4181d33d8dd450b38eb 100644 --- a/tests/system/suite_general/tst_cmake_speedcrunch/test.py +++ b/tests/system/suite_general/tst_cmake_speedcrunch/test.py @@ -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) diff --git a/tests/system/suite_general/tst_openqt_creator/test.py b/tests/system/suite_general/tst_openqt_creator/test.py index b880c44f827c46023c329d691bb83ae4529906cd..567cacc88e80eb0a73f2ebe05f56a049b5e477ec 100644 --- a/tests/system/suite_general/tst_openqt_creator/test.py +++ b/tests/system/suite_general/tst_openqt_creator/test.py @@ -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) diff --git a/tests/system/suite_qtquick/tst_qml_editor/test.py b/tests/system/suite_qtquick/tst_qml_editor/test.py index 488836b73b4e248fdc8c977ec081103effc3bbfd..939b72020f89e71d1cff799a90292712fa91df1c 100644 --- a/tests/system/suite_qtquick/tst_qml_editor/test.py +++ b/tests/system/suite_qtquick/tst_qml_editor/test.py @@ -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(): diff --git a/tests/system/suite_qtquick/tst_qtquick_creation2/test.py b/tests/system/suite_qtquick/tst_qtquick_creation2/test.py index 780fd0afcc3cf66b33e90ef5abe4b7eb52cf0130..87a9fcea0c5b643e31421d1a3bb58c5ced211053 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation2/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation2/test.py @@ -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():