2016-01-15 14:55:33 +01:00
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
# Contact: https://www.qt.io/licensing/
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
# and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
# information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
#
|
|
|
|
# GNU General Public License Usage
|
|
|
|
# Alternatively, this file may be used under the terms of the GNU
|
|
|
|
# General Public License version 3 as published by the Free Software
|
|
|
|
# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
# included in the packaging of this file. Please review the following
|
|
|
|
# information to ensure the GNU General Public License requirements will
|
|
|
|
# be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
#
|
|
|
|
############################################################################
|
2013-05-15 13:17:33 +02:00
|
|
|
|
2012-03-20 11:49:37 +01:00
|
|
|
source("../../shared/qtcreator.py")
|
|
|
|
|
|
|
|
# entry of test
|
|
|
|
def main():
|
|
|
|
# prepare example project
|
2018-01-04 12:11:55 +01:00
|
|
|
sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_5_6_1_DEFAULT),
|
2016-06-01 18:22:05 +02:00
|
|
|
"quick", "animation")
|
|
|
|
proFile = "animation.pro"
|
2012-09-27 15:05:38 +02:00
|
|
|
if not neededFilePresent(os.path.join(sourceExample, proFile)):
|
2012-03-20 11:49:37 +01:00
|
|
|
return
|
|
|
|
# copy example project to temp directory
|
2016-06-01 18:22:05 +02:00
|
|
|
templateDir = prepareTemplate(sourceExample, "/../shared")
|
2012-09-27 15:05:38 +02:00
|
|
|
examplePath = os.path.join(templateDir, proFile)
|
2018-08-22 14:37:34 +02:00
|
|
|
startQC()
|
2013-02-22 14:31:39 +01:00
|
|
|
if not startedWithoutPluginError():
|
|
|
|
return
|
2016-06-01 18:22:05 +02:00
|
|
|
# open example project, supports only Qt 5
|
2017-03-02 17:28:00 +01:00
|
|
|
targets = Targets.desktopTargetClasses()
|
2018-08-02 20:50:03 +02:00
|
|
|
targets.discard(Targets.DESKTOP_4_8_7_DEFAULT)
|
2018-08-02 11:26:43 +02:00
|
|
|
openQmakeProject(examplePath, targets)
|
2012-10-29 19:22:43 +01:00
|
|
|
# build and wait until finished - 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-03-20 11:49:37 +01:00
|
|
|
# try to build project
|
|
|
|
test.log("Testing build configuration: " + config)
|
|
|
|
invokeMenuItem("Build", "Build All")
|
2014-01-21 17:29:35 +01:00
|
|
|
waitForCompile()
|
2012-03-20 11:49:37 +01:00
|
|
|
# verify build successful
|
2012-09-05 16:49:35 +02:00
|
|
|
ensureChecked(waitForObject(":Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton"))
|
2012-03-20 11:49:37 +01:00
|
|
|
compileOutput = waitForObject(":Qt Creator.Compile Output_Core::OutputWindow")
|
2013-02-04 11:08:38 +01:00
|
|
|
if not test.verify(compileSucceeded(compileOutput.plainText),
|
2012-03-20 11:49:37 +01:00
|
|
|
"Verifying building of existing complex qt application."):
|
|
|
|
test.log(compileOutput.plainText)
|
|
|
|
# exit
|
|
|
|
invokeMenuItem("File", "Exit")
|
|
|
|
# no cleanup needed, as whole testing directory gets properly removed after test finished
|
|
|
|
|