From 6b1b47d83c3ccf9712390fc330b7d96f62debeb3 Mon Sep 17 00:00:00 2001 From: Robert Loehning <robert.loehning@nokia.com> Date: Thu, 26 Jan 2012 22:46:25 +0100 Subject: [PATCH] Squish: Let CMake build in temporary directory Change-Id: Ib2cc65378b74f662652434dd1a65d845ee3fb741 Reviewed-by: Christian Stenger <christian.stenger@nokia.com> Reviewed-by: Bill King <bill.king@nokia.com> --- tests/system/shared/project.py | 4 +++- .../suite_general/tst_cmake_speedcrunch/test.py | 15 ++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 830ce8e6d44..074bbc02d04 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -16,9 +16,11 @@ def openQmakeProject(projectPath): selectFromCombo(":scrollArea.Create Build Configurations:_QComboBox", "For Each Qt Version One Debug And One Release") clickButton(waitForObject("{text~='(Finish|Done)' type='QPushButton'}")) -def openCmakeProject(projectPath): +def openCmakeProject(projectPath, buildDir): invokeMenuItem("File", "Open File or Project...") selectFromFileDialog(projectPath) + replaceEditorContent("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'" + "window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}", buildDir) clickButton(waitForObject(":CMake Wizard.Next_QPushButton", 20000)) generatorCombo = waitForObject(":Generator:_QComboBox") index = generatorCombo.findText("MinGW Generator (MinGW from SDK)") diff --git a/tests/system/suite_general/tst_cmake_speedcrunch/test.py b/tests/system/suite_general/tst_cmake_speedcrunch/test.py index 89aaa5cc0f4..4ab159102da 100644 --- a/tests/system/suite_general/tst_cmake_speedcrunch/test.py +++ b/tests/system/suite_general/tst_cmake_speedcrunch/test.py @@ -1,6 +1,7 @@ source("../../shared/qtcreator.py") SpeedCrunchPath = "" +BuildPath = tempDir() def main(): if (which("cmake") == None): @@ -14,7 +15,7 @@ def main(): startApplication("qtcreator" + SettingsPath) - result = openCmakeProject(SpeedCrunchPath) + result = openCmakeProject(SpeedCrunchPath, BuildPath) if not result: test.warning("Could not open/create cmake project - leaving test") invokeMenuItem("File", "Exit") @@ -45,15 +46,7 @@ def init(): cleanup() def cleanup(): + global BuildPath # Make sure the .user files are gone cleanUpUserFiles(SpeedCrunchPath) - - BuildPath = srcPath + "/creator-test-data/speedcrunch/src/qtcreator-build" - - if os.access(BuildPath, os.F_OK): - shutil.rmtree(BuildPath) - # added because creator uses this one for me - BuildPath = srcPath + "/creator-test-data/speedcrunch/qtcreator-build" - - if os.access(BuildPath, os.F_OK): - shutil.rmtree(BuildPath) + deleteDirIfExists(BuildPath) -- GitLab