2013-05-15 13:17:33 +02:00
|
|
|
#############################################################################
|
|
|
|
|
##
|
2015-01-14 18:07:15 +01:00
|
|
|
## Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
## Contact: http://www.qt.io/licensing
|
2013-05-15 13:17:33 +02:00
|
|
|
##
|
|
|
|
|
## This file is part of Qt Creator.
|
|
|
|
|
##
|
|
|
|
|
## Commercial License Usage
|
|
|
|
|
## Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
## accordance with the commercial license agreement provided with the
|
|
|
|
|
## Software or, alternatively, in accordance with the terms contained in
|
2015-01-14 18:07:15 +01:00
|
|
|
## a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
## conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
## use the contact form at http://www.qt.io/contact-us.
|
2013-05-15 13:17:33 +02:00
|
|
|
##
|
|
|
|
|
## GNU Lesser General Public License Usage
|
|
|
|
|
## Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
## General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
## Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
## LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
## following information to ensure the GNU Lesser General Public License
|
|
|
|
|
## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
2015-02-13 16:51:38 +01:00
|
|
|
## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2013-05-15 13:17:33 +02:00
|
|
|
##
|
2015-01-14 18:07:15 +01:00
|
|
|
## In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
## rights. These rights are described in The Qt Company LGPL Exception
|
2013-05-15 13:17:33 +02:00
|
|
|
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
##
|
|
|
|
|
#############################################################################
|
|
|
|
|
|
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",
|
2014-01-16 16:14:07 +01:00
|
|
|
"'SyntaxError' : undeclared identifier",
|
|
|
|
|
"use of undeclared identifier 'SyntaxError'"]
|
2012-02-16 15:07:31 +01:00
|
|
|
startApplication("qtcreator" + SettingsPath)
|
2013-02-22 14:31:39 +01:00
|
|
|
if not startedWithoutPluginError():
|
|
|
|
|
return
|
2012-02-16 15:07:31 +01:00
|
|
|
# create qt quick application
|
2013-01-18 16:31:48 +01:00
|
|
|
checkedTargets, projectName = createNewQtQuickApplication(tempDir(), "SampleApp")
|
2012-02-16 15:07:31 +01:00
|
|
|
# create syntax error in cpp file
|
2013-01-30 18:15:38 +01:00
|
|
|
openDocument("SampleApp.Sources.main\\.cpp")
|
2012-02-16 15:07:31 +01:00
|
|
|
if not appendToLine(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), "viewer.showExpanded();", "SyntaxError"):
|
|
|
|
|
invokeMenuItem("File", "Exit")
|
|
|
|
|
return
|
|
|
|
|
# save all
|
|
|
|
|
invokeMenuItem("File", "Save All")
|
2012-10-29 19:22:43 +01:00
|
|
|
# build it - on all build configurations
|
2013-01-18 16:31:48 +01:00
|
|
|
availableConfigs = iterateBuildConfigs(len(checkedTargets))
|
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:
|
2013-01-18 16:31:48 +01:00
|
|
|
selectBuildConfig(len(checkedTargets), 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")
|