From 6c1067c2ecff37bd2372c50882069e23a0aacd04 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 18 Oct 2012 12:47:06 +0200 Subject: [PATCH] Squish: Copying project to tempDir in tst_basic_cpp_support Change-Id: I1788ff642486204beb22bf0a02400c50fbb7f3bf Reviewed-by: Christian Stenger --- .../tst_basic_cpp_support/test.py | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) 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 d4156c3632b..bf27d2c6ec5 100644 --- a/tests/system/suite_general/tst_basic_cpp_support/test.py +++ b/tests/system/suite_general/tst_basic_cpp_support/test.py @@ -1,15 +1,24 @@ source("../../shared/qtcreator.py") def main(): - if not neededFilePresent(srcPath + "/creator/tests/manual/cplusplus-tools/cplusplus-tools.pro"): + projectDir = os.path.join(srcPath, "creator", "tests", "manual", "cplusplus-tools") + proFileName = "cplusplus-tools.pro" + if not neededFilePresent(os.path.join(projectDir, proFileName)): return + # copy example project to temp directory + tempDir = prepareTemplate(projectDir) + if not tempDir: + return + # make sure the .user files are gone + proFile = os.path.join(tempDir, proFileName) + cleanUpUserFiles(proFile) startApplication("qtcreator" + SettingsPath) overrideInstallLazySignalHandler() installLazySignalHandler(":Qt Creator_CppEditor::Internal::CPPEditorWidget", "textChanged()", "__handleTextChanged__") prepareForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") - openQmakeProject(srcPath + "/creator/tests/manual/cplusplus-tools/cplusplus-tools.pro") + openQmakeProject(proFile) waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000) selectFromLocator("dummy.cpp") @@ -67,23 +76,7 @@ def main(): cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") __typeAndWaitForAction__(cppwindow, "") test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "Dummy::Dummy(int)") - invokeMenuItem("File", "Exit") - waitForCleanShutdown() - -def init(): - cleanup() - -def cleanup(): - # Make sure the .user files are gone - cleanUpUserFiles(srcPath + "/creator/tests/manual/cplusplus-tools/cplusplus-tools.pro") - - BuildPath = glob.glob(srcPath + "/qtcreator-build-*") - BuildPath += glob.glob(srcPath + "/projects-build-*") - - for dir in BuildPath: - if os.access(dir, os.F_OK): - shutil.rmtree(dir) def __handleTextChanged__(object): global textChanged