2016-01-15 14:55:33 +01:00
|
|
|
# Copyright (C) 2016 The Qt Company Ltd.
|
2022-08-19 15:59:36 +02:00
|
|
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2013-05-15 13:17:33 +02:00
|
|
|
|
2012-02-16 15:07:31 +01:00
|
|
|
source("../../shared/qtcreator.py")
|
|
|
|
|
source("../../shared/suites_qtta.py")
|
|
|
|
|
|
|
|
|
|
# entry of test
|
|
|
|
|
def main():
|
|
|
|
|
# expected error texts - for different compilers
|
|
|
|
|
expectedErrorAlternatives = ["'SyntaxError' was not declared in this scope",
|
2016-07-11 13:06:19 +02:00
|
|
|
"\xe2\x80\x98SyntaxError\xe2\x80\x99 was not declared in this scope",
|
2018-04-19 19:13:18 +02:00
|
|
|
"'SyntaxError' : undeclared identifier", # MSVC2013
|
|
|
|
|
"'SyntaxError': undeclared identifier", # MSVC2015
|
2016-05-25 15:51:15 +02:00
|
|
|
"use of undeclared identifier 'SyntaxError'",
|
|
|
|
|
"unknown type name 'SyntaxError'"]
|
2018-08-22 14:37:34 +02:00
|
|
|
startQC()
|
2013-02-22 14:31:39 +01:00
|
|
|
if not startedWithoutPluginError():
|
|
|
|
|
return
|
2012-02-16 15:07:31 +01:00
|
|
|
# create qt quick application
|
2018-08-02 11:26:43 +02:00
|
|
|
createNewQtQuickApplication(tempDir(), "SampleApp")
|
2012-02-16 15:07:31 +01:00
|
|
|
# create syntax error in cpp file
|
2021-12-13 20:41:13 +01:00
|
|
|
if not openDocument("SampleApp.SampleApp.Source Files.main\\.cpp"):
|
|
|
|
|
test.fatal("Could not open main.cpp - exiting.")
|
|
|
|
|
invokeMenuItem("File", "Exit")
|
|
|
|
|
return
|
2015-06-19 14:25:55 +02:00
|
|
|
if not appendToLine(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), "QQmlApplicationEngine engine;", "SyntaxError"):
|
2012-02-16 15:07:31 +01:00
|
|
|
invokeMenuItem("File", "Exit")
|
|
|
|
|
return
|
|
|
|
|
# save all
|
|
|
|
|
invokeMenuItem("File", "Save All")
|
2012-10-29 19:22:43 +01:00
|
|
|
# build it - on all build configurations
|
2018-08-02 11:26:43 +02:00
|
|
|
availableConfigs = iterateBuildConfigs()
|
2012-05-21 16:24:23 +02:00
|
|
|
if not availableConfigs:
|
2012-10-29 19:22:43 +01:00
|
|
|
test.fatal("Haven't found a suitable Qt version - leaving without building.")
|
|
|
|
|
for kit, config in availableConfigs:
|
2018-08-02 11:26:43 +02:00
|
|
|
selectBuildConfig(kit, config)
|
2012-02-16 15:07:31 +01:00
|
|
|
# try to compile
|
|
|
|
|
test.log("Testing build configuration: " + config)
|
2012-09-11 16:32:14 +02:00
|
|
|
clickButton(waitForObject(":*Qt Creator.Build Project_Core::Internal::FancyToolButton"))
|
2012-02-16 15:07:31 +01:00
|
|
|
# wait until build finished
|
2014-01-21 17:29:35 +01:00
|
|
|
waitForCompile()
|
2012-02-16 15:07:31 +01:00
|
|
|
# open issues list view
|
2012-09-11 16:32:14 +02:00
|
|
|
ensureChecked(waitForObject(":Qt Creator_Issues_Core::Internal::OutputPaneToggleButton"))
|
2012-02-16 15:07:31 +01:00
|
|
|
issuesView = waitForObject(":Qt Creator.Issues_QListView")
|
|
|
|
|
# verify that error is properly reported
|
|
|
|
|
test.verify(checkSyntaxError(issuesView, expectedErrorAlternatives, False),
|
|
|
|
|
"Verifying cpp syntax error while building simple qt quick application.")
|
|
|
|
|
# exit qt creator
|
|
|
|
|
invokeMenuItem("File", "Exit")
|