Squish: Include binary editor in tests

Change-Id: I0b4fc4e0cb18dcbd569ebdba201bfb9e2596ba5b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
Robert Loehning
2016-02-11 20:59:31 +01:00
parent 901d74121a
commit 692261564f
6 changed files with 28 additions and 18 deletions
+1
View File
@@ -146,6 +146,7 @@
:Qt Creator.scrollArea_QScrollArea {type='ProjectExplorer::PanelsWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.splitter_QSplitter {name='splitter' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_BinEditor::BinEditorWidget {type='BinEditor::BinEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Bookmarks_TreeView {type='TreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_CloseButton {type='CloseButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton {occurrence='4' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+3
View File
@@ -266,6 +266,7 @@ def getEditorForFileSuffix(curFile, treeViewSyntax=False):
proEditorSuffixes = ["pro", "pri", "prf"]
glslEditorSuffixes= ["frag", "vert", "fsh", "vsh", "glsl", "shader", "gsh"]
pytEditorSuffixes = ["py", "pyw", "wsgi"]
binEditorSuffixes = ["bin"]
suffix = __getFileSuffix__(curFile)
expected = os.path.basename(curFile)
if treeViewSyntax:
@@ -281,6 +282,8 @@ def getEditorForFileSuffix(curFile, treeViewSyntax=False):
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
elif suffix in proEditorSuffixes or suffix in glslEditorSuffixes or suffix in pytEditorSuffixes:
editor = waitForObject(":Qt Creator_TextEditor::TextEditorWidget")
elif suffix in binEditorSuffixes:
editor = waitForObject(":Qt Creator_BinEditor::BinEditorWidget")
else:
test.log("Trying TextEditorWidget (file suffix: %s)" % suffix)
try:
+1
View File
@@ -7,3 +7,4 @@
"creator/src/plugins/coreplugin/basefilewizard.cpp"
"creator/src/plugins/coreplugin/basefilewizard.h"
"creator/tests/system/suite_debugger/tst_simple_debug/test.py"
"creator/tests/system/suite_editors/shared/testdata/binary.bin"
1 filename
7 creator/src/plugins/coreplugin/basefilewizard.cpp
8 creator/src/plugins/coreplugin/basefilewizard.h
9 creator/tests/system/suite_debugger/tst_simple_debug/test.py
10 creator/tests/system/suite_editors/shared/testdata/binary.bin
@@ -48,22 +48,25 @@ def main():
continue
contentBefore = readFile(currentFile)
popupText = "The file %s was removed. Do you want to save it under a different name, or close the editor?"
os.remove(currentFile)
test.compare(waitForObject(":File has been removed_QMessageBox").text,
popupText % currentFile)
clickButton(waitForObject(":File has been removed.Save_QPushButton"))
waitFor("os.path.exists(currentFile)", 5000)
# avoids a lock-up on some Linux machines, purely empiric, might have different cause
waitFor("checkIfObjectExists(':File has been removed_QMessageBox', False, 0)", 5000)
if not currentFile.endswith(".bin"):
popupText = "The file %s was removed. Do you want to save it under a different name, or close the editor?"
test.compare(waitForObject(":File has been removed_QMessageBox").text,
popupText % currentFile)
clickButton(waitForObject(":File has been removed.Save_QPushButton"))
waitFor("os.path.exists(currentFile)", 5000)
# avoids a lock-up on some Linux machines, purely empiric, might have different cause
waitFor("checkIfObjectExists(':File has been removed_QMessageBox', False, 0)", 5000)
test.compare(readFile(currentFile), contentBefore,
"Verifying that file '%s' was restored correctly" % currentFile)
test.compare(readFile(currentFile), contentBefore,
"Verifying that file '%s' was restored correctly" % currentFile)
# Different warning because of QTCREATORBUG-8130
popupText2 = "The file %s has been removed outside Qt Creator. Do you want to save it under a different name, or close the editor?"
os.remove(currentFile)
test.compare(waitForObject(":File has been removed_QMessageBox").text,
popupText2 % currentFile)
clickButton(waitForObject(":File has been removed.Close_QPushButton"))
# Different warning because of QTCREATORBUG-8130
popupText2 = "The file %s has been removed outside Qt Creator. Do you want to save it under a different name, or close the editor?"
os.remove(currentFile)
test.compare(waitForObject(":File has been removed_QMessageBox").text,
popupText2 % currentFile)
clickButton(waitForObject(":File has been removed.Close_QPushButton"))
test.verify(checkIfObjectExists(objectMap.realName(editor), False),
"Was the editor closed after deleting the file?")
invokeMenuItem("File", "Exit")
@@ -101,7 +101,8 @@ def main():
test.fatal("Failed to get editor - continuing...")
continue
# verify currentFile
waitFor("'addedLine' in str(editor.plainText)", 2500)
test.compare(editor.plainText, contentBefore + "addedLine\n",
"Verifying: file '%s' was reloaded modified." % currentFile)
if not currentFile.endswith(".bin"):
waitFor("'addedLine' in str(editor.plainText)", 2500)
test.compare(editor.plainText, contentBefore + "addedLine\n",
"Verifying: file '%s' was reloaded modified." % currentFile)
invokeMenuItem("File", "Exit")
@@ -35,6 +35,7 @@ source("../../shared/qtcreator.py")
def main():
files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")),
testData.dataset("files.tsv"))
files = filter(lambda x: not x.endswith(".bin"), files)
for currentFile in files:
if not neededFilePresent(currentFile):
return