Squish: Run tst_memberoperator with Clang code model, too

Change-Id: I3b4b2ed3523e94d5a6dee6957b5b16d4092122fd
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
Robert Loehning
2014-09-24 18:01:22 +02:00
parent ea93a6531c
commit a4321bbfe1

View File

@@ -30,26 +30,38 @@
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
def main(): def main():
startApplication("qtcreator" + SettingsPath) startCreatorTryingClang()
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
createProject_Qt_Console(tempDir(), "SquishProject") createProject_Qt_Console(tempDir(), "SquishProject")
selectFromLocator("main.cpp") models = iterateAvailableCodeModels()
cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") for current in models:
if current != models[0]:
selectCodeModel(current)
test.log("Testing code model: %s" % current)
selectFromLocator("main.cpp")
cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
for record in testData.dataset("usages.tsv"): for record in testData.dataset("usages.tsv"):
include = testData.field(record, "include") include = testData.field(record, "include")
if include: if include:
placeCursorToLine(cppwindow, "#include <QCoreApplication>") placeCursorToLine(cppwindow, "#include <QCoreApplication>")
typeLines(cppwindow, ("", "#include " + include)) typeLines(cppwindow, ("", "#include " + include))
placeCursorToLine(cppwindow, "return a.exec();") placeCursorToLine(cppwindow, "return a.exec();")
typeLines(cppwindow, ("<Up>", testData.field(record, "declaration"))) typeLines(cppwindow, ("<Up>", testData.field(record, "declaration")))
type(cppwindow, testData.field(record, "usage")) type(cppwindow, testData.field(record, "usage"))
snooze(1) # maybe find something better snooze(1) # maybe find something better
type(cppwindow, testData.field(record, "operator")) type(cppwindow, testData.field(record, "operator"))
waitFor("object.exists(':popupFrame_TextEditor::GenericProposalWidget')", 1500) waitFor("object.exists(':popupFrame_TextEditor::GenericProposalWidget')", 1500)
test.compare(str(lineUnderCursor(cppwindow)).strip(), testData.field(record, "expected")) found = str(lineUnderCursor(cppwindow)).strip()
invokeMenuItem("File", 'Revert "main.cpp" to Saved') exp = testData.field(record, "expected")
clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton")) if current == "Clang" and exp[-2:] == "->":
test.xcompare(found, exp) # QTCREATORBUG-11581
else:
test.compare(found, exp)
invokeMenuItem("File", 'Revert "main.cpp" to Saved')
clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton"))
snooze(1)
invokeMenuItem("File", "Close All")
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")