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
|
|
|
|
2011-08-26 12:39:04 +02:00
|
|
|
source("../../shared/qtcreator.py")
|
2011-08-25 10:05:28 +02:00
|
|
|
|
|
|
|
|
SpeedCrunchPath = ""
|
2011-08-31 13:51:32 +02:00
|
|
|
|
2012-01-17 15:09:50 +01:00
|
|
|
def buildConfigFromFancyToolButton(fancyToolButton):
|
2011-12-08 18:45:31 +01:00
|
|
|
beginOfBuildConfig = "<b>Build:</b> "
|
|
|
|
|
endOfBuildConfig = "<br/><b>Deploy:</b>"
|
|
|
|
|
toolTipText = str(fancyToolButton.toolTip)
|
|
|
|
|
beginIndex = toolTipText.find(beginOfBuildConfig) + len(beginOfBuildConfig)
|
|
|
|
|
endIndex = toolTipText.find(endOfBuildConfig)
|
|
|
|
|
return toolTipText[beginIndex:endIndex]
|
|
|
|
|
|
2011-08-25 10:05:28 +02:00
|
|
|
def main():
|
2011-09-27 11:04:12 +02:00
|
|
|
if not neededFilePresent(SpeedCrunchPath):
|
|
|
|
|
return
|
2018-08-22 14:37:34 +02:00
|
|
|
startQC()
|
2013-02-22 14:31:39 +01:00
|
|
|
if not startedWithoutPluginError():
|
|
|
|
|
return
|
2018-08-02 11:26:43 +02:00
|
|
|
openQmakeProject(SpeedCrunchPath, [Targets.DESKTOP_4_8_7_DEFAULT])
|
2013-04-25 19:08:55 +02:00
|
|
|
progressBarWait(30000)
|
2011-08-25 10:05:28 +02:00
|
|
|
|
2011-12-08 18:45:31 +01:00
|
|
|
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
2011-08-31 13:51:32 +02:00
|
|
|
|
2018-08-02 11:26:43 +02:00
|
|
|
availableConfigs = iterateBuildConfigs("Release")
|
2012-05-21 16:24:23 +02:00
|
|
|
if not availableConfigs:
|
|
|
|
|
test.fatal("Haven't found a suitable Qt version (need Release build) - leaving without building.")
|
2012-10-29 19:22:43 +01:00
|
|
|
for kit, config in availableConfigs:
|
2018-08-02 11:26:43 +02:00
|
|
|
selectBuildConfig(kit, config)
|
2012-01-17 15:09:50 +01:00
|
|
|
buildConfig = buildConfigFromFancyToolButton(fancyToolButton)
|
2012-01-17 13:47:47 +01:00
|
|
|
if buildConfig != config:
|
|
|
|
|
test.fatal("Build configuration %s is selected instead of %s" % (buildConfig, config))
|
|
|
|
|
continue
|
|
|
|
|
test.log("Testing build configuration: " + config)
|
2015-03-26 14:31:13 +01:00
|
|
|
invokeMenuItem("Build", "Run qmake")
|
|
|
|
|
waitForCompile()
|
2012-01-17 13:47:47 +01:00
|
|
|
invokeMenuItem("Build", "Rebuild All")
|
2014-01-21 17:29:35 +01:00
|
|
|
waitForCompile(300000)
|
2012-01-17 13:47:47 +01:00
|
|
|
checkCompile()
|
|
|
|
|
checkLastBuild()
|
2011-08-25 10:05:28 +02:00
|
|
|
|
|
|
|
|
# Add a new run configuration
|
|
|
|
|
|
|
|
|
|
invokeMenuItem("File", "Exit")
|
|
|
|
|
|
|
|
|
|
def init():
|
|
|
|
|
global SpeedCrunchPath
|
2012-10-17 21:11:57 +02:00
|
|
|
SpeedCrunchPath = os.path.join(srcPath, "creator-test-data", "speedcrunch", "src", "speedcrunch.pro")
|
2011-08-25 10:05:28 +02:00
|
|
|
cleanup()
|
|
|
|
|
|
|
|
|
|
def cleanup():
|
|
|
|
|
# Make sure the .user files are gone
|
2011-09-27 11:39:01 +02:00
|
|
|
cleanUpUserFiles(SpeedCrunchPath)
|
2012-10-17 21:11:57 +02:00
|
|
|
for dir in glob.glob(os.path.join(srcPath, "creator-test-data", "speedcrunch", "speedcrunch-build-*")):
|
|
|
|
|
deleteDirIfExists(dir)
|