summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-05-15 10:21:47 +0200
committerOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-05-15 10:21:47 +0200
commit6fb94a7b10216cb03544acfca1ea5e7e121dd50e (patch)
tree2e5aba50125b1bda1ccb1739b5a6c39336e6333a /tests
parentc6bee7e20eff2cefe3300d2d5a9fc23508402e98 (diff)
parent8ca5b55a0bafd744cf62c20de379a7738cb76138 (diff)
downloadqt-creator-6fb94a7b10216cb03544acfca1ea5e7e121dd50e.tar.gz
Merge branch '2.7'
Conflicts: doc/src/qtquick/qtquick-components.qdoc doc/src/qtquick/qtquick-designer.qdoc qtcreator.pri qtcreator.qbs src/plugins/cppeditor/cppinsertdecldef.cpp src/plugins/qnx/qnxruncontrolfactory.cpp Change-Id: I0a37a07c42719bc0d9ef5b3ac4641d01a63c0d88
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/cplusplus/cxx11/tst_cxx11.cpp2
-rw-r--r--tests/system/objects.map2
-rw-r--r--tests/system/shared/editor_utils.py2
-rw-r--r--tests/system/shared/hook_utils.py26
-rwxr-xr-xtests/system/suite_APTW/shared/aptw.py2
-rw-r--r--tests/system/suite_CSUP/tst_CSUP04/test.py4
-rwxr-xr-xtests/system/suite_HELP/tst_HELP02/test.py4
-rw-r--r--tests/system/suite_editors/tst_select_all/test.py9
8 files changed, 25 insertions, 26 deletions
diff --git a/tests/auto/cplusplus/cxx11/tst_cxx11.cpp b/tests/auto/cplusplus/cxx11/tst_cxx11.cpp
index 1b1cea4248..c5cfa25eb4 100644
--- a/tests/auto/cplusplus/cxx11/tst_cxx11.cpp
+++ b/tests/auto/cplusplus/cxx11/tst_cxx11.cpp
@@ -175,7 +175,7 @@ void tst_cxx11::inlineNamespaceLookup()
snapshot.insert(doc);
LookupContext context(doc, snapshot);
- QSharedPointer<Control> control = context.control();
+ QSharedPointer<Control> control = context.bindings()->control();
QList<LookupItem> results = context.lookup(control->identifier("foo"), doc->globalNamespace());
QCOMPARE(results.size(), 1); // the symbol is visible from the global scope
diff --git a/tests/system/objects.map b/tests/system/objects.map
index bc2f72ae0d..8ce37d2302 100644
--- a/tests/system/objects.map
+++ b/tests/system/objects.map
@@ -138,6 +138,8 @@
:Restart required_QMessageBox {text='The language change will take effect after a restart of Qt Creator.' type='QMessageBox' unnamed='1' visible='1'}
:Revert to Saved.Proceed_QPushButton {text='Proceed' type='QPushButton' unnamed='1' visible='1' window=':Revert to Saved_QMessageBox'}
:Revert to Saved_QMessageBox {text?='You will lose your current changes if you proceed reverting*' type='QMessageBox' unnamed='1' visible='1'}
+:RunSettingsEnvironmentDetails_Utils::DetailsButton {leftWidget=':RunSettingsUseBuildEnvironment_QLabel' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:RunSettingsUseBuildEnvironment_QLabel {text~='Us(e|ing) <b>Build Environment</b>' type='QLabel' unnamed='1' visible='1'}
:Startup.contextHelpComboBox_QComboBox {container=':Form.Startup_QGroupBox' name='contextHelpComboBox' type='QComboBox' visible='1'}
:Symbol Server_Utils::CheckableMessageBox {type='Utils::CheckableMessageBox' unnamed='1' visible='1' windowTitle='Symbol Server'}
:User Interface.languageBox_QComboBox {container=':Core__Internal__GeneralSettings.User Interface_QGroupBox' name='languageBox' type='QComboBox' visible='1'}
diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py
index ac698353dd..a48a523847 100644
--- a/tests/system/shared/editor_utils.py
+++ b/tests/system/shared/editor_utils.py
@@ -47,6 +47,8 @@ def menuVisibleAtEditor(editor, menuInList):
menuInList[0] = None
try:
menu = waitForObject("{type='QMenu' unnamed='1' visible='1'}", 500)
+ if platform.system() == 'Darwin':
+ menu.activateWindow()
success = menu.visible and widgetContainsPoint(editor, menu.mapToGlobal(QPoint(0, 0)))
if success:
menuInList[0] = menu
diff --git a/tests/system/shared/hook_utils.py b/tests/system/shared/hook_utils.py
index fca63726a1..1683a1dc3e 100644
--- a/tests/system/shared/hook_utils.py
+++ b/tests/system/shared/hook_utils.py
@@ -17,9 +17,7 @@ def modifyRunSettingsForHookInto(projectName, kitCount, port):
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN)
result = __configureCustomExecutable__(projectName, port, mkspec, qtVersion)
if result:
- clickButton(waitForObject("{window=':Qt Creator_Core::Internal::MainWindow' text='Details' "
- "type='Utils::DetailsButton' unnamed='1' visible='1' "
- "leftWidget={type='QLabel' text~='Us(e|ing) <b>Build Environment</b>' unnamed='1' visible='1'}}"))
+ ensureChecked(":RunSettingsEnvironmentDetails_Utils::DetailsButton")
envVarsTableView = waitForObject("{type='QTableView' visible='1' unnamed='1'}")
model = envVarsTableView.model()
changingVars = []
@@ -41,17 +39,23 @@ def modifyRunSettingsForHookInto(projectName, kitCount, port):
changingVars.append("SQUISH_LIBQTDIR=%s" % replacement)
else:
changingVars.append(varName)
- #test.log("Unsetting %s for run" % varName)
- clickButton(waitForObject("{text='Batch Edit...' type='QPushButton' unnamed='1' visible='1' "
- "window=':Qt Creator_Core::Internal::MainWindow'}"))
- editor = waitForObject("{type='TextEditor::SnippetEditorWidget' unnamed='1' visible='1' "
- "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}")
- typeLines(editor, changingVars)
- clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' "
- "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}"))
+ batchEditRunEnvironment(kitCount, 0, changingVars, True)
switchViewTo(ViewConstants.EDIT)
return result
+def batchEditRunEnvironment(kitCount, currentTarget, modifications, alreadyOnRunSettings=False):
+ if not alreadyOnRunSettings:
+ switchViewTo(ViewConstants.PROJECTS)
+ switchToBuildOrRunSettingsFor(kitCount, currentTarget, ProjectSettings.RUN)
+ ensureChecked(":RunSettingsEnvironmentDetails_Utils::DetailsButton")
+ clickButton(waitForObject("{text='Batch Edit...' type='QPushButton' unnamed='1' visible='1' "
+ "window=':Qt Creator_Core::Internal::MainWindow'}"))
+ editor = waitForObject("{type='TextEditor::SnippetEditorWidget' unnamed='1' visible='1' "
+ "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}")
+ typeLines(editor, modifications)
+ clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' "
+ "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}"))
+
def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, port):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN, True)
diff --git a/tests/system/suite_APTW/shared/aptw.py b/tests/system/suite_APTW/shared/aptw.py
index 447401fe42..44d42cab66 100755
--- a/tests/system/suite_APTW/shared/aptw.py
+++ b/tests/system/suite_APTW/shared/aptw.py
@@ -9,7 +9,7 @@ def verifyBuildAndRun():
# check application output log
appOutput = logApplicationOutput()
if appOutput:
- test.verify(re.search(".*([Pp]rogram).*(unexpectedly).*([Ff]inished).*", str(appOutput)) and
+ test.verify(re.search(".* exited with code \d+", str(appOutput)) and
re.search('[Ss]tarting.*', str(appOutput)),
"Verifying if built app started and closed successfully.")
diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py
index 05c7d5e4a6..327b7e977b 100644
--- a/tests/system/suite_CSUP/tst_CSUP04/test.py
+++ b/tests/system/suite_CSUP/tst_CSUP04/test.py
@@ -35,7 +35,7 @@ def main():
invokeMenuItem("File", "Exit")
return
# wait until search finished and verify search results
- waitFor("searchFinished")
+ waitFor("searchFinished", 20000)
validateSearchResult(18)
result = re.search("QmlApplicationViewer", str(editorWidget.plainText))
test.verify(result, "Verifying if: The list of all usages of the selected text is displayed in Search Results. "
@@ -49,7 +49,7 @@ def main():
searchFinished = False
type(editorWidget, "<Ctrl+Shift+U>")
# wait until search finished and verify search results
- waitFor("searchFinished")
+ waitFor("searchFinished", 20000)
validateSearchResult(3)
# exit qt creator
invokeMenuItem("File", "Save All")
diff --git a/tests/system/suite_HELP/tst_HELP02/test.py b/tests/system/suite_HELP/tst_HELP02/test.py
index 4133724fb8..b6b19ee6f8 100755
--- a/tests/system/suite_HELP/tst_HELP02/test.py
+++ b/tests/system/suite_HELP/tst_HELP02/test.py
@@ -16,9 +16,7 @@ def getQtCreatorVersionFromDialog():
def getQtCreatorVersionFromFile():
qtCreatorPriFileName = "../../../../qtcreator.pri"
# open file <qtCreatorPriFileName> and read version
- file = open(qtCreatorPriFileName, "r")
- fileText = file.read()
- file.close()
+ fileText = readFile(qtCreatorPriFileName)
chk = re.search("(?<=QTCREATOR_VERSION =)\s\d+.\d+.\d+", fileText)
try:
ver = chk.group(0).strip()
diff --git a/tests/system/suite_editors/tst_select_all/test.py b/tests/system/suite_editors/tst_select_all/test.py
index 81f051a59a..21ee3a7dc3 100644
--- a/tests/system/suite_editors/tst_select_all/test.py
+++ b/tests/system/suite_editors/tst_select_all/test.py
@@ -2,13 +2,6 @@ source("../../shared/qtcreator.py")
# This tests for QTCREATORBUG-5757
-# Results can differ from actual size on disk (different line endings on Windows)
-def charactersInFile(filename):
- f = open(filename,"r")
- content = f.read()
- f.close()
- return len(content)
-
def main():
files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")),
testData.dataset("files.tsv"))
@@ -21,7 +14,7 @@ def main():
return
for currentFile in files:
test.log("Opening file %s" % currentFile)
- size = charactersInFile(currentFile)
+ size = len(readFile(currentFile))
invokeMenuItem("File", "Open File or Project...")
selectFromFileDialog(currentFile, True)
editor = getEditorForFileSuffix(currentFile)