forked from qt-creator/qt-creator
Squish: Include binary editor in tests
Change-Id: I0b4fc4e0cb18dcbd569ebdba201bfb9e2596ba5b Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -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'}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user